Generate secure random passwords to use in deployments
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 random-yamlcd pulumi-examples/random-yamlThe Random package provides resources with outputs that are random IDs, passwords, or other data.
Deploying and running the program#
-
Create a new stack:
Terminal window pulumi stack init dev -
Install required plugins:
Terminal window pulumi plugin install resource random 4.3.1 -
Run
pulumi upto preview and deploy changes. After the preview is shown you will be prompted if you want to continue or not.Terminal window pulumi upPreviewing update (dev)...Updating (dev)View Live: https://app.pulumi.com/.../random/dev/updates/1Type Name Status+ pulumi:pulumi:Stack random-dev created+ └─ random:index:RandomPassword randomPassword createdOutputs:password: "[secret]"Resources:+ 2 created -
To see the resources that were created, run
pulumi stack output:Terminal window pulumi stack output --show-secretsCurrent stack outputs (1):OUTPUT VALUEpassword ...