From 1bb77006c0a83f41028dbb928c2e723cd36dec3c Mon Sep 17 00:00:00 2001 From: AllanZhengYP Date: Wed, 2 Feb 2022 15:07:32 -0800 Subject: [PATCH] docs(middleware-bucket-endpoint): clarification for bucketEndpoint config (#3273) Co-authored-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> --- UPGRADING.md | 4 +++- .../middleware-bucket-endpoint/src/configurations.ts | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 27021072c1468..d1aa302d36328 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -146,7 +146,9 @@ might not have the same name either. more [in v3 reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/interfaces/_aws_sdk_types.retrystrategy-1.html) - [`s3BucketEndpoint`](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#s3BucketEndpoint-property) - **v2**: Whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). - - **v3**: Renamed to `bucketEndpoint` + - **v3**: Changed to `bucketEndpoint`. See more in [v3 reference for bucketEndpoint](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/interfaces/s3clientconfig.html#bucketendpoint). + Note that when set to `true`, you specify the request endpoint in the `Bucket` request parameter, the original endpoint + will be overwritten. Whereas in v2, the request endpoint in client constructor overwrites the `Bucket` request parameter. - [`s3DisableBodySigning`](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#s3DisableBodySigning-property) - **v2**: Whether to disable S3 body signing when using signature version v4. - **v3**: Renamed to `applyChecksum` diff --git a/packages/middleware-bucket-endpoint/src/configurations.ts b/packages/middleware-bucket-endpoint/src/configurations.ts index e1bb03f0d2d23..a89345880cad7 100644 --- a/packages/middleware-bucket-endpoint/src/configurations.ts +++ b/packages/middleware-bucket-endpoint/src/configurations.ts @@ -2,7 +2,16 @@ import { Provider, RegionInfoProvider } from "@aws-sdk/types"; export interface BucketEndpointInputConfig { /** - * Whether the provided endpoint addresses an individual bucket. + * Whether to use the bucket name as the endpoint for this request. The bucket + * name must be a domain name with a CNAME record alias to an appropriate virtual + * hosted-style S3 hostname, e.g. a bucket of `images.johnsmith.net` and a DNS + * record of: + * + * ``` + * images.johnsmith.net CNAME images.johnsmith.net.s3.amazonaws.com. + * ``` + * + * @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#VirtualHostingCustomURLs */ bucketEndpoint?: boolean; /**