Skip to main content

Search the Dev Center

Search tutorials, templates, examples, and more.

Set up AWS Secrets Manager

A minimal AWS C# Pulumi program

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

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

Prerequisites#

  1. Install Pulumi
  2. Configure AWS credentials
  3. Install .NET

Deploying the example#

  1. Create a new stack:

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

    Terminal window
    pulumi config set aws:region us-east-1
  3. Deploy the stack:

    Terminal window
    pulumi up
    Previewing update (dev)
    ...
    Updating (dev)
    View Live: https://app.pulumi.com/acmecorp/aws-cs-secrets-manager/dev/updates/1
    Type Name Status
    + pulumi:pulumi:Stack aws-cs-secrets-manager-dev created
    + ├─ aws:secretsmanager:Secret secretContainer created
    + └─ aws:secretsmanager:SecretVersion secret created
    Outputs:
    SecretId: "arn:aws:secretsmanager:us-east-1:xxxxxxxx:secret:secretContainer-eec74e1-PYcuM8"
    Resources:
    + 3 created
    Duration: 10s

Cleaning up#

Once you’re finished experimenting, you can destroy your stack and remove it to avoid incurring any additional cost:

Terminal window
pulumi destroy
pulumi stack rm

Related

The infrastructure as code platform for any cloud.