GCP OIDC provider for Pulumi Cloud
Enables Pulumi Cloud to authenticate with an OIDC provider in Google Cloud
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set gcp-ts-oidc-provider-pulumi-cloudcd pulumi-examples/gcp-ts-oidc-provider-pulumi-cloudThis Pulumi program enables Pulumi Cloud to authenticate with an OIDC provider in a Google Cloud project, and creates a Pulumi ESC environment that allows both the gcloud CLI and the Pulumi Google Cloud provider to consume temporary (admin) credentials.
Last update: September 2025
Prerequisites#
- Install Pulumi
- Configure GCP credentials
- Install Node.js
- A Pulumi Cloud account
- A Google Cloud project
Deploying the example#
This Pulumi example is written as a template. It is meant to be copied via pulumi new.
-
Log in to your Pulumi Cloud account if you haven’t already:
Terminal window pulumi login -
Copy the template to a new directory (
--diris optional; it will use the current directory if omitted):Terminal window pulumi new https://github.com/pulumi/examples/gcp-ts-oidc-provider-pulumi-cloud --dir my-gcp-oidccd my-gcp-oidcOnce copied to your machine, feel free to edit as needed.
-
Install dependencies:
Terminal window npm install -
Deploy the stack. This template will pick up the thumbprint from the URL that you set in the stack configuration. By default it will use the OIDC IDP URL for Pulumi Cloud:
Terminal window pulumi upNote: due to propagation delays, the OIDC connection may take a few minutes before it is usable.
Cleaning up#
Once you’re finished experimenting, destroy your stack and remove it to avoid incurring any additional cost:
pulumi destroypulumi stack rmAdditional notes#
This project is generally useful as a baseline setup for using ESC with Google Cloud. You may want to refine the scope of the accounts permissions (e.g. from roles/admin to roles/writer or roles/reader), or you may want to import the generated ESC environment into a new ESC environment to enable scenarios like accessing Google Secret Manager secrets.