I am trying to create a Cloud SQL PostgreSQL instance using Terraform. I am using a Service Account as credentials for Google, and I have assigned the Cloud SQL Admin role to the Service Account. I am quite lost with the error message I am receiving. Any idea if I need to add other rules to my Service Account?
google_sql_database_instance.postgres_instance: Creating...
Error: Error, failed to create instance postgresql-dev: googleapi: Error 403: The client is not authorized to make this request., notAuthorized
with google_sql_database_instance.postgres_instance,
on main.tf line 402, in resource "google_sql_database_instance" "postgres_instance":
402: resource "google_sql_database_instance" "postgres_instance" {
I tried to add the Owner rule and I am getting the same error message.
master_instance_nameset, but I was creating an instance without replicas. By removing this value, the issue was resolved.