-
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
provider: Automatically validate new regions from AWS SDK #3159
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.
I like the idea, although manual maintenance kind of forced us to support the region fully (i.e. lookup all the account IDs etc.) instead of semi-automatically providing basic support.
Overall I'm happy for you to merge this, but not before addressing this https://github.com/terraform-providers/terraform-provider-aws/blob/c7e748cff0995061b1ceacc444d9e92ece430d77/aws/hosted_zones.go#L28
Otherwise there's chance we'll expose people to crash once Amazon introduces new region and we bump SDK and forget to lookup the ID and add it to the map.
It turns out that code is actually "okay" (at least from crash standpoint): https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/hosted_zones_test.go#L15 The type is |
Right, so it won't crash 👌 You just made me think that maybe for some lists, like this one in particular we should actually silently fail to allow folks use the S3 bucket resource, but I still think such failure should be logged as |
I think there are some nuances to consider. I think cn-northwest-1 for example supports S3 buckets but not S3 website hosting. As long as we "best effort" support some functionality that AWS is inconsistently offering across regions then I'll apply any changes you'd like |
…eturn WARN log for now
Changed the S3 website hosted zone ID function signature to |
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 has been released in terraform-provider-aws version 1.9.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Reference: https://docs.aws.amazon.com/sdk-for-go/api/aws/endpoints/
This version keeps the stricter
==
matching forValidateRegion()
, but we could loosen it to the below, which would also turn on regexp matching.