bitter-psychiatrist-55958
04/03/2022, 6:18 PMaws.ec2.NetworkInterface
. The VPC is defined as:
const vpc = new awsx.ec2.Vpc("culex-vpc", {
cidrBlock: "10.50.0.0/16",
numberOfAvailabilityZones: 1, // defaults to 2, but for a lab 1 is good enuf
subnets: [
{ type: "public", location: "10.50.20.0/24", tags },
{ type: "private", location: "10.50.30.0/24", tags }
],
tags
});
How would I get the private subnet to use in the subnetId
property in aws.ec2.NetworkInterface
?
I tried using subnetId: vpc.id.apply(async () => vpc.privateSubnetsIds),
as seen above here, but have issues with it being the wrong type for subnetId
.echoing-dinner-19531
04/03/2022, 7:27 PMprivateSubnets()
method? https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/awsx/ec2/#Vpc-privateSubnetsbitter-psychiatrist-55958
04/03/2022, 7:35 PMSubnet ID to create the ENI in.
Type 'Promise<Subnet[]>' is not assignable to type 'Input<string>'.
Type 'Promise<Subnet[]>' is not assignable to type 'Promise<string>'.
Type 'Subnet[]' is not assignable to type 'string'.ts(2322)
networkInterface.d.ts(339, 5): The expected type comes from property 'subnetId' which is declared here on type 'NetworkInterfaceArgs'
echoing-dinner-19531
04/03/2022, 7:36 PMoutput(vpc.privateSubnets()).apply(subnets => subnet[0].id)
?bitter-psychiatrist-55958
04/03/2022, 7:40 PMsubnetId: output(vpc.getSubnets("private").then(subnet => subnet[0].id)),
gets the type error to go away 😄 lets see if it actually works!