# Failure of EKS module when terraform apply

**URL:** <https://discuss.hashicorp.com/t/failure-of-eks-module-when-terraform-apply/60547>\
**Category:** Terraform\
**Created:** [December 3, 2023, 10:10am UTC](https://discuss.hashicorp.com/t/failure-of-eks-module-when-terraform-apply/60547 "2023-12-03T10:10:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sk8228402](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/sk8228402/32/25064_2.png) [@sk8228402](https://discuss.hashicorp.com/u/sk8228402)\
**Post date:** [December 3, 2023, 10:10am UTC](https://discuss.hashicorp.com/t/failure-of-eks-module-when-terraform-apply/60547/1 "2023-12-03T10:10:39Z")

</div>

I could run terraform init successfully.  
but when I apply terraform apply it is failing, I have AWS account. I am not sure what exactly to be provided.

terraform code:

```auto
locals {
  name = "ex-${replace(basename(path.cwd), "_", "-")}"
}

module "eks" {
  source = "terraform-aws-modules/eks/aws"
  version = ">= 18.0.0"

  cluster_name = local.name
  cluster_version = "1.21"

  vpc_id = module.vpc.vpc_id
  subnet_ids = module.vpc.private_subnets

  self_managed_node_groups = {
    boo = {
      instance_type = "t3.medium"
      instance_market_options = {
        market_type = "spot"
      }
    }
  }

  eks_managed_node_groups = {
    foo = {}
  }

  fargate_profiles = {
    bar = {
      selectors = [
        {
          namespace = "bar"
        }
      ]
    }
  }
}

module "eks_auth" {
  source = "../../"
  eks = module.eks

  map_roles = [
    {
      rolearn = "arn:aws:iam::66666666666:role/role1"
      username = "role1"
      groups = ["system:masters"]
    },
  ]

  map_users = [
    {
      userarn = "arn:aws:iam::66666666666:user/user1"
      username = "user1"
      groups = ["system:masters"]
    },
    {
      userarn = "arn:aws:iam::66666666666:user/user2"
      username = "user2"
      groups = ["system:masters"]
    },
  ]

  map_accounts = [
    "777777777777",
    "888888888888",
  ]
}

```

Error:

```auto
PS E:\eks> terraform apply
╷
│ Error: Unsupported argument
│ 
│ on main.tf line 41, in module "eks_auth":  
│ 41: eks = module.eks
│ 
│ An argument named "eks" is not expected here.
╵
╷
│ Error: Unsupported argument
│ 
│ on main.tf line 43, in module "eks_auth":
│ 43: map_roles = [
│
│ An argument named "map_roles" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│ on main.tf line 51, in module "eks_auth":
│ 51: map_users = [
│
│ An argument named "map_users" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│ on main.tf line 64, in module "eks_auth":
│ 64: map_accounts = [
│
│ An argument named "map_accounts" is not expected here.

```

Please correct me. so that I can successfully EKS in my AWS account.

Looking Forword for your response

this is what I followed  
[aidanmelen/eks-auth/aws | complete Example | Terraform Registry](https://registry.terraform.io/modules/aidanmelen/eks-auth/aws/latest/examples/complete)
