enough-table-42729
09/29/2022, 7:18 AMVpc.fromExistingIds
by passing the existing vpc id, but it doesn't seem to populate the publicSubnetIds
and publicSubnetIds
fields of the resulting object. aws.ec2.getVpc
or aws.ec2.getSubnets
don't distinguish between public and private subnets. Am I missing something obvious? Is there some other way to do it?
The existing VPC and subnets should not be managed by the stack that is creating the clusters.
Thanks.brainy-beach-36627
09/29/2022, 9:01 AMaws.ec2.get_subnets(
filters=[
aws.ec2.GetSubnetsFilterArgs(name="vpc-id", values=[vpc.id]),
aws.ec2.GetSubnetsFilterArgs(
name="availability-zone", values=availability_zones
),
aws.ec2.GetSubnetsFilterArgs(name=f"tag:{tag_key}", values=[tag_value]),
],
opts=pulumi.InvokeOptions(provider=provider),
)
With the get_subnets function, you can retrieve subnets thanks to different filters (such as vpc-id, az, and tags in my case)enough-table-42729
09/29/2022, 11:50 AMmap-public-ip-on-launch
so this solves my problem.