Hi all, Can someone help me figure out what I migh...
# getting-started
m
Hi all, Can someone help me figure out what I might be doing wrong.
Copy code
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
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
Oh I see. Thanks
d
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
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).