I have been trying to setup a terraform backend to store state files in GCS bucket. I have created a service account which is a project owner and having gcs bucket storage admin access, but still am facing below error:
Initializing the backend...
Error loading state: 2 errors occurred:
* writing "gs://terraform-ubuntu-state-maintain/gcp/terraform.tfstate/default.tflock" failed: googleapi: Error 403: Insufficient Permission, insufficientPer
missions
* storage: object doesn't exist.
p.s: the gcs bucket is also created already with the prefix path "gcp".Also permission is given to the service account.
terraform
section of your configuration files look like? Specifically the backend stanza. Have you provided a "credentials" parameter? If not then you are using application default credentials. Try using gsutil cp to copy a random file to your bucket and see if you have permissions to perform that task. – KolbanCompute Storage Admin
Owner
Storage Admin
Storage Object Admin
– tdensmore