Configuring OpenID Connect for GitHub
This document outlines the steps required to configure Pulumi Cloud to accept GitHub id_tokens and exchange them for Pulumi access tokens. Three token types are supported — organization, team, and personal — subject to your Pulumi edition.
OidcIssuer resource in the Pulumi Service provider.Prerequisites
- You must be an admin of your Pulumi organization.
Register the OIDC Issuer
The registration steps are the same for all token types.
- Navigate to Settings → Access Management → OIDC Issuers and select Register issuer.
- Name the issuer and set the issuer URL to
https://token.actions.githubusercontent.com. - Submit the form.
Organization tokens
Organization tokens grant access on behalf of the entire Pulumi organization. They are appropriate for CI/CD pipelines that need broad access across stacks in the organization.
Authorization policy
Select the issuer name.
Set Decision to Allow.
Set Token type to Organization.
Add a policy and configure the audience and subject claims for your organization and repositories:
- Aud:
urn:pulumi:org:<org-name> - Sub:
repo:<organization>/<repo>:*
For more information about GitHub token claims, see the official GitHub documentation.
- Aud:
Select Save policies.
GitHub Actions step
- uses: pulumi/auth-actions@v2
with:
organization: org-name
requested-token-type: urn:pulumi:token-type:access_token:organization
Replace org-name with your Pulumi organization name. For more information, see the Pulumi Auth Action documentation.
Sample workflow
name: Pulumi preview
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
run_cron_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pulumi/auth-actions@v2
with:
organization: org-name
requested-token-type: urn:pulumi:token-type:access_token:organization
- uses: pulumi/actions@v6
with:
command: preview
stack-name: org-name/stack-name
Team tokens
Team tokens are scoped to a specific team within your Pulumi organization. They are useful when you want to limit CI/CD access to only the stacks a particular team is authorized to manage. Team tokens require the Enterprise or Business Critical edition.
Authorization policy
Select the issuer name.
Set Decision to Allow.
Set Token type to Team and set Scope to
team:<team-slug>, where<team-slug>is the slug of the team within your Pulumi organization.Add a policy and configure the audience and subject claims:
- Aud:
urn:pulumi:org:<org-name> - Sub:
repo:<organization>/<repo>:*
- Aud:
Select Save policies.
GitHub Actions step
- uses: pulumi/auth-actions@v2
with:
organization: org-name
requested-token-type: urn:pulumi:token-type:access_token:team
scope: team:<team-slug>
Replace org-name with your Pulumi organization name and <team-slug> with the team’s slug.
Sample workflow
name: Pulumi preview
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
run_cron_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pulumi/auth-actions@v2
with:
organization: org-name
requested-token-type: urn:pulumi:token-type:access_token:team
scope: team:<team-slug>
- uses: pulumi/actions@v6
with:
command: preview
stack-name: org-name/stack-name
Personal tokens
Personal tokens are issued on behalf of a specific Pulumi user and carry that user’s permissions. For most automated workflows, organization or team tokens are preferred because they run with organizational identity and do not depend on an individual account. Personal tokens are available on all Pulumi editions and are appropriate when you want a workflow to operate with exactly the access that a particular user has been granted.
Authorization policy
Select the issuer name.
Set Decision to Allow.
Set Token type to Personal and set Scope to
user:<pulumi-username>, where<pulumi-username>is the Pulumi username of the user the token should represent.Add a policy and configure the audience and subject claims:
- Aud:
urn:pulumi:org:<org-name> - Sub:
repo:<organization>/<repo>:*
- Aud:
Select Save policies.
GitHub Actions step
- uses: pulumi/auth-actions@v2
with:
organization: org-name
requested-token-type: urn:pulumi:token-type:access_token:personal
scope: user:<pulumi-username>
Replace org-name with your Pulumi organization name and <pulumi-username> with the Pulumi username.
Sample workflow
name: Pulumi preview
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
run_cron_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pulumi/auth-actions@v2
with:
organization: org-name
requested-token-type: urn:pulumi:token-type:access_token:personal
scope: user:<pulumi-username>
- uses: pulumi/actions@v6
with:
command: preview
stack-name: org-name/stack-name
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.