Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion infra/extractor/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ data "aws_security_group" "app" {
name = var.app_sg_name
}

data "aws_security_group" "dev_app" {
vpc_id = data.aws_vpc.main.id
name = var.dev_app_sg_name
}

# 최신 arm64 Ubuntu 24.04 (var.ami_id 지정 시 그 값 사용). JVM 서비스라 Graviton(arm64) 사용 — 본 서버와 동일 라인.
data "aws_ami" "ubuntu" {
count = var.ami_id == null ? 1 : 0
Expand Down Expand Up @@ -138,7 +143,7 @@ resource "aws_security_group" "extractor" {
from_port = local.extractor_port
to_port = local.extractor_port
protocol = "tcp"
security_groups = [data.aws_security_group.app.id] # IP 대신 SG 참조 = '우리 서버만'
security_groups = [data.aws_security_group.app.id, data.aws_security_group.dev_app.id] # IP 대신 SG 참조 = '우리 서버만'
}

egress {
Expand Down
14 changes: 11 additions & 3 deletions infra/extractor/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,22 @@ variable "public_subnet_cidr" {

variable "app_sg_name" {
description = <<-EOT
piki 앱 EC2 보안그룹 이름. 이 SG 에서만 추출 API 포트 인바운드를 허용한다(외부 노출 0).
본 서버 dev/staging/prod 세 인스턴스가 이 SG 하나를 공유하므로 규칙 하나로 세 호출자를 다 덮는다.
※ 참조 계약: piki 팀이 이 SG 를 rename/재생성하면 이 모듈 plan 이 깨진다. 라이브 이름은 plan 으로 확정할 것.
piki prod 앱 EC2 보안그룹 이름(core terraform/security_groups.tf). 이름의 team3-dev 는 옛 이름이다.
※ 참조 계약: core 가 이 SG 를 rename/재생성하면 이 모듈 plan 이 깨진다. 라이브 이름은 plan 으로 확정할 것.
EOT
type = string
default = "team3-dev-ec2-sg"
}

variable "dev_app_sg_name" {
description = <<-EOT
piki dev 앱 EC2 보안그룹 이름(core terraform/security_groups.tf). 이 박스 한 대가 dev·prod 호출을 둘 다 받는다.
prod 와 그룹을 나눈 이유는 prod DB 인바운드에서 dev 를 빼기 위해서다(core#1213).
EOT
type = string
default = "piki-dev-app-sg"
}

# ---------------------------------------------------------------------------
# 박스 스펙
# ---------------------------------------------------------------------------
Expand Down
Loading