Skip to main content

Setup AWS Secrets manager

Demo showing how to set up AWS secrets manager

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-secrets-manager
cd pulumi-examples/aws-ts-secrets-manager

A simple program that creates an AWS secret and a version under AWS Secrets Manager

Deploying and running the program#

  1. Create a new stack:

    Terminal window
    pulumi stack init dev
  2. Set the AWS region:

    $ pulumi config set aws:region us-east-1
  3. Restore NPM modules via npm install or yarn install.

  4. Run pulumi up to preview and deploy changes:

    $ pulumi up
    Previewing update (dev)
    ...
    Updating (dev)
    View Live: https://app.pulumi.com/acmecorp/aws-secrets-manager/dev/updates/1
    Type Name Status
    + pulumi:pulumi:Stack aws-secrets-manager-dev created
    + ├─ aws:secretsmanager:Secret secretContainer created
    + └─ aws:secretsmanager:SecretVersion secret created
    Outputs:
    secretContainerId: "arn:aws:secretsmanager:us-east-1:xxxxxxxx:secret:secretContainer-369b7ea-Wrt9Ba"
    Resources:
    + 3 created
    Duration: 8s

Clean up#

  1. Run pulumi destroy to tear down all resources.

  2. To delete the stack itself, run pulumi stack rm. Note that this command deletes all deployment history from the Pulumi console.

Related

The infrastructure as code platform for any cloud.