eks-cluster 작업

This commit is contained in:
2022-12-28 23:26:21 +09:00
parent 6fab570c69
commit ee0d78b284
8 changed files with 53 additions and 17 deletions

View File

@ -0,0 +1,15 @@
resource "aws_eks_cluster" "eks-cluster" {
name = "${var.name}-eks-cluster"
role_arn = var.iam_role_arn
#enabled_cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
vpc_config {
security_group_ids = var.sg_list
subnet_ids = var.subnet_list
#노드그룹 통신을 위한 설정
endpoint_private_access = true
endpoint_public_access = true
}
}

View File

@ -0,0 +1,7 @@
output "endpoint" {
value = "${aws_eks_cluster.eks-cluster.endpoint}"
}
output "kubeconfig-certificate-authority-data" {
value = "${aws_eks_cluster.eks-cluster.certificate_authority.0.data}"
}

View File

@ -0,0 +1,14 @@
variable "name" {
type = string
}
variable "iam_role_arn" {
type = string
}
variable "sg_list" {
type = list(string)
}
variable "subnet_list" {
type = list(string)
}

View File

@ -1,16 +0,0 @@
resource "aws_eks_cluster" "demo" {
name = var.cluster-name
role_arn = aws_iam_role.demo-cluster.arn
enabled_cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
vpc_config {
security_group_ids = [aws_security_group.demo-cluster.id]
subnet_ids = [
aws_subnet.VPC_HQ_public_1a.id,
aws_subnet.VPC_HQ_public_1c.id
]
endpoint_private_access = true
endpoint_public_access = true
}
}

View File

View File

@ -1,4 +1,8 @@
output "iam_name" {
value = aws_iam_role.iam-role.name
}
output "iam_arn" {
value = aws_iam_role.iam-role.arn
}