Created
May 22, 2019 22:35
-
-
Save mzupan/714b9c7d4775d09840c5d57489eb2268 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
tags = "${merge( | |
var.env_tags, | |
map( | |
"Name", "${var.name}", | |
"environment", "${var.name}", | |
"terraform", "true", | |
) | |
)}" | |
worker_groups = [ | |
{ | |
instance_type = "m5.2xlarge" | |
key_name = "env.key" | |
iam_role_id = "${aws_iam_role.eks.id}" | |
subnets = "${join(",", data.aws_subnet_ids.private.ids)}" | |
asg_desired_capacity = 2 | |
asg_min_size = 2 | |
asg_max_size = 20 | |
autoscaling_enabled = 1 | |
}, | |
] | |
map_roles = [ | |
{ | |
role_arn = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/OktaAdmin" | |
username = "k8s_admins" | |
group = "system:masters" | |
}, | |
] | |
} | |
module "eks" { | |
source = "github.com/terraform-aws-modules/terraform-aws-eks?ref=v2.0.0" | |
cluster_name = "${var.name}" | |
subnets = "${data.aws_subnet_ids.private.ids}" | |
tags = "${local.tags}" | |
vpc_id = "${data.aws_vpc.vpc.id}" | |
worker_groups = "${local.worker_groups}" | |
worker_group_count = "1" | |
map_roles = "${local.map_roles}" | |
map_roles_count = "1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment