rudderlabs / terraform-aws-eks

Terraform code and scripts for creating a new AWS EKS cluster in a new VPC
MIT License
2 stars 4 forks source link

Error creating EKS cluster: "Subnets specified must be in at least two different AZs" #2

Open kevinavery opened 4 years ago

kevinavery commented 4 years ago

Hi, I'm getting the following error when I run terraform apply:

...
module.eks.aws_eks_cluster.this[0]: Creating...
module.vpc.aws_route.public_internet_gateway[0]: Creation complete after 1s [id=r-rtb-042a10a1739725ed81080289494]
module.eks.aws_security_group_rule.cluster_egress_internet[0]: Creation complete after 2s [id=sgrule-2533592964]
module.vpc.aws_nat_gateway.this[0]: Still creating... [10s elapsed]
module.vpc.aws_nat_gateway.this[0]: Still creating... [20s elapsed]
module.vpc.aws_nat_gateway.this[0]: Still creating... [30s elapsed]
module.vpc.aws_nat_gateway.this[0]: Still creating... [40s elapsed]
module.vpc.aws_nat_gateway.this[0]: Still creating... [50s elapsed]
module.vpc.aws_nat_gateway.this[0]: Still creating... [1m0s elapsed]
module.vpc.aws_nat_gateway.this[0]: Still creating... [1m10s elapsed]
module.vpc.aws_nat_gateway.this[0]: Still creating... [1m20s elapsed]
module.vpc.aws_nat_gateway.this[0]: Still creating... [1m30s elapsed]
module.vpc.aws_nat_gateway.this[0]: Still creating... [1m40s elapsed]
module.vpc.aws_nat_gateway.this[0]: Still creating... [1m50s elapsed]
module.vpc.aws_nat_gateway.this[0]: Creation complete after 1m52s [id=nat-000de1c223f41705a]
module.vpc.aws_route.private_nat_gateway[0]: Creating...
module.vpc.aws_route.private_nat_gateway[0]: Creation complete after 2s [id=r-rtb-0ea83ee2af36697aa1080289494]

Error: error creating EKS Cluster (rudder-cluster): InvalidParameterException: Subnets specified must be in at least two different AZs
{
  RespMetadata: {
    StatusCode: 400,
    RequestID: "8bd93564-c25e-4f7b-a647-82a2f7a1150c"
  },
  ClusterName: "rudder-cluster",
  Message_: "Subnets specified must be in at least two different AZs"
}

Not being familiar with Terraform, I was able to work around it by modifying variables.tf to set rudder_num_availability_zones to 2, though this creates two nodes and I really only want one for now.

tbernacchi commented 3 years ago

Hi @kevinavery which variables.tf file did you input this variable? I'm getting Error: Unsupported argument

kevinavery commented 3 years ago

@tbernacchi See here https://github.com/rudderlabs/terraform-aws-eks/blob/master/variables.tf#L87