[v2] Expose --bucket-name-prefix
and --bucket-region
to s3 ls
#9163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
S3's
ListBuckets
API released filter parametersPrefix
andBucketRegion
. This PR exposes the low-level parameters to the high-levels3 ls
command by exposing the--bucket-name-prefix
and--bucket-region
parameters. These parameters are only used if no S3 URI is supplied to the command:aws s3 ls --bucket-name-prefix foo
is fine.aws s3 ls s3://mybucket --bucket-name-prefix foo
is functionally the same asaws s3 ls s3://mybucket
.Decisions made:
Prefix
to--bucket-name-prefix
.s3 ls
callsListObjectsV2
under the hood if an S3 URI is supplied. In that case, the bucket name and prefix/key are parsed, and thePrefix
parameter is automatically (or implicitly) supplied. Without an S3 URI,ListBuckets
is called and thePrefix
parameter must be explicitly supplied by the high-levels3 ls
parameter. To avoid confusion,ListBuckets
'sPrefix
parameter is exposed as--bucket-name-prefix
.aws s3 ls s3://mybucket --bucket-region us-east-1
does not throw an error/warning.s3
commands.v1 PR will be opened after this is approved.