Skip to content

Instantly share code, notes, and snippets.

@apeckham
Created May 26, 2020 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apeckham/ebebbbc52c0dd7281bbc42179576016a to your computer and use it in GitHub Desktop.
Save apeckham/ebebbbc52c0dd7281bbc42179576016a to your computer and use it in GitHub Desktop.
Add cost tagging to all S3 buckets
for i in `aws s3 ls | awk '{ print $3 }'`; do echo $i; aws s3api put-bucket-tagging --bucket $i --tagging "TagSet=[{Key=S3-Bucket-Name,Value=$i}]"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment