-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheks.tf
More file actions
34 lines (29 loc) · 966 Bytes
/
eks.tf
File metadata and controls
34 lines (29 loc) · 966 Bytes
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
#################
# create cluster
#################
resource "aws_eks_cluster" "eks_cluster" {
name = var.cluster_name
role_arn = aws_iam_role.eks_cluster.arn
version = var.cluster_version
# enabled_cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
vpc_config {
security_group_ids = [aws_security_group.sg_eks_cluster.id]
subnet_ids = aws_subnet.public_subnet.*.id
endpoint_private_access = var.cluster_endpoint_private_access
endpoint_public_access = var.cluster_endpoint_public_access
}
depends_on = [
aws_iam_role_policy_attachment.eks_cluster_policy
]
}
#######################
# cluster registration
#######################
resource "null_resource" "cluster_registration" {
provisioner "local-exec" {
command = "aws eks --region ap-northeast-2 update-kubeconfig --name ${var.cluster_name}"
}
depends_on = [
aws_eks_cluster.eks_cluster
]
}