sparse-intern-71089
02/03/2022, 8:40 PMlittle-cartoon-10569
02/03/2022, 9:54 PMredis.cacheNodes[0]
in your code (for example, you can't loop through it because the array is inside the Output), you can pass redis.cacheNodes[0]
as a parameter to another Pulumi constructor. In JS/TS, Pulumi has some clever way of promoting the [0]
to inside the output. It's magic.little-cartoon-10569
02/03/2022, 9:58 PMlittle-cartoon-10569
02/03/2022, 10:00 PMthis.RedisSetupOutput = {
redishost : redis.cacheNodes[0].apply(a=>a.address),
redis: redis
}
This is needed because the code isn't somewhere that Pulumi unwraps inputs for you. If you were passing the address to a Pulumi constructor, you could do this:
new aws.xyz.SomePulumiClass(name, {
address: redis.cacheNodes[0].address
});
In this context, Pulumi is able to sort it all out for you.witty-park-12681
02/03/2022, 10:18 PM