-
Notifications
You must be signed in to change notification settings - Fork 0
/
security_group.tf
73 lines (62 loc) · 1.45 KB
/
security_group.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
resource "aws_security_group" "resume-app-security-group" {
name = var.security_group_name
description = "Allow HTTP and HTTPS traffic for inbound and outbound connections to the web app."
vpc_id = aws_vpc.resume-app-vpc.id
ingress {
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = var.cidr_ingress_80
}
ingress {
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = var.cidr_ingress_443
}
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = var.cidr_ingress_22
}
ingress {
from_port = -1
to_port = -1
protocol = "icmp"
cidr_blocks = var.cidr_ingress_icmp
}
ingress {
from_port = 9100
to_port = 9100
protocol = "tcp"
cidr_blocks = var.cidr_ingress_node_exporter
}
ingress {
from_port = 9090
to_port = 9090
protocol = "tcp"
cidr_blocks = var.cidr_ingress_prometheus
}
ingress {
from_port = 3000
to_port = 3000
protocol = "tcp"
cidr_blocks = var.cidr_ingress_grafana
}
ingress {
from_port = 9093
to_port = 9093
protocol = "tcp"
cidr_blocks = var.cidr_ingress_alertmanager
}
egress {
from_port = 0
to_port = 0
protocol = var.cidr_egress_protocol
cidr_blocks = var.cidr_egress_ips
}
tags = {
Name = "${var.environment}-${var.security_group_name}"
}
}