-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsecurity.tf
49 lines (43 loc) · 1.09 KB
/
security.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
resource "aws_security_group" "neo4j_sg" {
name = "${var.env_prefix}_sg"
vpc_id = aws_vpc.neo4j_vpc.id
// no restrictions on traffic originating from inside the VPC
ingress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["${var.vpc_base_cidr}"]
}
// no restrictions on ssh traffic from var.ssh_source_cidr
ingress {
from_port = 22
to_port = 22
protocol = "TCP"
cidr_blocks = ["${var.ssh_source_cidr}"]
}
// no restrictions on neo4j browser traffic from var.neo4j_source_cide
ingress {
from_port = 7474
to_port = 7474
protocol = "TCP"
cidr_blocks = ["${var.neo4j_source_cidr}"]
}
// no restrictions on neo4j bolt traffic from var.neo4j_source_cide
ingress {
from_port = 7687
to_port = 7687
protocol = "TCP"
cidr_blocks = ["${var.neo4j_source_cidr}"]
}
// outbound internet access
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
"Name" = "${var.env_prefix}-sg"
"Terraform" = true
}
}