This message was deleted.
# general
s
This message was deleted.
b
Hi Alex, Maybe not the only solution, but I can give you the code we used to do that (python code, but you should be able to reproduce in any other language)
Copy code
aws.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)
e
Hi Joffrey, Thanks for the snippet. I also found out in the meantime, that I can distinguish between public or private subnets by filtering in get_subnets on
map-public-ip-on-launch
so this solves my problem.