Skip to content

Commit

Permalink
fix(storage): Add support for dualside encryption even if acceleratio…
Browse files Browse the repository at this point in the history
…n is off (#3220)

* Add support for dualside encryption even if acceleration is off

* Use correct hostname (include region)

---------

Co-authored-by: Thomas Leing <leint@amazon.com>
Co-authored-by: gpanshu <91897496+gpanshu@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 16, 2023
1 parent 9fb54ba commit 516f48e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4764,6 +4764,12 @@ protected <X extends AmazonWebServiceRequest> Request<X> createRequest(String bu
clientConfiguration);
}
}
else {
if (clientOptions.isDualstackEnabled()) {
String hostname = String.format(Constants.S3_DUALSTACK_HOSTNAME, getRegionName());
endpoint = RuntimeHttpUtils.toUri(hostname, clientConfiguration);
}
}

request.setHttpMethod(httpMethod);
resolveRequestEndpoint(request, bucketName, key, endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class Constants {
public static final String S3_EXTERNAL_1_HOSTNAME = "s3-external-1.amazonaws.com";
/** Service hostname for accessing accelerated S3 buckets */
public static final String S3_ACCELERATE_HOSTNAME = "s3-accelerate.amazonaws.com";
/** Service hostname for accessing dualstack S3 buckets; format argument is the region */
public static final String S3_DUALSTACK_HOSTNAME = "s3.dualstack.%s.amazonaws.com";
/** Service hostname for accessing dualstack accelerated S3 buckets */
public static final String S3_ACCELERATE_DUALSTACK_HOSTNAME = "s3-accelerate.dualstack.amazonaws.com";

Expand Down

0 comments on commit 516f48e

Please sign in to comment.