What's the proper way to set a value such as a sen...
# getting-started
c
What's the proper way to set a value such as a sensitive database connection string as an exported value, yet it's a secret, so that it could be imported as a stack reference for another stack that needs to setup configs to this database. I'm using Go fyi.
b
if you mark it as a secret, it stays a secret through the flow. It'll be exported as
[secret]
and you'll need the encryption key to decrypt it
if you're using the pulumi service this is transparent, if you're using OSS backends it's...hard
l
This is the page with the docs: https://www.pulumi.com/docs/intro/concepts/secrets/ The typescript code would be
export dbString = Output.secret(db.getPassword());
Looks like the golang equivalent is Output.ToSecret()? https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi#ToSecret
c
Thanks I tried that but I need to check again. ToSecret didn't seem to match the current lifecycle, as export requires an input and such. I'll have at it again.
l
Requires an input? It only requires an output in TS...