Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

Multiple labels for storage bucket using gsutil command

How to update multiple labels at once for a storage bucket using gsutil label command? I tried a few syntaxes and it didn’t work.

1 Answers

You can set multiple labels for a bucket by using a label file in JSON format, together with gsutil label command.

The label file content looks like this:


    "your_label_key": "your_label_value",

    "your_other_label_key": "your_other_label_value"


Then you can set those labels defined in a JSON file with gsutil label set labels.json gs://your-unique-bucket.

The regular syntax gsutil label ch -l your_label_key:your_label_value gs://your-unique-bucket only accepts one label at a time.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?