-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path20-cluster.tf
48 lines (37 loc) · 1022 Bytes
/
20-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
# cluster
resource "aws_eks_cluster" "cluster" {
name = var.cluster_name
version = var.kubernetes_version
role_arn = aws_iam_role.cluster.arn
enabled_cluster_log_types = var.cluster_log_types
vpc_config {
subnet_ids = var.subnet_ids
security_group_ids = [aws_security_group.cluster.id]
endpoint_private_access = var.endpoint_private_access
endpoint_public_access = var.endpoint_public_access
}
kubernetes_network_config {
ip_family = var.ip_family
}
tags = merge(
var.tags,
{
"Name" = var.cluster_name
},
)
depends_on = [
aws_cloudwatch_log_group.cluster,
aws_iam_role_policy_attachment.cluster_AmazonEKSClusterPolicy,
aws_iam_role_policy_attachment.cluster_AmazonEKSServicePolicy,
]
}
resource "aws_cloudwatch_log_group" "cluster" {
name = format("/aws/eks/%s/cluster", var.cluster_name)
retention_in_days = var.retention_in_days
tags = merge(
local.tags,
{
"Name" = var.cluster_name
},
)
}