microscopic-afternoon-22702
09/12/2023, 3:52 PMlet foundVPC = false;
let vpcId = getVpcsOutput({ filters }).apply((list: GetVpcsResult) => {
if (list.ids.length > 0) {
foundJumpVPC = true;
return vpc;
} else {
<http://log.info|log.info>("No VPC found. Skipping...");
return undefined;
}
});
if(!foundJumpVPC) {
<http://log.info|log.info>("No VPC found. Skipping...");
return;
}
The reason I need to do this is because I can't do something like:
if(!vpcId)
because vpcId
is of type Output<string | undefined>
and this condition if(!vpcId)
will always evaluate to true.dry-keyboard-94795
09/12/2023, 4:15 PMapply
won't run until after the whole file has run.
There should be a getVpcs
that can be used for this though, provided filters
doesn't need to be an Outputmicroscopic-afternoon-22702
09/12/2023, 4:15 PMTheAh so not a good idea.won't run until after the whole file has run.apply
dry-keyboard-94795
09/12/2023, 4:41 PMmicroscopic-afternoon-22702
09/12/2023, 4:41 PMgetVpcs
completes.