forked from smartobi/terraform-fargate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path2nacl.tf
52 lines (41 loc) · 1.2 KB
/
2nacl.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
## ================================================
## Creating AWS Network Access control list section
## ================================================
resource "aws_network_acl" "nacl" {
vpc_id = aws_vpc.vpc.id
ingress {
rule_no = 120
action = "allow"
cidr_block = var.all_cidr # Allow ingress from all sources
protocol = "tcp"
from_port = 443
to_port = 443
}
ingress {
rule_no = 130
action = "allow"
cidr_block = var.all_cidr # Allow ingress from all sources
protocol = "tcp"
from_port = 80
to_port = 80
}
ingress {
rule_no = 500
action = "deny"
cidr_block = var.all_cidr # Allow ingress from all sources
protocol = "icmp"
from_port = 0 # Note: These values might need to be adjusted based on your specific requirements
to_port = 0
}
egress {
rule_no = 210
action = "allow"
cidr_block = var.all_cidr # Allow egress to all destinations
protocol = "-1" # All protocols
from_port = 0 # Note: These values might need to be adjusted based on your specific requirements
to_port = 0
}
tags = {
Name = "${var.tag}-nacl"
}
}