11module "eks" {
22 source = " terraform-aws-modules/eks/aws"
3- version = " 19.0.4 "
3+ version = " 21.2.0 "
44
5- cluster_name = local. cluster_name
6- cluster_version = " 1.32"
5+ name = local. cluster_name
6+ kubernetes_version = " 1.32"
77
88 vpc_id = var. vpc_id
99 subnet_ids = var. subnet_ids
10- cluster_endpoint_public_access = true
11- cluster_security_group_id = var. dev_security_group_id
12- aws_auth_users = [
13- {
14- userarn = " arn:aws:iam::364159549467:user/liam"
15- username = " liam"
16- groups = [" system:masters " ]
10+ endpoint_public_access = true
11+ security_group_id = var. dev_security_group_id
12+ access_entries = {
13+ liam = {
14+ principal_arn = " arn:aws:iam::364159549467:user/liam"
15+ user_name = " liam"
16+ kubernetes_groups = [" eks-admins " ]
1717 },
18- {
19- userarn = " arn:aws:iam::364159549467:user/cecilia"
20- username = " cecilia"
21- groups = [" system:masters " ]
18+ cecilia = {
19+ principal_arn = " arn:aws:iam::364159549467:user/cecilia"
20+ user_name = " cecilia"
21+ kubernetes_groups = [" eks-admins " ]
2222 }
23- ]
24-
25- eks_managed_node_group_defaults = {
26- ami_type = " AL2_x86_64"
27-
28- block_device_mappings = {
29- xvda = {
30- device_name = " /dev/xvda"
31- ebs = {
32- volume_size = 32
33- volume_type = " gp2"
34- delete_on_termination = true
35- encrypted = true
36- }
37- }
23+ }
24+
25+ addons = {
26+ coredns = {
27+ most_recent = true
28+ resolve_conflicts_on_create = " OVERWRITE"
29+ resolve_conflicts = " OVERWRITE"
30+ }
31+ kube-proxy = {
32+ most_recent = true
33+ resolve_conflicts_on_create = " OVERWRITE"
34+ resolve_conflicts = " OVERWRITE"
35+ }
36+ vpc-cni = {
37+ most_recent = true
38+ resolve_conflicts_on_create = " OVERWRITE"
39+ resolve_conflicts = " OVERWRITE"
3840 }
3941 }
4042
4143 eks_managed_node_groups = {
4244 one = {
4345 name = " node-group-1"
46+ ami_type = " AL2023_x86_64_STANDARD"
4447
4548 vpc_security_group_ids = [var.dev_security_group_id, var.staging_security_group_id]
4649
@@ -49,6 +52,36 @@ module "eks" {
4952 min_size = 3
5053 max_size = 3
5154 desired_size = 3
55+
56+ block_device_mappings = {
57+ xvda = {
58+ device_name = " /dev/xvda"
59+ ebs = {
60+ volume_size = 32
61+ volume_type = " gp2"
62+ delete_on_termination = true
63+ encrypted = true
64+ }
65+ }
66+ }
5267 }
5368 }
5469}
70+
71+ resource "kubernetes_cluster_role_binding" "eks_admins_cluster_admin" {
72+ metadata {
73+ name = " eks-admins-cluster-admin"
74+ }
75+
76+ role_ref {
77+ api_group = " rbac.authorization.k8s.io"
78+ kind = " ClusterRole"
79+ name = " cluster-admin"
80+ }
81+
82+ subject {
83+ kind = " Group"
84+ name = " eks-admins"
85+ api_group = " rbac.authorization.k8s.io"
86+ }
87+ }
0 commit comments