feat: CDK_S3_FORCE_PATH_STYLE forces S3 path-style addressing#1625
feat: CDK_S3_FORCE_PATH_STYLE forces S3 path-style addressing#1625peter-smith-phd wants to merge 1 commit into
CDK_S3_FORCE_PATH_STYLE forces S3 path-style addressing#1625Conversation
Setting the `CDK_S3_FORCE_PATH_STYLE` environment variable enables path-style addressing on the S3 clients used for asset publishing and by the toolkit, which is useful when targeting custom or local S3 endpoints.
|
Is there a way to autoderive the correct behavior here? Zero-conf is better than an option fleet... |
Great question. This option is solely necessary when the user sets a custom So, we could automatically set The most accurate solution would be to detect |
The AWS SDK addresses S3 buckets using virtual-hosted-style URLs by default (
https://<bucket>.s3.amazonaws.com). When targeting custom or local S3-compatible endpoints (for example LocalStack or MinIO), path-style addressing (https://<endpoint>/<bucket>) is often required instead.Setting the
CDK_S3_FORCE_PATH_STYLEenvironment variable now enables path-style addressing on the S3 clients used for asset publishing (cdk-assets-lib) and by the toolkit (toolkit-lib). When the variable is unset, behavior is unchanged and the SDK default applies.This follows the existing convention of CDK-specific environment variables such as
CDK_DOCKERandCDK_HOME.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license