So this may be a dumb question but I'm struggling ...
# python
d
So this may be a dumb question but I'm struggling to understand how to feed the results of
aws.ec2.get_subnets()
into the arguments of
aws.ec2.get_subnet()
as the former returns an awaitable which is not accepted by the latter, am I missing anything? Sample (broken code):
Copy code
subnet_ids = await aws.ec2.get_subnets(
        filters=[
            aws.ec2.GetSubnetsFilterArgs(
                name="vpc-id",
                values=[vpc_id],
            )
        ]
    )
    subnet = aws.ec2.get_subnet(id=subnet_ids[0])
e
Either use
get_subnet_output
that allows promises and outputs as part of the input arguments, but the result will now be an Output. Or await the result of get_subnets before calling into get_subnet (it's just a standard asncio task https://docs.python.org/3/library/asyncio-task.html)