Skip to content

[v2] Add tagging support for the s3 mb command#10114

Open
aemous wants to merge 8 commits intoaws:v2from
aemous:s3-tags-mb
Open

[v2] Add tagging support for the s3 mb command#10114
aemous wants to merge 8 commits intoaws:v2from
aemous:s3-tags-mb

Conversation

@aemous
Copy link
Contributor

@aemous aemous commented Mar 2, 2026

Issues:

Description of changes:

  • Added support for specifying tags on bucket creation for the aws s3 mb command.
  • Added functional tests for testing the new feature.
  • Added a new aws s3 mb command example using the new flag.

Description of test:

  • Ran a successful build-and-validate workflow.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aemous aemous requested a review from a team March 2, 2026 16:47
@aemous aemous changed the title Add functional tests. [v2] Add tagging support for the s3 mb command Mar 2, 2026
@aemous aemous marked this pull request as ready for review March 2, 2026 19:39
@AndrewAsseily AndrewAsseily self-requested a review March 2, 2026 19:47
@aemous aemous requested a review from AndrewAsseily March 9, 2026 17:14
AndrewAsseily
AndrewAsseily previously approved these changes Mar 9, 2026
bucket_config = {}
bucket_tags = self._create_bucket_tags(parsed_args)

# Only set LocationConstraint when the region name is not us-east-1.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nit: double space in "when the region name" on this comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good otherwise! Approving 🏆

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, revised.

AndrewAsseily
AndrewAsseily previously approved these changes Mar 10, 2026
Copy link
Contributor

@AndrewAsseily AndrewAsseily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Member

@kdaily kdaily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: If the flag can only hold one tag, and you can specify it multiple times, then why is the name the plural tags instead of tag?

@aemous
Copy link
Contributor Author

aemous commented Mar 10, 2026

Question: If the flag can only hold one tag, and you can specify it multiple times, then why is the name the plural tags instead of tag?

Do you have a strong preference for the singular form? I'm open to feedback on this.

My reason for choosing plural is because the flag forms a list of tags (i.e. argparse represents the flag as a list). It may be a bit weird for it to be named tag but in code it is a list of multiple tags.

@kdaily
Copy link
Member

kdaily commented Mar 10, 2026

Fair enough, not that strongly. However, the proposed syntax does deviate from other existing commands besides s3 that have tagging support that use --tags Key1=Value1 Key2=Value2 syntax. Just confirming we considered that in the design here.

#9981

@AndrewAsseily
Copy link
Contributor

Fair enough, not that strongly. However, the proposed syntax does deviate from other existing commands besides s3 that have tagging support that use --tags Key1=Value1 Key2=Value2 syntax. Just confirming we considered that in the design here.

#9981

When thinking about this earlier, I found that --tags (plural) is overwhelmingly the convention across the CLI, though I don't feel too strongly about either in this case.
On the Key=Value syntax, the design doc covers this. The shorthand syntax parser has character limitations (e.g., @ is reserved for key@=file:// loading), which would break for valid S3 tag keys. The Key Value format with nargs=2 avoids that issue

kdaily
kdaily previously approved these changes Mar 10, 2026
@ashovlin
Copy link
Member

Can you add a changelog entry and a new example of using it?

@aemous
Copy link
Contributor Author

aemous commented Mar 10, 2026

Can you add a changelog entry and a new example of using it?

I've added both in latest revision.

@aemous aemous dismissed stale reviews from kdaily and AndrewAsseily via 05a22a3 March 10, 2026 18:37
@aemous aemous requested a review from AndrewAsseily March 10, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants