Created
June 6, 2020 23:06
-
-
Save dmitri-lerko/f391bf3b7517eead74539ce24fa6f59b to your computer and use it in GitHub Desktop.
Labels all GCS buckets on a project with label bucket:bucket_name for Cost allocation purposes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for bucket in $(gsutil ls -p project_name); do gsutil label ch -l "bucket:$(echo $bucket | cut -c 6- | sed 's/.$//' | sed 's/\./_/g')" $bucket; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment