billions-ghost-96421
08/01/2021, 7:01 PMnew _awsx.lb.ApplicationLoadBalancer_
, how do I reference an awsx_.ec2._Vpc
instance created in another stack?
stack <org>/infra/dev
const vpc = new awsx.ec2.Vpc("dev", {
cidrBlock: vpcCidr,
numberOfAvailabilityZones: 3,
subnets: [...],
});
export const vpcId = vpc.id
stack <org>/app/dev
const infraDevStack = new pulumi.StackReference("<org>/infra/dev");
// Create an ALB associated with the dev VPC
const alb = new awsx.lb.ApplicationLoadBalancer("admin", {
vpc: aws.ec2.getVpc({
id: infraDevStack.getOutput("vpcId") as string,
}),
});
Here, aws.ec2.getVpc
returns Promise<GetVpcResult
but I need a awsx.ec2.Vpc
.green-stone-37839
08/01/2021, 8:11 PMconst vpc = awsx.ec2.Vpc.fromExistingIds("myVpc", {
vpcId: "some-vpc-id"
});
new awsx.lb.ApplicationLoadBalancer("mylb", {
vpc: vpc
});
billions-ghost-96421
08/01/2021, 8:59 PM