victorious-fountain-7689
10/21/2021, 5:23 AMawsx.ec2.Vpc
object using awsx.ec2.Vpc.fromExistingIds
?
Eventhough I passed in vpcId
, publicSubnetIds
and privateSubnetIds
, the output of .getSubnets("public")
seems to be an empty list.billowy-army-68599
10/21/2021, 5:29 AMawsx.ec2.Vpc.fromExistingIds
and you passed in the subnet ids, and now you want to grab the subnets from the const vpc = awsx.ec2.Vpc.fromExistingIds
right?
is there a reason you wouldn't just get the subnets from the publicSubnetIds
you already passed in?victorious-fountain-7689
10/21/2021, 5:35 AMawsx.ec2.Subnet
has a routeTable
attribute, it was an easy task. I was wondering if I could do the same with the awsx.ec2.Vpc
object created using awsx.ec2.Vpc.fromExistingIds
billowy-army-68599
10/21/2021, 5:38 AMfromExistingIds
no, because that particular method only populates the vpc itself, not the res of the resources inside the component (I think)victorious-fountain-7689
10/21/2021, 5:39 AMawsx.ec2.Vpc
, I found some populating code.
Not sure when it gets calledminiature-advantage-31279
10/23/2021, 5:27 AMconst publicSubnets = await aws.ec2.getSubnetIds({
vpcId: vpcId,
filters: [{ name: 'tag:type', values: ['public'] }],
});
const privateSubnets = await aws.ec2.getSubnetIds({
vpcId: vpcId,
filters: [{ name: 'tag:type', values: ['private'] }],
});
awsx.ec2.Vpc.fromExistingIds(name, {
vpcId: vpcId,
publicSubnetIds: publicSubnetIds,
privateSubnetIds: privateSubnetIds,
});
billowy-army-68599
10/23/2021, 12:41 PMvictorious-fountain-7689
11/01/2021, 2:10 PMpublicSubnetIds
and privateSubnetIds
from other stack and using awsx.ec2.Vpc.fromExistingIds
.
Unfortunately, that seemed not populating routeTables
properties of awsx.ec2.Subnet
instances.
Ultimately, I ended up exporting routeTableIds
itself from another stack 😅miniature-advantage-31279
11/01/2021, 3:19 PMvictorious-fountain-7689
11/02/2021, 4:08 AM