Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provider: Adjust globalaccelerator, route53, and shield service clien…
…t regions to only configure in appropriate partition Reference: #8999 Reference: https://aws.amazon.com/about-aws/whats-new/2019/05/amazon-route-53-launches-private-dns-and-health-checks-in-the-aws-govcloud-us-west-region/ Previously, the provider service client customizations would hardcode the following region configurations: * globalaccelerator: us-west-2 * route53: us-east-1 * shield: us-east-1 With the launch of private Route 53 Hosted Zones in AWS GovCloud (US), hardcoding the Route 53 service region to us-east-1 is no longer appropriate in all cases. The provider initialization logic now uses the inferred AWS partition information to set these clients to known regions in known partitions now. To also support the launch of Route 53 in AWS GovCloud (US), the provider initialization will configure the endpoint in that partition to the appropriate hostname, until the AWS Go SDK is updated to include that endpoint information. Previous output from acceptance testing in AWS GovCloud (US): ``` --- FAIL: TestAccAwsGlobalAcceleratorAccelerator_basic (4.14s) testing.go:568: Step 0 error: errors during apply: Error: Error creating Global Accelerator accelerator: UnrecognizedClientException: The security token included in the request is invalid. --- FAIL: TestAccAWSRoute53Zone_VPC_Single (17.10s) testing.go:568: Step 0 error: errors during apply: Error: error creating Route53 Hosted Zone: InvalidClientTokenId: The security token included in the request is invalid. --- FAIL: TestAccAWSRoute53Zone_VPC_Multiple (17.12s) testing.go:568: Step 0 error: errors during apply: Error: error creating Route53 Hosted Zone: InvalidClientTokenId: The security token included in the request is invalid. --- FAIL: TestAccAWSRoute53Zone_VPC_Updates (17.35s) testing.go:568: Step 0 error: errors during apply: Error: error creating Route53 Hosted Zone: InvalidClientTokenId: The security token included in the request is invalid. --- FAIL: TestAccAWSShieldProtection_ElasticIPAddress (1.53s) resource_aws_shield_protection_test.go:225: unexpected PreCheck error: UnrecognizedClientException: The security token included in the request is invalid. ``` Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAwsGlobalAcceleratorAccelerator_basic (67.03s) --- PASS: TestAccAWSRoute53Zone_VPC_Single (65.90s) --- PASS: TestAccAWSRoute53Zone_VPC_Multiple (110.68s) --- PASS: TestAccAWSRoute53Zone_VPC_Updates (195.53s) --- PASS: TestAccAWSShieldProtection_ElasticIPAddress (13.39s) ``` Output from acceptance testing in AWS GovCloud (US) (handling now correct for partition): ``` --- FAIL: TestAccAwsGlobalAcceleratorAccelerator_basic (5.42s) testing.go:568: Step 0 error: errors during apply: Error: Error creating Global Accelerator accelerator: RequestError: send request failed caused by: Post https://globalaccelerator.us-gov-west-1.amazonaws.com/: dial tcp: lookup globalaccelerator.us-gov-west-1.amazonaws.com: no such host --- PASS: TestAccAWSRoute53Zone_VPC_Single (62.37s) --- PASS: TestAccAWSRoute53Zone_VPC_Multiple (93.66s) --- PASS: TestAccAWSRoute53Zone_VPC_Updates (164.85s) --- SKIP: TestAccAWSShieldProtection_ElasticIPAddress (1.48s) resource_aws_shield_protection_test.go:221: skipping acceptance testing: RequestError: send request failed caused by: Post https://shield.us-gov-west-1.amazonaws.com/: dial tcp: lookup shield.us-gov-west-1.amazonaws.com: no such host ```
- Loading branch information