Hey Pulumi people, an issue in
converting pulumi.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?