square-hair-965
09/21/2022, 4:06 PMpulumi.all().apply()
and you can probably see the problem I run into.
Now I could just output groups as individual constants and be done with it, which I'll likely do as I only have 4-5 autoscale groups per region, but I was wondering if anyone's ever encountered this scenario and figured out a certain code pattern to make it work?
As of right now my go-to solution is to output "none" strings when trying to output arns and ids of optional infrastructure.pulumi.all({group1, group2})
and then doing dot notation .apply([...groups])
would work and not break pulumi plan tracking?little-cartoon-10569
09/21/2022, 8:12 PMall()
or apply()
.apply()
, then the answer depends on what's happening in the apply()
. If it's a simple <http://pulumi.info|pulumi.info>.log()
or similar, then you can use the ... notation still. If you're creating more resources, then plan tracking will break, and you'll need to find another way to solve the problem.square-hair-965
09/21/2022, 8:14 PMlittle-cartoon-10569
09/21/2022, 8:16 PMsquare-hair-965
09/21/2022, 8:17 PMlittle-cartoon-10569
09/21/2022, 8:20 PMsquare-hair-965
09/21/2022, 8:21 PMlittle-cartoon-10569
09/21/2022, 8:21 PMsquare-hair-965
09/21/2022, 8:22 PMlittle-cartoon-10569
09/21/2022, 8:23 PMsquare-hair-965
09/21/2022, 8:26 PMexport const metricAlarms = pulumi.all(_metricAlarms).apply(([...alarms]) => alarms.map((alarm) => {
return {
id: alarm.id,
arn: alarm.arn
}
}));
i get the stripped down export I want and can simply just add new MetricAlarms to the _metricAlarm array