sparse-intern-71089
06/11/2020, 10:12 PMlittle-cartoon-10569
06/11/2020, 10:22 PMaws.getAutoscalingGroups
returns a Promise, you don't need to wrap that in an output. Just use .then()
on it.thankful-laptop-55220
06/11/2020, 10:24 PMthankful-laptop-55220
06/11/2020, 10:32 PMUpdating (dev):
Type Name Status
pulumi:pulumi:Stack gcso-k8-dev
+ ββ aws:ec2:LaunchTemplate bar1-b806b39 created
+ ββ aws:ec2:LaunchTemplate bar2-cd01f02 created
thankful-laptop-55220
06/11/2020, 10:32 PMthankful-laptop-55220
06/11/2020, 10:33 PMpulumi.output()
actually handled promises.gorgeous-egg-16927
06/11/2020, 11:08 PMpulumi.output
does handle promises, but you have to resolve it with an apply
(like .then()
for Outputs)gorgeous-egg-16927
06/11/2020, 11:09 PMasgs.apply(v => {...})
gorgeous-egg-16927
06/11/2020, 11:10 PMlittle-cartoon-10569
06/11/2020, 11:11 PMpulumi.all
refer to the results, alongside lots of other outputs...gorgeous-egg-16927
06/11/2020, 11:18 PMall
, so itβs not necessary in this case.
For example:
const foo = new Promise(resolve => resolve("foo"))
export const fooValue = pulumi.all([foo]).apply(([v]) => v)
results in
Outputs:
fooValue: "foo"
little-cartoon-10569
06/11/2020, 11:20 PMthankful-laptop-55220
06/12/2020, 2:26 PMpulumi.output
& .apply()
. I may experiment with this more. Thank you.
Seems to accomplish my stated example, I would probably need to stack the behavior as so:
1. preview and bulid ASGs in a way that I need a promise.
2. resolve the promise to query AWS for the ASGs. i know that shouldn't be necessary but this is for testing behavior for a much larger project.
3. resolve the promise from #2 to begin building resources as a consequence of the returned ASG list.