https://pulumi.com logo
Title
b

big-state-95297

02/09/2021, 7:49 PM
[RESOLVED] Hi there - I'm trying to create an EKS cluster, but getting the following error:
"Cannot create cluster 'eks-cluster-eksCluster-ffabc7f' because us-east-1e, the targeted availability zone, does not currently have sufficient capacity to support the cluster. Retry and choose from these availability zones: us-east-1a, us-east-1b, us-east-1c, us-east-1d, us-east-1f"
How can I configure Pulumi to use the AZs in which capacity is available? I don't want to create the cluster in another region for performance concerns.
b

billowy-army-68599

02/09/2021, 7:51 PM
can you share your code?
b

big-state-95297

02/09/2021, 7:53 PM
I'm using the new
pulumi-eks
Go package to create the cluster:
// Create EKS Cluster
		eksCluster, err := eks.NewCluster(ctx, "eks-cluster", &eks.ClusterArgs{
			InstanceType:    pulumi.String("t2.medium"),
			DesiredCapacity: <http://pulumi.Int|pulumi.Int>(2),
			MaxSize:         <http://pulumi.Int|pulumi.Int>(2),
			MinSize:         <http://pulumi.Int|pulumi.Int>(1),
		})
		if err != nil {
			return err
		}
eksctl
from AWS seems to provide a
--zone
flag for passing in the desired zones: https://aws.amazon.com/premiumsupport/knowledge-center/eks-cluster-creation-errors/. Hoping something similar is available for Pulumi.
b

billowy-army-68599

02/09/2021, 7:56 PM
are you using the default VPC?
if you're using the default VPC, the EKS module will put nodes in all of the availability zones the VPC has subnets in. You'll need to specify the subnets for each AZ using the
ClusterVPCConfig
https://www.pulumi.com/docs/reference/pkg/aws/eks/cluster/#clustervpcconfig
you can grab the subnet IDs like so
subnet, err := ec2.GetSubnetIds(ctx, &ec2.GetSubnetIdsArgs{VpcId: vpc.Id})
		if err != nil {
			return err
		}
You'll need to use a filter to filter by AZ https://www.pulumi.com/docs/reference/pkg/aws/ec2/getsubnetids/#getsubnetidsfilter
b

big-state-95297

02/09/2021, 8:38 PM
this seems to have done the job. Thanks, @billowy-army-68599!
b

billowy-army-68599

02/09/2021, 8:39 PM
👍