AWS EKS: Error: Unsupported argument

Hi Team,

I am getting the below error while running the terraform plan for AWS EKS cluster setup. The same code is working fine for other team members and they are using the same Terraform version.

❯ terraform --version
Terraform v1.4.6
on darwin_amd64
Acquiring state lock. This may take a few moments...
Releasing state lock. This may take a few moments...
╷
│ Error: Unsupported argument
│
│   on main.tf line 65, in module "eks":
│   65:   cluster_name                    = local.name
│
│ An argument named "cluster_name" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 66, in module "eks":
│   66:   cluster_version                 = local.cluster_version
│
│ An argument named "cluster_version" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 67, in module "eks":
│   67:   cluster_endpoint_private_access = true
│
│ An argument named "cluster_endpoint_private_access" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 68, in module "eks":
│   68:   cluster_endpoint_public_access  = true
│
│ An argument named "cluster_endpoint_public_access" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 69, in module "eks":
│   69:   create_cloudwatch_log_group     = false
│
│ An argument named "create_cloudwatch_log_group" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 72, in module "eks":
│   72:   cluster_addons = {
│
│ An argument named "cluster_addons" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 82, in module "eks":
│   82:   cluster_encryption_config = [{
│
│ An argument named "cluster_encryption_config" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 87, in module "eks":
│   87:   vpc_id     = local.vpc_id
│
│ An argument named "vpc_id" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 88, in module "eks":
│   88:   subnet_ids = local.subnet_id
│
│ An argument named "subnet_ids" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 91, in module "eks":
│   91:   cluster_security_group_additional_rules = {
│
│ An argument named "cluster_security_group_additional_rules" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 103, in module "eks":
│  103:   node_security_group_additional_rules = {
│
│ An argument named "node_security_group_additional_rules" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 134, in module "eks":
│  134:   eks_managed_node_group_defaults = {
│
│ An argument named "eks_managed_node_group_defaults" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 139, in module "eks":
│  139:   eks_managed_node_groups = {
│
│ An argument named "eks_managed_node_groups" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 353, in module "eks":
│  353:   tags = local.tags
│
│ An argument named "tags" is not expected here.
╵

Thanks and Regards,
Ramesh

You’re instantiating a module with name “eks” but you didn’t mention which module it uses as a source (if it’s a private one, you’ll need to share the code of the module here, more specifically the part where you declare your input variables).