Environment Variables
By default, there are a set of environment variables set by the process automatically:
GITHUB_TOKEN: A GitHub access token, set automatically when the deployment’s source is a GitHub repository. When the source is connected through the Pulumi GitHub App, this is a short-lived app installation token scoped to your whole GitHub App installation, not just the source repository; when you configure the source with your own personal access token, that token is used instead. Not set if you provide your ownGITHUB_TOKENthrough custom environment variables. See GitHub token in deployments for scope and security details.PULUMI_ACCESS_TOKEN: A temporary token with read-write access only to the stack being deployed.PULUMI_DEPLOY_OIDC_CONFIG: OIDC configuration provided for the cloud integrationsPULUMI_CI_SYSTEM: “Pulumi Deployments”PULUMI_CI_BUILD_ID: Current deployment IDPULUMI_CI_BUILD_NUMBER: Current deployment versionPULUMI_CI_BUILD_URL: Current deployment URLPULUMI_CI_ORGANIZATION: Current account organizationPULUMI_CI_PROJECT: Current project namePULUMI_CI_STACK: Current stack namePULUMI_CI_OPERATION: Current Pulumi operation (update,preview,destroy,refresh,detect-drift, orremediate-drift)
These can be overridden or extended by configuring custom environment variables.
PULUMI_ENV
Environment variables can be persisted between pre-run commands and the final pulumi deployment by appending them to the file on the file system named PULUMI_ENV.
Example Usage:
export GOOGLE_OAUTH_ACCESS_TOKEN=$(gcloud auth print-access-token)
echo GOOGLE_OAUTH_ACCESS_TOKEN=$GOOGLE_OAUTH_ACCESS_TOKEN >> /PULUMI_ENV
Running env in a subsequent pre-run command will show the environment variable and it should be usable by scripts or your pulumi program.
If
/PULUMI_ENV does not work, and you are on self hosted, you can look for the following message in the logs to get the location: Loading PULUMI_ENV from.