Skip to content

Commit 52a2869

Browse files
committed
fix: 환경별 동작하도록 command 지정 및 아웃풋 추가
1 parent 32e0eb9 commit 52a2869

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

terraform/dev/ecs/locals.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ locals {
8484
essential = true
8585
stopTimeout = lookup(def, "stop_timeout", var.default_stop_timeout)
8686

87+
command = svc == "api-dev" ? [
88+
"java",
89+
"-Dspring.profiles.active=dev",
90+
"-jar",
91+
"/api.jar"
92+
] : null
93+
8794
portMappings = [
8895
for idx, port in def.container_port : {
8996
name = "${svc}-${port}-tcp"

terraform/dev/ecs/service/main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ resource "aws_ecs_service" "dev" {
2525
rollback = true
2626
}
2727

28+
lifecycle {
29+
ignore_changes = [task_definition]
30+
}
31+
2832
tags = merge(var.tags, {
2933
Service = each.key
3034
})
31-
}
35+
}

terraform/dev/outputs.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ output "ecs_api_service_name" {
1616

1717
output "ecs_api_container_name" {
1818
value = module.ecs.container_names["api-dev"]
19-
}
19+
}
20+
21+
output "ec2_private_ip" {
22+
value = module.ec2.private_ip
23+
}

terraform/prod/ecs/locals.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ locals {
7272
essential = true
7373
stopTimeout = lookup(def, "stop_timeout", var.default_stop_timeout)
7474

75+
command = svc == "api-prod" ? [
76+
"java",
77+
"-Dspring.profiles.active=prod",
78+
"-jar",
79+
"/api.jar"
80+
] : null
81+
7582
portMappings = [
7683
for idx, port in def.container_port : {
7784
name = "${svc}-${port}-tcp"

0 commit comments

Comments
 (0)