-
Notifications
You must be signed in to change notification settings - Fork 23
/
web_sg.tf
43 lines (38 loc) · 1.08 KB
/
web_sg.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
###################################
## SG Presentation Tier ###
###################################
resource "aws_security_group" "webserver-security-group" {
name = "Web server Security Group"
description = "Enable http/https access on port 80/443 via ALB and ssh via ssh sg"
vpc_id = aws_vpc.vpc_prod.id
ingress {
description = "http access"
from_port = 8080
to_port = 8080
protocol = "tcp"
security_groups = ["${aws_security_group.alb-security-group.id}"]
}
ingress {
description = "https access"
from_port = 443
to_port = 443
protocol = "tcp"
security_groups = ["${aws_security_group.alb-security-group.id}"]
}
ingress {
description = "ssh access"
from_port = 22
to_port = 22
protocol = "tcp"
security_groups = ["${aws_security_group.ssh-security-group.id}"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
Name = "Web server Security group"
}
}