DOC-367: Recommend virtual-hosted-style S3 addressing with AWS_ENDPOINT_URL_S3 - #849
DOC-367: Recommend virtual-hosted-style S3 addressing with AWS_ENDPOINT_URL_S3#849HarshCasper wants to merge 1 commit into
Conversation
Deploying localstack-docs with
|
| Latest commit: |
2d729a6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5c6e77b8.localstack-docs.pages.dev |
| Branch Preview URL: | https://docs-agent-doc-367.localstack-docs.pages.dev |
|
FYI, it's marking Harsh as the creator of the PR but that is incorrect, it's the agent workflow bot. We need to fix this. |
bentsku
left a comment
There was a problem hiding this comment.
I suppose this is going to remove questions from users about using path style, but in most cases where the stack is a little bit complicated network wise, virtual host style makes it much more complicated. At least there is still some visibility about path style I suppose.
If we see more reports from users we can consider adapting. I just have a few comments on the content itself
| ``` | ||
|
|
||
| You should only use path-style requests if you have a specific reason: | ||
| - Your bucket names are not DNS-compliant (contain underscores, uppercase letters, etc.) |
There was a problem hiding this comment.
uppercase letters are not supported in LocalStack, this was a very old feature of AWS that has been removed ages ago
| - You're using an older SDK or tool that doesn't support virtual-hosted style | ||
| - You have specific networking constraints that prevent using wildcard DNS | ||
|
|
||
| To use path-style requests with AWS SDKs, you must explicitly enable it and use a non-S3-prefixed endpoint: |
There was a problem hiding this comment.
you can use the prefixed endpoint with path style, it's even better? Not sure why this is specified
| You should only use path-style requests if you have a specific reason: | ||
| - Your bucket names are not DNS-compliant (contain underscores, uppercase letters, etc.) | ||
| - You're using an older SDK or tool that doesn't support virtual-hosted style | ||
| - You have specific networking constraints that prevent using wildcard DNS |
There was a problem hiding this comment.
one of the big case we have in Docker compose: as you need to specify the service name, you cannot use wildcard DNS there, and it was one of the biggest source of incoming reports from users.
Summary
This PR updates the S3 documentation to recommend virtual-hosted-style addressing as the default, following AWS best practices. The key changes address contradictions in the documentation where path-style addressing was enabled alongside virtual-hosted-style endpoints.
Changes Made
1. S3 Service Documentation (
src/content/docs/aws/services/s3.mdx)AWS_ENDPOINT_URL_S3environment variable as the recommended approach2. Terraform Documentation (
src/content/docs/aws/connecting/infrastructure-as-code/terraform.mdx)s3_use_path_style = truesetting from all configuration examples that uses3.localhost.localstack.cloudendpointAWS_ENDPOINT_URL_S3for Terraform provider-aws >= 5.x3. PHP SDK Documentation (
src/content/docs/aws/connecting/aws-sdks/php.md)use_path_style_endpoint => truefrom the default exampleAudit Trail
Sources Accessed
src/content/docs/aws/services/s3.mdxsrc/content/docs/aws/connecting/infrastructure-as-code/terraform.mdxsrc/content/docs/aws/connecting/aws-sdks/php.mdCoverage Files Parsed
src/data/coverage/s3.json- Verified S3 API operations supportConfidence & Gaps Assessment
AWS_ENDPOINT_URL_S3works end-to-end with boto3, AWS CLI v2, and Terraform provider-aws v5.100.0agents.mdand maintain consistency across the documentationnpm run buildcompleted successfully with all internal links validTechnical Justification
AWS_ENDPOINT_URL_S3allows the same code/config to work against both LocalStack and real AWSs3.localhost.localstack.cloud(virtual-hosted endpoint) with path-style flags, which is self-contradictoryVerification
npm run build)agents.mdsrc/content/docs/as requiredImpact
This change improves documentation accuracy and helps users:
AWS_ENDPOINT_URL_S3) that work across tools without code changesImportant
An AI agent generated this pull request. Review all changes before you merge.