https://pulumi.com logo
Title
s

salmon-musician-36333

04/25/2023, 4:44 PM
Trying to get the availability zones out of my
awsx.ec2.Vpc
. Looking at https://www.pulumi.com/registry/packages/awsx/api-docs/ec2/vpc/, it seems that the usual "All input properties are implicitly available as output properties." applies, but
vpc.availabilityZoneNames
throws an error. Any ideas?
b

billowy-army-68599

04/25/2023, 4:45 PM
what do you need the az names for?
your best bet is to look up the created subnets and see which az they’re in
s

salmon-musician-36333

04/25/2023, 4:54 PM
This is for creating an
aws.rds.Cluster
, which wants
availabilityZones
. I've provisioned the VPC with
numberOfAvailabilityZones
. https://www.pulumi.com/registry/packages/aws/api-docs/rds/cluster/
b

billowy-army-68599

04/25/2023, 4:57 PM
RDS cluster shouldn’t need availablility zones, you need to create a subnet group then pass the subnet group
s

salmon-musician-36333

04/25/2023, 4:58 PM
Ok, thanks, I'll look into it.
s

salmon-account-74572

04/25/2023, 5:14 PM
Having just done some work with RDS clusters: AZs aren’t a required field, but if you want to distribute DB instances in multiple AZs you do have to supply a list of AZs by name (independent of/separate from the DB subnet group). I did exactly what @billowy-army-68599 suggested and looked up the created subnets to derive the AZ information from there. I haven’t yet found a better solution.
s

salmon-musician-36333

04/25/2023, 5:19 PM
Right, ok that matches what I was thinking. Thanks for the heads up! I think if I just create a
SubnetGroup
from the VPC
privateSubnetIds
I'm going to get access but not multi-AZ RDS.
s

salmon-account-74572

04/25/2023, 5:20 PM
Yes, I believe that’s right.
s

salmon-musician-36333

04/25/2023, 5:25 PM
In fairness, they go together since I also need to be able to access the
rds.Cluster
from the
eks.Cluster
😉
s

salmon-account-74572

04/25/2023, 6:43 PM
Quite true! (And exactly like my use case, which was an EKS cluster accessing an RDS cluster.)