boundless-yacht-14192
03/01/2024, 5:57 AMpulumi.Output<awsx.ec2.Vpc>
to awsx.ec2.Vpc
.
I use stackRefeence
to bring a AWS Vpc object to another project like this:
const mainVpcOutput: pulumi.Output<awsx.ec2.Vpc> = stackRef.getOutput("mainVpc") as
pulumi.Output<awsx.ec2.Vpc>;
Then, I need to convert it to an awsx.ec2.Vpc
object because this is the type that I will pass as an argument to other resources. So, I do this to convert it:
let mainVpc: awsx.ec2.Vpc;
mainVpcOutput.apply(vpc => {
mainVpc = vpc;
});
But, when using the mainVpc variable, later on, it gives this error:
Variable 'mainVpc' is used before being assigned.ts
Any solution to properly convert the pulumi.Output to Vpc?salmon-account-74572
03/01/2024, 6:16 AMboundless-yacht-14192
03/01/2024, 6:22 AM