Get started with Pulumi and Google Cloud
Configure access to Google Cloud
Pulumi’s CLI needs access to your Google Cloud account to manage cloud resources.
If you’ve already installed and initialized the gcloud CLI, Pulumi will respect and use your configuration settings.
You must use a Google Cloud account that has rights to deploy and manage resources, such as Cloud Storage buckets.
Testing access
To test that your Google Cloud access is configured properly, run:
$ gcloud config list
> gcloud config list
If your active account and project are printed, your configuration is correct. If not, read on:
[core]
account = user@example.com
disable_usage_reporting = True
project = my-gcp-project
Your active configuration is: [default]
You can also verify your authentication status:
$ gcloud auth list
> gcloud auth list
Alternative approaches
If you don’t have the gcloud CLI installed, or you plan on using Pulumi in a CI/CD pipeline, you can create a service account and download a JSON key file. Then set the GOOGLE_CREDENTIALS environment variable on your workstation:
$ export GOOGLE_CREDENTIALS="$(cat ~/path/to/service-account-key.json)"
> $env:GOOGLE_CREDENTIALS = (Get-Content -Path "C:\path\to\service-account-key.json" -Raw)
Alternatively, you can set the path to the key file:
$ export GOOGLE_APPLICATION_CREDENTIALS="$HOME/path/to/service-account-key.json"
> $env:GOOGLE_APPLICATION_CREDENTIALS = "C:\path\to\service-account-key.json"
You may need to set your Google Cloud project explicitly:
$ export GOOGLE_PROJECT="<YOUR_PROJECT_ID>"
> $env:GOOGLE_PROJECT = "<YOUR_PROJECT_ID>"
For detailed information on Pulumi’s use of Google Cloud credentials, see Google Cloud Setup.
Thank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.
