https://pulumi.com logo
#general
Title
# general
p

powerful-ram-56107

09/18/2019, 1:18 PM
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

gentle-diamond-70147

09/18/2019, 1:58 PM
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

powerful-ram-56107

09/18/2019, 2:00 PM
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

gentle-diamond-70147

09/18/2019, 2:01 PM
Are you able to manually create a database in the console?
p

powerful-ram-56107

09/18/2019, 2:06 PM
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

gentle-diamond-70147

09/18/2019, 2:19 PM
Oh, interesting. That's an unfortunate response from the Google API - not particularly helpful.
2 Views