gray-hamburger-90102
05/21/2021, 9:27 AMconst vpc = new awsx.ec2.Vpc("BaseNetworkVPC", {
cidrBlock: "10.50.0.0/22",
subnets: [
{ type: "public" },
{ type: "private" },
],
});
// this is probably wrong, but not sure how to proceed!
const vpcPrivateSubnets = pulumi.output(vpc.privateSubnets).apply(psns => psns.map(psns => psns.routeTable?.id));
// I want to make a routeTable propagation for each of my VPC's private subnets
const routeTablePropagation2 = new aws.ec2.VpnGatewayRoutePropagation("VPGPropagateMainRouteTable", {
vpnGatewayId: gatewayAssociation.associatedGatewayId,
routeTableId: // what goes here?
});
});
brave-planet-10645
05/21/2021, 9:34 AMgetX
function. For route tables, we've got getRouteTables()
: https://www.pulumi.com/docs/reference/pkg/aws/ec2/getroutetables/#getroutetablesfilter
You can pass in the vpc id into the filter arguments and that should return the route tables for that VPCgray-hamburger-90102
05/21/2021, 9:57 AMconst privateRouteTables = aws.ec2.getRouteTables({
vpcId: vpc.id,
filters: [
{
name: 'association.subnet-id',
values: pulumi.output(vpc.privateSubnetIds).apply(snids => snids)
}
]
});
// line 2
Type 'Output<string>' is not assignable to type 'string | undefined'.
Type 'Output<string>' is not assignable to type 'string'.
brave-planet-10645
05/21/2021, 10:14 AMapply
here: https://www.pulumi.com/docs/intro/concepts/inputs-outputs/#applygray-hamburger-90102
05/21/2021, 10:16 AMvpcId: vpc.id.apply(id => id),
with the exact same error as aboveOutput<T>
to T
?little-cartoon-10569
05/23/2021, 9:22 PM