Skip to content

aws s3 ls not respecting AWS_ENDPOINT_URL #9505

Closed
@rsyring

Description

@rsyring

Describe the bug

When using aws s3 ls with an AWS_ENDPOINT_URL environment variable, the CLI does not respect the variable.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Based on the docs at: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-endpoints.html

I'd expect to be able to:

AWS_ENDPOINT_URL=example.com aws cli ls s3://bucket-name

Current Behavior

An error is thrown which indicates the AWS URL is still being used:

Could not connect to the endpoint URL: "https://example.s3.ENAM.amazonaws.com/?list-type=2&prefix=&delimiter=%2F&encoding-type=url"

Reproduction Steps

$ AWS_ENDPOINT_URL=https://example.com AWS_REGION=ENAM aws s3 ls s3://leancto-dev-media

Could not connect to the endpoint URL: "https://leancto-dev-media.s3.ENAM.amazonaws.com/?list-type=2&prefix=&delimiter=%2F&encoding-type=url"

$ AWS_ENDPOINT_URL=https://example.com AWS_REGION=ENAM aws s3 ls s3://leancto-dev-media --endpoint-url $AWS_ENDPOINT_URL

An error occurred (404) when calling the ListObjectsV2 operation: Not Found

If the AWS_ENDPOINT_URL was being respected, the same error would occur for both invocations.

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/2.27.20 Python/3.13.3 Linux/6.8.0-58-generic exe/x86_64.ubuntu.24

Environment details (OS name and version, etc.)

See above

Metadata

Metadata

Labels

bugThis issue is a bug.p2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.s3

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions