Hey all, is there a way to write/store a secret pr...
# general
c
Hey all, is there a way to write/store a secret programatically during the execution of a program? I want to generate a secret (in this case I want to store a base64 encoded private key), but I don’t see anything on the context/config interfaces. I’m guessing it has to do with execution lifecycle and how that would resolve the dependency order or operations, and was wondering if anyone has any suggestions.
f
Will that work https://www.pulumi.com/registry/packages/random/api-docs/randompassword/ ? Or you need something different? Do you want to generate the secret with Pulumi and store it?
c
That will not work. As I said, I’m generating a private key that I want to then save / use later.
Preferably with the Pulumi config system since it has built in encryption, but if not I can look to use some other external store.
f
This then? https://www.pulumi.com/docs/intro/concepts/secrets/#secrets
Copy code
pulumi config set --secret dbPassword S3cr37
c
Programatically during the execution of a pulumi program.
Copy code
By reading a secret from configuration using Config.get_secret or Config.require_secret.
I want a
Config.set_secret
in Golang
f
I'm not sure if this concept is possible! You're running your Pulumi program based on the config so you can't really change it within the program. Unless you do that somewhat externally https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/auto#LocalWorkspace.SetConfig
c
iiiinteresting, I didn’t find this while searching earlier. Thanks, I’ll look into this