Thread
#getting-started
    c

    chilly-plastic-75584

    5 months ago
    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

    billowy-army-68599

    5 months ago
    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

    little-cartoon-10569

    5 months ago
    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

    chilly-plastic-75584

    5 months ago
    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

    little-cartoon-10569

    5 months ago
    Requires an input? It only requires an output in TS...