-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheks-cluster.tf
52 lines (41 loc) · 1.1 KB
/
eks-cluster.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
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "18.31.2"
cluster_name = local.cluster_name
cluster_version = "1.24"
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
cluster_security_group_additional_rules = {
enable_access_http = {
description = "Enable access by http port (80)"
protocol = "tcp"
from_port = 80
to_port = 80
type = "ingress"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
}
eks_managed_node_group_defaults = {
ami_type = "AL2_x86_64"
attach_cluster_primary_security_group = true
# Disabling and using externally provided security groups
create_security_group = false
}
eks_managed_node_groups = {
my_node_group = {
name = "my_node_group"
instance_types = ["t2.small"]
capacity_type = "SPOT"
min_size = 1
max_size = 2
desired_size = 2
pre_bootstrap_user_data = <<-EOT
echo 'foo bar'
EOT
vpc_security_group_ids = [
aws_security_group.node_group_one.id
]
}
}
}