https://pulumi.com logo
Title
m

magnificent-sandwich-15839

02/03/2022, 2:06 PM
Hi all, Can someone help me figure out what I might be doing wrong.
pulumi.all([
                config.requireSecret("secretKey"),
                config.requireSecret("dbPassword"),
            ])
            .apply(([secretKey, dbPassword]) =>
                createStack({
                    secretKey: `${secretKey}`,
                    dbPassword: `${dbPassword}`,
                })
            );
I still get secretKey as
'[secret]'
I’ve kind of never been able to get string out of Output<string>
m

many-yak-61188

02/03/2022, 2:14 PM
I've always used the output<string> directly and let pulumi handle providing the value. there is documentation page on inputs / output and lifting. I don't think you need to do what you are doing, we pass in the output to calls as needed and that is replaced by the value;
m

magnificent-sandwich-15839

02/03/2022, 2:16 PM
Oh I see. Thanks
d

damp-byte-39631

02/03/2022, 2:29 PM
Side note, any time you want to use an output inside of a template string, you'll need to use `pulumi.interpolate`output``
👍 1
l

little-cartoon-10569

02/03/2022, 7:59 PM
Not need. You can also use
apply()
. interpolate is sugar around apply. In order to get a string "out" of an Output<string>, you need to put your "out" code inside the interpolate or apply. That is, you cannot get at the string at the same level of code where you have the Output. You must be inside a code black or string interpolation inside the apply (or interpolate).