This message was deleted.
# typescript
s
This message was deleted.
g
This should work for you:
Copy code
const server = new aws.ec2.Instance("web-server", {
    // ...
    subnetId: vpc.privateSubnetsIds[0], // reference the subnet created by awsx
});
f
Will index 0 always be
us-east-1a
?
g
I believe it will always be the first available zone found, but different accounts have different zones.
Not all accounts have an a to be more specific.
f
my issue here is that I have an EBS volume in AZ
us-east-1a
that I need to attach to the instance. that's why I used a filter on the subnet collection.
I tried to simplify my example, but what I actually have is:
Copy code
subnets => subnets.filter(x => x.subnet.availabilityZone == ebs.availabilityZone)
OK, I worked around this by selecting
vpc.privateSubnets[0].subnet.availabilityZone
when configuring the EBS volume AZ
👍 1