-
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: Update calling_identity #13092
Conversation
Updates `aws_caller_identity` data source to actually include the correct attributes from the `GetCallerIdentity` API function. ``` $ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCallerIdentity_basic' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/03/27 09:26:13 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSCallerIdentity_basic -timeout 120m === RUN TestAccAWSCallerIdentity_basic --- PASS: TestAccAWSCallerIdentity_basic (12.74s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 12.767s ```
log.Printf("[DEBUG] Setting AWS Account ID to %s.", *res.Account) | ||
d.Set("account_id", *res.Account) | ||
d.Set("arn", *res.Arn) | ||
d.Set("user_id", *res.UserId) |
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.
A pattern I've seen elsewhere is to just pass in the pointer without dereferencing it, since d.Set
will automatically unwrap it safely, and thus we avoid crashes if for some reason AWS ends up returning nil
for any of these.
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.
Small feedback on the docs but otherwise this looks reasonable to me!
@@ -32,4 +40,6 @@ There are no arguments available for this data source. | |||
|
|||
## Attributes Reference | |||
|
|||
`account_id` is set to the ID of the AWS account. | |||
`account_id` - The AWS Account ID number of the account that owns or contains the calling entity. |
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 guess this wasn't a list before because there was only one item, but our usual style is for the exported attributes to be a bullet list using *
.
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. |
Updates
aws_caller_identity
data source to actually include the correct attributes from theGetCallerIdentity
API function.Fixes: #13084