Skip to content

Instantly share code, notes, and snippets.

@stack72
Created April 8, 2020 11:10
Show Gist options
  • Save stack72/be4aded27dde63e5014d0278b3769319 to your computer and use it in GitHub Desktop.
Save stack72/be4aded27dde63e5014d0278b3769319 to your computer and use it in GitHub Desktop.
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
const username = new random.RandomString("my-string", {
length: 16,
special: true,
}, {
// RandomString has an output of 'result' where the string actually is stored
additionalSecretOutputs: ["result"]
});
export const secret = username.result;
▶ pulumi up --yes --skip-preview
Updating (dev):
Type Name Status
+ pulumi:pulumi:Stack secrets-dev created
+ └─ random:index:RandomString my-string created
Outputs:
secret: "[secret]"
Resources:
+ 2 created
Duration: 8s
Permalink: https://app.pulumi.com/stack72/secrets/dev/updates/1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment