This commit is contained in:
2023-01-06 13:29:00 +09:00
parent f537a31294
commit 9a60aa0f34
27 changed files with 389 additions and 225 deletions

24
modules/efs-fs/main.tf Normal file
View File

@ -0,0 +1,24 @@
# EFS 파일 시스템 생성
resource "aws_efs_file_system" "efs" {
# 원존 클래스를 이용할 경우
# availability_zone_name = "ap-northeast-2a"
# 유휴 시 데이터 암호화
encrypted = true
# KMS에서 관리형 키를 이용하려면 kms_key_id 속성을 붙여줍니다.
# 버스팅 처리량 모드
throughput_mode = "bursting"
# 성능 모드: generalPurpose(범용 모드), maxIO(최대 IO 모드)
performance_mode = "generalPurpose"
# 프로비저닝 처리량 모드
# throughput_mode = "provisioned"
# provisioned_throughput_in_mibps = 100
# 수명 주기 관리
lifecycle_policy {
transition_to_ia = "AFTER_30_DAYS"
}
}

View File

@ -0,0 +1,4 @@
output "efs_fs_id" {
description = "efs fs id"
value = aws_efs_file_system.efs.id
}

View File

@ -0,0 +1,10 @@
# variable "sg_list" {
# description = "security group list"
# type = list(string)
# }
# variable "subnet_id" {
# description = "security group list"
# type = string
# }

View File

@ -0,0 +1,6 @@
resource "aws_efs_mount_target" "mount" {
file_system_id = var.fs_id
subnet_id = var.subnet_id
security_groups = var.sg_list
}

View File

@ -0,0 +1,14 @@
variable "fs_id" {
description = "fs_id"
type = string
}
variable "sg_list" {
description = "security group list"
type = list(string)
}
variable "subnet_id" {
description = "security group list"
type = string
}

View File

View File

@ -1,5 +1,5 @@
resource "aws_eks_cluster" "eks-cluster" {
name = "${var.name}-eks-cluster"
name = "${var.name}"
role_arn = var.iam_role_arn
#enabled_cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]

View File

@ -0,0 +1,5 @@
output "ng_sg" {
description = "Identifier of the remote access EC2 Security Group."
value = "${aws_eks_node_group.eks-ng.resources[0].remote_access_security_group_id}"
}