Skip to content

Instantly share code, notes, and snippets.

@mzupan
Created May 22, 2019 22:35
Show Gist options
  • Save mzupan/714b9c7d4775d09840c5d57489eb2268 to your computer and use it in GitHub Desktop.
Save mzupan/714b9c7d4775d09840c5d57489eb2268 to your computer and use it in GitHub Desktop.
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