-
Notifications
You must be signed in to change notification settings - Fork 2
/
eks.tf
60 lines (50 loc) · 1.63 KB
/
eks.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
terraform {
required_version = ">= 0.12.0"
}
provider "aws" {
version = ">= 2.28.1"
region = var.region
}
provider "local" {
version = "~> 1.2"
}
provider "null" {
version = "~> 2.1"
}
provider "template" {
version = "~> 2.1"
}
data "aws_availability_zones" "available" {
}
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "6.0.1"
cluster_name = "eks-${var.environment}"
cluster_version = "1.14"
subnets = module.vpc.private_subnets
tags = {
Environment = var.environment
}
vpc_id = module.vpc.vpc_id
worker_groups = [
{
name = "worker-group-1"
instance_type = "t3a.small"
pre_userdata = "${data.template_file.eks_linux_pre_user_data_template.rendered}"
asg_desired_capacity = 1
additional_security_group_ids = [aws_security_group.worker_group_mgmt_one.id]
bootstrap_extra_args = var.bootstrap_extra_args
},
{
name = "worker-group-2"
instance_type = "t3a.small"
pre_userdata = "${data.template_file.eks_linux_pre_user_data_template.rendered}"
asg_desired_capacity = 1
additional_security_group_ids = [aws_security_group.worker_group_mgmt_two.id]
bootstrap_extra_args = var.bootstrap_extra_args
}
]
workers_additional_policies = ["${aws_iam_policy.workers_allow_modify_ec2_attribute_policy.arn}"]
worker_additional_security_group_ids = [aws_security_group.all_worker_mgmt.id]
map_users = var.map_users
}