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:
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:
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