I have a Google Cloud Service Account user created in Terraform:
resource "google_service_account" "firestore_sa" {
account_id = "firestore_sa_${random_id.project-unique-id.hex}"
}
I want to give the Service Account owner access to Firestore and tried this without any luck:
resource "google_service_account_iam_binding" "firestore_sa_role" {
service_account_id = google_service_account.firestore_sa.name
role = "roles/datastore.owner"
members = ["serviceAccount:${google_service_account.firestore_sa.email}"]
}
The error I get is:
Error 400: Role roles/datastore.owner is not supported for this resource., badRequest
I can add this easily enough using GCloud:
gcloud projects add-iam-policy-binding MyProject-ABC123 \
--member serviceAccount:[email protected] \
--role roles/datastore.owner
I am having a problem translating between the two and could use some help.