hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.8k stars 9.15k forks source link

Proposal: Handling endpoint differences for S3 in the AWS SDK for Go v1 and v2 #33028

Open gdavison opened 1 year ago

gdavison commented 1 year ago

Description

The S3 resources in the AWS Provider are currently implemented using the AWS SDK for Go v1. The team will be updating the SDK for S3 (and other service) to the AWS SDK for Go v2. In v1, the S3 client uses a global endpoint (s3.amazonaws.com) in us-east-1 and regional endpoints (s3.<region>.amazonaws.com) for all others.

However, in v2, the S3 client uses regional endpoints for all regions. In practice, this change is unlikely to impact users, but some AWS account setups may restrict how endpoints are used, so it is potentially a breaking change.

v1 supports using regional endpoints for all regions using the environment variable AWS_S3_US_EAST_1_REGIONAL_ENDPOINT, the shared config parameter s3_us_east_1_regional_endpoint, or the Go config parameter S3UsEast1RegionalEndpoint. The valid values are legacy (i.e. global endpoint for us-east-1) or regional.

v2 supports uses regional endpoints for all regions, as well as supporting a pseudo-region aws-global which uses the global endpoint.

Proposal

  1. Add support for the S3 us-east-1 regional endpoint configuration settings to the AWS Provider. This will preserve the current behaviour unless it is set to regional, which will then use regional endpoints in all regions
  2. When the S3 client is updated to use the AWS SDK for Go v2, preserve the v1 behaviour of defaulting to the global endpoint in us-east-1 and continue supporting the configuration parameters
  3. When the AWS Provider v6 is released, deprecate support for the global S3 endpoint
  4. When the AWS Provider v7 is released, drop support for the global S3 endpoint

Affected Resource(s) and/or Data Source(s)

All S3 resources

Potential Terraform Configuration

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue