2022-10-14 10:42:32 -07:00
{{ $type := default "gcp" (.Get "type") }}
2022-06-01 10:58:20 -07:00
When developing locally, we recommend that you install the [Google Cloud SDK](https://cloud.google.com/sdk/install) and then [authorize access with a user
2022-08-19 16:08:13 -07:00
account](https://cloud.google.com/sdk/docs/authorizing#authorizing_with_a_user_account). Next, Pulumi requires default application credentials to interact with your Google Cloud
resources, so run `auth application-default login` command to obtain those credentials:
2022-08-18 17:50:50 -05:00
< div class = "highlight" >
2022-08-19 16:08:13 -07:00
< pre class = "chroma" > < code class = "language-bash" data-lang = "bash" > < span class = "no-select" > $ < / span > gcloud auth application-default login< / code > < / pre >
2022-08-18 17:50:50 -05:00
< / div >
2022-08-19 16:08:13 -07:00
To configure Pulumi to interact with your Google Cloud project, set it with the `pulumi config` command using the project's ID:
2022-08-18 17:50:50 -05:00
< div class = "highlight" >
2022-10-14 10:42:32 -07:00
< pre class = "chroma" > < code class = "language-bash" data-lang = "bash" > < span class = "no-select" > $ < / span > pulumi config set {{ $type }}:project your-gcp-project-id< / code > < / pre >
2022-08-19 16:08:13 -07:00
< / div >
2023-05-15 15:25:28 -07:00
You may also set your Google Cloud Project via environment variable (listed in order of precedence):
2022-08-19 16:08:13 -07:00
< ul >
< li > < code class = "language-bash" data-lang = "bash" > GOOGLE_PROJECT< / code > < / li >
< li > < code class = "language-bash" data-lang = "bash" > GOOGLE_CLOUD_PROJECT< / code > < / li >
< li > < code class = "language-bash" data-lang = "bash" > GCLOUD_PROJECT< / code > < / li >
< li > < code class = "language-bash" data-lang = "bash" > CLOUDSDK_CORE_PROJECT< / code > < / li >
< / ul >
< div class = "highlight" >
< pre class = "chroma" > < code class = "language-bash" data-lang = "bash" > < span class = "no-select" > $ < / span > export GOOGLE_PROJECT=your-gcp-project-id< / code > < / pre >
2022-08-18 17:50:50 -05:00
< / div >