Set up AWS Secrets Manager
A minimal AWS Python Pulumi program
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set aws-py-secrets-managercd pulumi-examples/aws-py-secrets-managerA simple program that creates an AWS secret and a version under AWS Secrets Manager.
Prerequisites#
Deploying the example#
-
Create a new stack:
Terminal window pulumi stack init dev -
Set the AWS region to deploy into:
Terminal window pulumi config set aws:region us-east-1 -
Install dependencies:
Terminal window python3 -m venv venvsource venv/bin/activatepip install -r requirements.txt -
Run
pulumi upto preview and deploy changes:Terminal window pulumi upUpdating (dev)View Live: https://app.pulumi.com/acmecorp/aws-py-secrets-manager/dev/updates/1Type Name Status+ pulumi:pulumi:Stack aws-py-secrets-manager-dev created+ ├─ aws:secretsmanager:Secret secret_container created+ └─ aws:secretsmanager:SecretVersion secret_version createdOutputs:secret_id: "arn:aws:secretsmanager:us-east-1:xxxxxxxx:secret:secret_container-d07f0c4-N3OSrw"Resources: + 3 createdDuration: 6s
Cleaning up#
Once you’re finished experimenting, destroy your stack and remove it to avoid incurring any additional cost:
pulumi destroypulumi stack rmRelated
Tutorial
ChatGPT clone with Pulumi ESC managed secrets
Blog PostOct 2023