Skip to main content

Search the Dev Center

Search tutorials, templates, examples, and more.

AWS OIDC provider for Pulumi Cloud

AWS OIDC setup for Pulumi ESC

This example lives in the pulumi/examples repository. Check out just this directory to use it:

Get started with this example
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set aws-ts-oidc-provider-pulumi-cloud
cd pulumi-examples/aws-ts-oidc-provider-pulumi-cloud

A Pulumi program that configures AWS OIDC for use with Pulumi ESC. It:

  • Creates AWS resources for AWS OIDC (IdP + Role)
  • Creates a new Pulumi Cloud ESC Environment

Prerequisites#

  1. Install Pulumi
  2. Configure AWS credentials
  3. Install Node.js
  4. A Pulumi Cloud account

Deploying the example#

This example is also published as a template that you can copy with pulumi new:

Terminal window
pulumi login
pulumi new https://github.com/pulumi/examples/aws-ts-oidc-provider-pulumi-cloud --dir my-aws-oidc
cd my-aws-oidc

Once copied to your machine, feel free to edit as needed.

  1. Create a new stack, which is an isolated deployment target for this example:

    Terminal window
    pulumi stack init dev
  2. Set the AWS region and the ESC project and environment names to generate:

    Terminal window
    pulumi config set aws:region us-west-2
    pulumi config set escProject aws
    pulumi config set escEnvironmentName aws-oidc-admin
  3. Install dependencies:

    Terminal window
    npm install
  4. 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 up

Cleaning up#

To clean up your infrastructure, run:

Terminal window
pulumi destroy
pulumi stack rm

Related

The infrastructure as code platform for any cloud.