From 0619898f6a6692b2cd5b0da96987da9cd67c681a Mon Sep 17 00:00:00 2001 From: clint shryock Date: Tue, 8 Dec 2015 10:52:17 -0600 Subject: [PATCH] provider/aws: Add arn to DB Instance output --- builtin/providers/aws/resource_aws_db_instance.go | 6 ++++++ .../source/docs/providers/aws/r/db_instance.html.markdown | 1 + 2 files changed, 7 insertions(+) diff --git a/builtin/providers/aws/resource_aws_db_instance.go b/builtin/providers/aws/resource_aws_db_instance.go index f0649d582..517fc738d 100644 --- a/builtin/providers/aws/resource_aws_db_instance.go +++ b/builtin/providers/aws/resource_aws_db_instance.go @@ -31,6 +31,11 @@ func resourceAwsDbInstance() *schema.Resource { ForceNew: true, }, + "arn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "username": &schema.Schema{ Type: schema.TypeString, Required: true, @@ -553,6 +558,7 @@ func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error { } log.Printf("[DEBUG] Error building ARN for DB Instance, not setting Tags for DB %s", name) } else { + d.Set("arn", arn) resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{ ResourceName: aws.String(arn), }) diff --git a/website/source/docs/providers/aws/r/db_instance.html.markdown b/website/source/docs/providers/aws/r/db_instance.html.markdown index 55d13e250..1c75f977a 100644 --- a/website/source/docs/providers/aws/r/db_instance.html.markdown +++ b/website/source/docs/providers/aws/r/db_instance.html.markdown @@ -93,6 +93,7 @@ The following attributes are exported: * `id` - The RDS instance ID. * `address` - The address of the RDS instance. +* `arn` - The ARN of the RDS instance. * `allocated_storage` - The amount of allocated storage * `availability_zone` - The availability zone of the instance * `backup_retention_period` - The backup retention period