Skip to content
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

s3blob/blob: support additional endpoint query parameters #3486

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

stanhu
Copy link
Contributor

@stanhu stanhu commented Sep 11, 2024

This commit adds the following query parameters for AWS:

  1. dualstack
  2. fips
  3. accelerate (S3-only)

This avoids the need for users to specify endpoint. For example, if my AWS S3 bucket is my-bucket in us-east-1, and you want to enable transfer acceleration, dual-stack support, and/or FIPS, you would need to configure endpoint with one of the following:

  1. my-bucket.s3-accelerate.amazonaws.com
  2. my-bucket.s3-accelerate.dualstack.amazonaws.com
  3. my-bucket.s3-fips.us-gov-east-1.amazonaws.com
  4. my-bucket.s3-fips.dualstack.us-east-1.amazonaws.com

For example, for the last option, users can use s3://my-bucket?fips=true&dualstack=true.

Closes #3484

aws/aws.go Show resolved Hide resolved
aws/aws.go Show resolved Hide resolved
aws/aws.go Show resolved Hide resolved
aws/aws.go Show resolved Hide resolved
blob/s3blob/s3blob_test.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.45%. Comparing base (49a4d98) to head (602e83e).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3486      +/-   ##
==========================================
+ Coverage   73.14%   73.45%   +0.30%     
==========================================
  Files         113      113              
  Lines       14983    15155     +172     
==========================================
+ Hits        10960    11132     +172     
+ Misses       3260     3258       -2     
- Partials      763      765       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stanhu stanhu force-pushed the sh-add-s3-endpoints-opts branch 3 times, most recently from f1f85a3 to 7f41fbe Compare September 11, 2024 03:39
@stanhu stanhu requested a review from vangent September 11, 2024 04:24
aws/aws.go Outdated
@@ -215,5 +246,12 @@ func V2ConfigFromURLParams(ctx context.Context, q url.Values) (awsv2.Config, err
})
opts = append(opts, awsv2cfg.WithEndpointResolverWithOptions(customResolver))
}
if dualStack {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm if you're just going to add them down here, I think it was better before, doing it right after the parameter was processed. I thought maybe they needed to be set in the awsv2.Endpoint like HostnameImmutable, but if that's not the case then my apologies, please change it back.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, interestingly enough, they aren't passed in with the resolver.

This commit adds the following query parameters for AWS:

1. `dualstack`
2. `fips`
3. `accelerate` (S3-only)

This avoids the need for users to specify `endpoint`. For example, if
my AWS S3 bucket is `my-bucket` in `us-east-1`, and you want to enable
transfer acceleration, dual-stack support, and/or FIPS, you would need
to configure `endpoint` with one of the following:

1. `my-bucket.s3-accelerate.amazonaws.com`
2. `my-bucket.s3-accelerate.dualstack.amazonaws.com`
3. `my-bucket.s3-fips.us-gov-east-1.amazonaws.com`
4. `my-bucket.s3-fips.dualstack.us-east-1.amazonaws.com`

For example, for the last option, users can use
`s3://my-bucket?fips=true&dualstack=true`.

Closes google#3484
@vangent vangent merged commit aeb964f into google:master Sep 11, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

s3blob/blob: support additional endpoint parameters: UseDualStack, UseFips, and UseAccelerate options
2 participants