-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
d/Adds a url_suffix attribute to data_source_aws_partition #5602
Conversation
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.
Hi @lorengordon 👋 Thanks for submitting this and apologies for the long silence here. I left some initial feedback below. Please let us know if you have any questions or do not have time to implement these items.
@@ -458,6 +459,20 @@ func (c *Config) Client() (interface{}, error) { | |||
} | |||
} | |||
|
|||
// Infer URL Suffix from STS Endpoint | |||
resolver := endpoints.DefaultResolver() | |||
endpoint, err := resolver.EndpointFor(endpoints.StatesServiceID, client.region) |
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.
The comment notes inferring this information from the STS endpoint, however its using the states service.
That said, the AWS Go SDK documentation lists the XXXServiceID
constants as deprecated: https://docs.aws.amazon.com/sdk-for-go/api/aws/endpoints/#pkg-constants
Deprecated: Use client package's EndpointsID value instead of these ServiceIDs. These IDs are not maintained, and are out of date.
This should be swapped out according to that deprecation.
Ideally though, we should fetch this information directly from the AWS Go SDK endpoints information first, then only fallback to parsing an endpoint should that fail since endpoint hostnames may not always follow a consistent implementation. I have submitted an upstream feature request in the AWS to directly provide the DNS suffix information, which can help prevent us from hardcoding these cases in the future: aws/aws-sdk-go#2710
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.
This one I'm not sure when I'll have time to research and figure out the alternative. If anyone wants to take it, please be my guest!
Thanks so much for your patience, @lorengordon -- I was able to get the DNS suffix information visible from the AWS Go SDK (aws/aws-sdk-go#2711), rebase this PR, default to using that new information, and add verifying acceptance testing when setting the region to AWS Commercial, GovCloud (US), and China 👍
|
Brilliant! Thanks @bflad! |
This has been released in version 2.23.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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! |
Fixes #1960
Changes proposed in this pull request:
urlsuffix
attribute to theAWSClient
structurl_suffix
attribute todata_source_aws_partition
Output from acceptance testing: