When terraform apply command is ran the following error occurs:
Plan: 35 to add, 0 to change, 0 to destroy.
╷
│ Error: "name" length must be between 1-100 characters: ""
│
│ with module.eks.aws_eks_cluster.this[0],
│ on .terraform/modules/eks/main.tf line 28, in resource "aws_eks_cluster" "this":
│ 28: name = var.clustername
│
╵
╷
│ Error: "name" doesn't comply with restrictions ("^[0-9A-Za-z][0-9A-Za-z-]+$"): ""
│
│ with module.eks.aws_eks_cluster.this[0],
│ on .terraform/modules/eks/main.tf line 28, in resource "aws_eks_cluster" "this":
│ 28: name = var.cluster_name
│
╵
What did you expect to happen?
terraform apply should successfully complete after deployment of EKS cluster and the underpinning infrastructure such as VPC and NAT Gateway IGW etc...
How can we reproduce it?
Follow the Terraform instruction set
Anything else we need to know?
Missing the environment variable EKS_CLUSTER_NAME in the Cloud9 IDE shell.
Running the following command prior terraform apply should fix it:
export EKS_CLUSTER_NAME=eks-workshop
Installation method
Own AWS account
What happened?
When terraform apply command is ran the following error occurs: Plan: 35 to add, 0 to change, 0 to destroy. ╷ │ Error: "name" length must be between 1-100 characters: "" │ │ with module.eks.aws_eks_cluster.this[0], │ on .terraform/modules/eks/main.tf line 28, in resource "aws_eks_cluster" "this": │ 28: name = var.clustername │ ╵ ╷ │ Error: "name" doesn't comply with restrictions ("^[0-9A-Za-z][0-9A-Za-z-]+$"): "" │ │ with module.eks.aws_eks_cluster.this[0], │ on .terraform/modules/eks/main.tf line 28, in resource "aws_eks_cluster" "this": │ 28: name = var.cluster_name │ ╵
What did you expect to happen?
terraform apply should successfully complete after deployment of EKS cluster and the underpinning infrastructure such as VPC and NAT Gateway IGW etc...
How can we reproduce it?
Follow the Terraform instruction set
Anything else we need to know?
Missing the environment variable EKS_CLUSTER_NAME in the Cloud9 IDE shell. Running the following command prior terraform apply should fix it: export EKS_CLUSTER_NAME=eks-workshop
EKS version
1.27