This message was deleted.
# general
s
This message was deleted.
w
Yes - that example unfortunately looks incorrrect. Here's something that works for me and does the same thing:
Copy code
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

async function getAllSubnets(): Promise<aws.ec2.GetSubnetResult[]> {
    const subnetIds = await aws.ec2.getSubnetIds({
        vpcId: "vpc-c93b06ae",
    });

    const results: aws.ec2.GetSubnetResult[] = [];
    for (const subnetId of subnetIds.ids) {
        const subnet = await aws.ec2.getSubnet({
            id: subnetId,
        });
        results.push(subnet);
    }

    return results;
}

export const allSubnets = getAllSubnets();
d
This works, thanks!