Google Cloud Storage: bulk edit ACLs

google-cloud-storage

Solution

You can use the `gsutil acl ch` command to do this as follows:

gsutil -m acl ch -R -g All:R gs://bucket1 gs://bucket2/object ...

where:

- `-m` sets multi-threaded mode, which is faster for a large number of objects

- `-R` recursively processes the bucket and all of its contents

- `-g All:R` grants all users read-only access

See the `acl` documentation for more details.

You can use Google Cloud Shell as your console via a web browser if you just need to run a single command via `gsutil`, as it comes preinstalled in your console VM.

Problem

We are in the process of moving our servers into the Google Cloud Compute Engine and starting to look the Cloud Storage as a CDN option. I uploaded about 1,000 files through the Developer Console but the problem is all the Object Permissions for All Users is set at None. I can't find any way to edit all the permissions to give All Users Reader access. Am I missing something?

Original source