https://pulumi.com logo
#general
Title
# general
e

enough-animal-75031

11/22/2021, 1:33 AM
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

little-cartoon-10569

11/22/2021, 1:51 AM
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

enough-animal-75031

11/22/2021, 6:46 AM
Thanks for that done