Skip to content

Commit 8c2536a

Browse files
committed
4 feat: sandbox ECS EC2 모듈 연결 및 실행 환경 구성
1 parent 51bb6bf commit 8c2536a

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

component/main.tf

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
module "sandbox" {
2-
count = var.environment == "sandbox" ? 1 : 0
2+
count = var.environment == "sandbox" ? 1 : 0
33
source = "./sandbox"
4+
5+
vpc_id = aws_vpc.main.id
6+
public_subnet_ids = [
7+
aws_subnet.public_a.id,
8+
aws_subnet.public_c.id
9+
]
410
}
511

612
module "prod" {
7-
count = var.environment == "prod" ? 1 : 0
13+
count = var.environment == "prod" ? 1 : 0
814
source = "./prod"
15+
16+
vpc_id = aws_vpc.main.id
17+
public_subnet_ids = [
18+
aws_subnet.public_a.id,
19+
aws_subnet.public_c.id
20+
]
921
}

component/sandbox/main.tf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module "ecs_ec2" {
2+
source = "./ecs-ec2"
3+
4+
environment = "sandbox"
5+
6+
vpc_id = var.vpc_id
7+
public_subnet_ids = var.public_subnet_ids
8+
9+
instance_type = "t2.micro"
10+
ecs_desired_capacity = 1
11+
ecs_min_size = 1
12+
ecs_max_size = 1
13+
14+
# Sandbox용 임시 설정
15+
ssh_ingress_cidrs = ["0.0.0.0/0"]
16+
app_ingress_cidrs = ["0.0.0.0/0"]
17+
18+
# 임시 이미지
19+
container_image = "nginx:latest"
20+
container_port = 80
21+
}

0 commit comments

Comments
 (0)