Hello! I'm just trying to get subnets from an impo...
# general
e
Hello! I'm just trying to get subnets from an imported VPC, do I have to import the subnets themselves? This doesn't work:
Copy code
// Dox VPC, leave protected so this project can't destroy it
const vpc = new aws.ec2.Vpc("dox", {
    assignGeneratedIpv6CidrBlock: false,
    cidrBlock: "172.31.0.0/16",
    enableDnsSupport: true,
    instanceTenancy: "default",
    tags: {
        Name: "test-VPC",
    },
}, {
    protect: true,
});


export vpc.publicSubnetIds
1
l
aws.ec2 VPCs don't have subnets. That's awsx.ec2 VPCs. And you can't import those, they're ComponentResources, not regular ones.
You need to import all the resources individually.
👍 1
e
Thanks for that done