-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provider/aws: Add arn attribute for DynamoDB tables #2924
Conversation
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
@@ -283,6 +283,7 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er | |||
} else { | |||
// No error, set ID and return | |||
d.SetId(*output.TableDescription.TableName) | |||
d.Set("arn", *output.TableDescription.TableARN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious, does this work without specifying arn
in the schema? I think arn
needs to be defined above, like the Kinesis resource (though you can omit the optional
and just leave it as computed).
Thanks for the contribution! I noted in-line, but I think we need two things here. First, we need the Schema: map[string]*schema.Schema{
"arn": &schema.Schema{
Type: schema.TypeString,
Computed: true,
},
"name": &schema.Schema{
[...] Second, let's move the
Then we're good to go! |
Going to go ahead and pull this in, and make those modifications myself. Thanks again! |
provider/aws: Add arn attribute for DynamoDB tables
Said changes: a1a78bd |
Whoop, good catch! Thanks for making the changes! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This commit exports the
arn
as well as theid
, since IAMroles require the full resource name rather than just the table
name. I'd even be in favor or having
arn
as theid
since the<region, tablename>
pair is the uniqueness constraint, but thiswill keep backwards compatibility:
http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html
Feedback appreciated :)