AWS_S3_FORCE_PATH_STYLE environment variable is not correctly recognized
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- aws, javascript
Research direction
Start by reading shouldForcePathStyle in bin/cdklocal and the isEnvTrue helper in src/index.js. Verify how AWS_S3_FORCE_PATH_STYLE values of 1 and true are looked up, then confirm that enabling the variable makes PathStyle active without changing the existing endpoint hostname behavior.
Written by the indexing model from the issue text.
Description
Note: This issue was translated and drafted with the assistance of AI.
Description
Even when the environment variable AWS_S3_FORCE_PATH_STYLE is set to 1 or true, PathStyle remains disabled.
Version
3.0.4
Root Cause
In bin/cdklocal, the shouldForcePathStyle function passes the value of the environment variable to isEnvTrue instead of the variable name.
Since isEnvTrue in src/index.js performs a lookup using the provided argument as a key for process.env, it fails to find the correct value.
bin/cdklocal
const shouldForcePathStyle = () => {
// It currently passes the value (e.g., "1" or "true") instead of the key name
if (isEnvTrue(process.env.AWS_S3_FORCE_PATH_STYLE)) {
return true;
}
const endpointUrl = process.env.AWS_ENDPOINT_URL || "";
try {
return new URL(endpointUrl).hostname.includes(".sandbox.");
} catch {
return false;
}
};
src/index.js
const isEnvTrue = (envName) => ["1", "true"].includes(process.env[envName]);
- Dominant language
- JavaScript
- Stars
- 305
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from localstack/aws-cdk-local
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
localstack/aws-cdk-local#126 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
localstack/aws-cdk-local#114 · 1 comment · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
localstack/aws-cdk-local#113 · 4 comments · 1 reaction ·
-
localstack/aws-cdk-local#108 · 7 comments · 7 reactions · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
localstack/aws-cdk-local#102 · 3 comments · 6 reactions ·
All issues in localstack/aws-cdk-local
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·
-
client-controller-update ta-bot-triage team-money-movement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MetaMask/metamask-mobile#36594 ·