sparse-intern-71089
01/07/2020, 1:28 AMgentle-diamond-70147
01/07/2020, 1:31 AM.apply
directly to a resource input - e.g. userData
on an aws.ec2.Instance
.flaky-father-99093
01/07/2020, 1:35 AMapply
that seems to ever show up in that stringflaky-father-99093
01/07/2020, 1:35 AMapply
, and then pass the resulting output (which will eventually resolve to what pulumi needs) to the userData?gentle-diamond-70147
01/07/2020, 1:56 AM.all(...).apply(...)
to combine multiple values into an interpolated string. Here's a contrived, but functional example:
const config = new pulumi.Config()
const mySecret = config.requireSecret("mySecret");
// create the string `vpc-abc123: asdf1234`
const userData = pulumi.all([vpc.id, mySecret]).apply(([vpcId, secret]) => `${vpcId}: ${secret}`);
gentle-diamond-70147
01/07/2020, 1:57 AM// create the string `password: asdf1234`
const userData = pulumi.interpolate`password: ${mySecret}`
flaky-father-99093
01/07/2020, 3:58 AMflaky-father-99093
01/07/2020, 4:07 AMstocky-spoon-28903
01/07/2020, 5:57 PM