-
Notifications
You must be signed in to change notification settings - Fork 13
/
eks_cluster.tf
35 lines (29 loc) · 957 Bytes
/
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
resource "aws_cloudwatch_log_group" "eks_cluster_log_group" {
name = "/aws/eks/${var.cluster_name}/cluster"
retention_in_days = 14
}
resource "aws_eks_cluster" "eks_cluster" {
name = var.cluster_name
role_arn = aws_iam_role.cluster_role.arn
version = var.k8s_version
vpc_config {
subnet_ids = aws_subnet.private_subnets[*].id
endpoint_private_access = var.endpoint_private_access
endpoint_public_access = var.endpoint_public_access
}
access_config {
authentication_mode = "API"
}
enabled_cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
tags = {
Name = var.cluster_name
Environment = var.environment
Terraform = "true"
Team = var.team
Project = var.project
}
depends_on = [
aws_iam_role_policy_attachment.cluster_AmazonEKSClusterPolicy,
aws_cloudwatch_log_group.eks_cluster_log_group
]
}