Skip to content

Commit 683c015

Browse files
committed
chore : 테라폼 ingress 설정 http,https,nginx 관리자 페이지만 허용하도록 변경
1 parent c6b22bb commit 683c015

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

terraform/main.tf

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,35 @@ resource "aws_route_table_association" "association_4" {
113113
resource "aws_security_group" "sg_1" {
114114
name = "${var.prefix}-sg-1"
115115

116+
# HTTP 허용
116117
ingress {
117-
from_port = 0
118-
to_port = 0
119-
protocol = "all"
118+
from_port = 80
119+
to_port = 80
120+
protocol = "tcp"
120121
cidr_blocks = ["0.0.0.0/0"]
121122
}
122123

124+
# HTTPS 허용
125+
ingress {
126+
from_port = 443
127+
to_port = 443
128+
protocol = "tcp"
129+
cidr_blocks = ["0.0.0.0/0"]
130+
}
131+
132+
# Nginx Proxy Manager 관리자 페이지
133+
ingress {
134+
from_port = 81
135+
to_port = 81
136+
protocol = "tcp"
137+
cidr_blocks = ["0.0.0.0/0"]
138+
}
139+
140+
# Egress - 외부로 나가는 트래픽은 허용 (패키지 다운로드, API 호출 등)
123141
egress {
124-
from_port = 0
125-
to_port = 0
126-
protocol = "all"
142+
from_port = 0
143+
to_port = 0
144+
protocol = "-1"
127145
cidr_blocks = ["0.0.0.0/0"]
128146
}
129147

0 commit comments

Comments
 (0)