Connect Google Cloud
Connect Google Cloud so an agent can use the gcloud CLI with credentials stored in Pulumi ESC. ESC supplies these credentials when the command runs.
Choose the service account
Use a service account with access to the projects and resources the agent needs. Grant only the actions required for its work. See Choose integration permissions to choose which permissions to grant.
Prepare an ESC environment
Use the Google Cloud login provider to get a temporary access token. Under environmentVariables, export its accessToken output as CLOUDSDK_AUTH_ACCESS_TOKEN. Set CLOUDSDK_CORE_PROJECT to the project ID the agent should use. The login provider’s example shows the complete gcloud configuration.
Grant the agent’s Pulumi Cloud role permission to open the environment, so ESC can supply the token to gcloud.
Connect the environment
With permission to manage organization integrations (org_integrations:update):
- Open your organization’s Agent settings > Integrations > CLI tools.
- Under Available, choose Google Cloud and select Connect.
- Enter a Name and select the ESC environment that supplies the credentials.
- In Notes (optional), describe when the agent should use this connection.
- Select Connect.
Give the connection a name that identifies its purpose, such as staging-google-cloud. Include the project ID and any region or zone restrictions in its notes.
Use the connection
Include the connection name, project ID, and target resources in the assignment.