How do I get subnet ids of a vpc? `const vpcConne...
# general
f
How do I get subnet ids of a vpc?
const vpcConnector = new awsc.apprunner.VpcConnector("vpc-connector", {
securityGroups: [ec2SecurityGroup.id],
subnets: [pulumi.output(vpc.getSubnetsIds)], // ERROR HERE
});
It shows
1. Type 'Output<(type: VpcSubnetType) => Promise<Output<string>[]>>[]' is not assignable to type 'Input<Input<string>[]>'.
s
1. you shouldn't need to call
pulumi.output()
2. if you created the
vpc
yourself (recommended), then you will need to create the subnet(s) as well. Then using
mySubnet.id
will work. Have you had a look at the example repository? https://github.com/pulumi/examples
f
I did create a VPC with
awsx
which includes private and public subnets already I believe. I think I will just have to get those subnet IDs if I'm not wrong, I just don't know how.
a
At least in the newer (beta) versions of awsx, you can access subnets directly on your Vpc object, using
vpc.publicSubnetIds
and
vpc.privateSubnetIds