Setup 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
Deploying and running the program#
-
Create a new stack:
Terminal window pulumi stack init dev -
Set the AWS region:
$ pulumi config set aws:region us-east-1 -
Run
pulumi upto preview and deploy changes:$ pulumi upPreviewing update (dev)...Updating (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
Clean up#
-
Run
pulumi destroyto tear down all resources. -
To delete the stack itself, run
pulumi stack rm. Note that this command deletes all deployment history from the Pulumi console.
Related
Tutorial
ChatGPT clone with Pulumi ESC managed secrets
Blog PostOct 2023