Hi! I'm trying Pulumi in a fresh Google Cloud proj...
# general
p
Hi! I'm trying Pulumi in a fresh Google Cloud project. I managed to create ServiceAccounts and Networks etc. with
pulumi
, but when it comes to creating a Cloud SQL Instance
pulumi
responds with:
Copy code
gcp:sql:DatabaseInstance (db1):
    error: Plan apply failed: Error, failed to create instance db1: googleapi: Error 403: The client is not authorized to make this request., notAuthorized
Any idea why that might be the case? I'm obviously authorized (with my Google Account, role
owner
of the GCP project) via
gcloud auth login
and
gcloud auth application-default login
g
Have you enabled the Cloud SQL api for your project? Some of the google services must be enabled first. This is done in the google cloud console.
p
Thanks @gentle-diamond-70147! This was my first attempt after reading the message, but it did not change anything. I enabled SQL API and the SQL Admin API (just to be sure).
g
Are you able to manually create a database in the console?
p
Just checked,
Copy code
$ gcloud sql instances create test-db
 --database-version MYSQL_5_7 --storage-size=100
succeeds and I can see the DB in the GCloud UI.
I suspect some kind of (project) misconfiguration which tends to get badly reported by the Google APIs.
Found the culprit:
masterInstanceName
seems to need a special format (maybe sth. like
project/<project-id>/<name>
? Pure speculation) Removing it resulted in a working DB 🤦‍♂️ Thanks @gentle-diamond-70147 for your time!
g
Oh, interesting. That's an unfortunate response from the Google API - not particularly helpful.