GCP newbie here, hopefully there is a quick answer I'm missing.
I have project with a GCE VM running in it. I'd like to backup a data set from time to time to GCP's object storage. My plan is to run 'gsutil rsync ...' from a cron job.
I created a bucket for the job to use. I did not edit permissions, roles or anything on the bucket.
I run "sudo su -" so that I am running as root, as I expect a cron job will, then type
gsutil rsync -r -d <dir to back up> gs://<bucket>/
and I get
AccessDeniedException: 403 Insufficient Permission
While in this state, I typed 'gcloud config list' and got
account = <xyz>[email protected]
disable_usage_reporting = True
project = <project id>
Your active configuration is: [default]
This is the default service account created when I created the VM. I've not done any editing on it.
In the console, I went to IAM->service accounts, click on this service account, click on the permissions tab, and I see that this service account is an Editor on <project id>
In the console I go to Cloud Storage, Browse, click on my bucket, go to the permissions tab, and I see that the role of Editor on has roles 'Storage Legacy Bucket Owner' and 'Storage Legacy Object Owner' Looking at those roles, I am told the first is read/write access to existing buckets with create/list/delete permissions on objects. The second gives me read/write access to existing objects.
I've verified that the bucket is, at the moment, empty.
What do I need to do to enable my gsutil command to run with sufficient permissions?