-
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
Support AWS cn-northwest-1 Ningxia (fixes #3053) #3142
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 @kwerey!
Thanks for the kind words and diving into this! We do not have fully written documentation around adding a region yet since it happens infrequently, but here are some additional items to make this PR ready to go. These are mostly around getting new AWS account IDs for services that are currently published. If you do not have time for the additional work, please let us know and we can finish this up for you keeping your existing commit.
- Add
"cn-northwest-1": "", // Not supported as of January 2018
toaws/data_source_aws_elb_hosted_zone_id.go
- Add
"cn-northwest-1": "", // Not supported as of January 2018
toaws/hosted_zones.go
- Add
"cn-northwest-1": "681348832753",
toaws/data_source_aws_cloudtrail_service_account.go
- Add
"cn-northwest-1": "037604701340",
toaws/data_source_aws_elb_service_account.go
- Add
"cn-northwest-1": "660998842044",
toaws/data_source_aws_redshift_service_account.go
Thanks so much!
Brian
Maintainer's notes:
I do not believe we have written documentation on this yet, but using #2707 as a baseline, adding a new region is currently:
- Add region to
aws/config.go
(maybe can be handled automatically by the SDKendpoints
helper functions: https://docs.aws.amazon.com/sdk-for-go/api/aws/endpoints/) - Check Regions and Endpoints ELB regions and add Route53 Hosted Zone IDs to
aws/data_source_aws_elb_hosted_zone_id.go
- Check Regions and Endpoints S3 website endpoints and add Route53 Hosted Zone ID to
aws/hosted_zones.go
- Check CloudTrail Supported Regions docs and add AWS Account ID to
aws/data_source_aws_cloudtrail_service_account.go
- Check Elastic Load Balancing Access Logs docs and add Elastic Load Balancing Account ID to
aws/data_source_aws_elb_service_account.go
- Check Redshift Database Audit Logging AWS Account ID docs and add to
aws/data_source_aws_redshift_service_account.go
No problem Brian, I've added those IDs. |
e5c1f9a
to
ff22562
Compare
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.
LGTM!
Sorry I realized I didn't specifically answer your question here:
The endpoints package in the AWS Go SDK does have constants and some helper functions which we could utilize to automate this region/partition handling/validation for us. We would greatly appreciate any pull requests that utilized either the region constants across the codebase or the helper functions. 😄 |
Thanks for removing those empty mappings (that was a bad recommendation on my part). I'm going to merge this in so this new region can potentially be used starting with the v1.8.0 release. |
No problem, I read the thread on that docs PR and went "yup, that's legit". I'd love to see cloud integration tools move away from having to keep all these lists in their own codebases - if we end up committing to TF at my shop I'll try to get some work in on it. |
Sweet, I get 'contributor' by my name! \o/ Thanks for getting feedback in on this PR so quick, it's really neat to be able to just jump in and get something useful sorted out in a project in a matter of hours. |
This has been released in terraform-provider-aws version 1.8.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. Important note: if you're planning on using |
* commit '8937a3a4e9d77c8089cf147861b604e3a2d8cf7e': (47 commits) v1.8.0 Update CHANGELOG.md resource/aws_dynamodb_table: Refactoring (hashicorp#3136) Update CHANGELOG for hashicorp#3171 resource/aws_elastic_beanstalk_application: Prevent crash on reading missing application chore(vendor): bump aws-sdk-go to v1.12.70 typo guardduty import test Update CHANGELOG for hashicorp#3142 Removed empty strings test/aws_dynamodb_global_table: Use single region for basic and import testing resource/aws_sqs_queue: Retry creation on QueueDeletedRecently for additional 10 seconds docs/CONTRIBUTING: Use aws_cloudwatch_dashboard for acceptance test examples docs/CONTRIBUTING: New Region: don't add empty mappings Update CHANGELOG.md resource/aws_rds_cluster: Retry deletion on InvalidDBClusterStateFault docs/CONTRIBUTING: Remove pre-split provider directory references from testacc commands Add service account IDs docs/CONTRIBUTING: New Region Support AWS cn-northwest-1 Ningxia (fixes hashicorp#3053) Update CHANGELOG.md ... # Conflicts: # aws/validators.go
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! |
Hi Terraform team - this adds the new Ningxia region to the list of valid options for the AWS provider, fixing #3053
A lot of the acceptance tests will fail run in Nginxia, since the region doesn't support a very large number of AWS services, but these changes let the provider can successfully make client connections to the region:
I've not read a single line of go source code before today, so please let me know if there's a neater way to add the region. Is there an "is in [list of regions]" comparison operator for strings? I didn't see one with a cursory google!
Thanks for making a cool project, I've spent a few days prototyping stuff in TF and I like it lot 👍