provider/aws: Add arn attribute for DynamoDB tables

This commit exports the `arn` as well as the `id`, since IAM
roles require the full resource name rather than just the table
name. I'd even be in favor or having `arn` as the `id` since the
<region, tablename> pair is the uniqueness constraint, but this
will keep backwards compatibility:

http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html
This commit is contained in:
Calvin French-Owen 2015-08-03 13:57:24 -07:00
parent 2cea7c7d0c
commit cb2d90a7d9
2 changed files with 12 additions and 10 deletions

View File

@ -283,6 +283,7 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er
} else { } else {
// No error, set ID and return // No error, set ID and return
d.SetId(*output.TableDescription.TableName) d.SetId(*output.TableDescription.TableName)
d.Set("arn", *output.TableDescription.TableARN)
return nil return nil
} }
} }

View File

@ -109,5 +109,6 @@ infinite loop in planning.
The following attributes are exported: The following attributes are exported:
* `arn` - The arn of the table
* `id` - The name of the table * `id` - The name of the table