this may just be a general JS question. any idea ...
# general
b
this may just be a general JS question. any idea how one would generate a random string as a k8s secret on creation, but avoid recreating it every time? (with pulumi)
b
@busy-umbrella-36067 We just today published our new
@pulumi/random
provider, which will generate a random string in a way that works well with the Pulumi model (i.e., only the first time the stack is created, not every time).
This file https://github.com/pulumi/pulumi-random/blob/master/examples/simple/index.ts shows some example usages of the various resources in there, but let's say you wanted to create a string containing 64 random characters. You could do so as follows:
Copy code
import * as random from "@pulumi/random";
export const randomChars =
    new random.RandomString(
        "randomChars", { length: 64 }).result;
b
@big-piano-35669 that's awesome! Thanks for the follow up