module "eks" { source = "terraform-aws-modules/eks/aws" cluster_name = var.cluster_name subnets = module.vpc.private_subnets cluster_create_timeout = "1h" vpc_id = module.vpc.vpc_id worker_additional_security_group_ids = [aws_security_group.all_worker_mgmt.id] worker_groups = [ { name = "worker-group-1" instance_type = "t2.small" additional_userdata = "echo foo bar" asg_desired_capacity = 2 additional_security_group_ids = [aws_security_group.worker_group_mgmt_one.id] }, ] } data "aws_eks_cluster" "cluster" { name = module.eks.cluster_id } data "aws_eks_cluster_auth" "cluster" { name = module.eks.cluster_id } module "kubernetes" { source = "./modules/kubernetes/" host = data.aws_eks_cluster.cluster.endpoint token = data.aws_eks_cluster_auth.cluster.token cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data) }