Skip to content
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

Add 'arn' attribute to 'aws_redshift_service_account' data source #1775

Conversation

ewbankkit
Copy link
Contributor

Similar to hashicorp/terraform#8700 for the aws_elb_service_account data source, add the arn attribute to the aws_redshift_service_account data source.
Acceptance tests:

make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRedshiftServiceAccount_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAWSRedshiftServiceAccount_ -timeout 120m
=== RUN   TestAccAWSRedshiftServiceAccount_basic
--- PASS: TestAccAWSRedshiftServiceAccount_basic (31.19s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	32.215s

@ewbankkit
Copy link
Contributor Author

arn already included for aws_cloudtrail_service_account data source in #1774.

@@ -45,6 +49,7 @@ func dataSourceAwsRedshiftServiceAccountRead(d *schema.ResourceData, meta interf

if accid, ok := redshiftServiceAccountPerRegionMap[region]; ok {
d.SetId(accid)
d.Set("arn", fmt.Sprintf("arn:%s:iam::%s:user/logs", meta.(*AWSClient).partition, accid))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should use fmt.Sprintf here - I think we should use the ARN package as part of AWS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

@ewbankkit
Copy link
Contributor Author

Added arn.go and arn_test.go:

go test ./aws/ -run=TestArn_
ok  	github.com/terraform-providers/terraform-provider-aws/aws	0.934s

make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRedshiftServiceAccount_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAWSRedshiftServiceAccount_ -timeout 120m
=== RUN   TestAccAWSRedshiftServiceAccount_basic
--- PASS: TestAccAWSRedshiftServiceAccount_basic (44.71s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	45.793s

@radeksimko radeksimko added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 2, 2017
@stack72
Copy link
Contributor

stack72 commented Oct 4, 2017

@ewbankkit this looks much nicer without the fmt.Sprintf :)

@ewbankkit
Copy link
Contributor Author

@stack72 Anything more you need me to do on this one?

Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @ewbankkit

@radeksimko radeksimko merged commit 354aee4 into hashicorp:master Oct 11, 2017
@ewbankkit ewbankkit deleted the add-data_source_redshift_service_account-arn branch October 12, 2017 11:31
@ghost
Copy link

ghost commented Apr 10, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants