-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
39 lines (32 loc) · 982 Bytes
/
main.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
resource "aws_vpc_security_group_ingress_rule" "vpc_security_group_ingress_rule" {
for_each = {
for ingress_rule in local.ingress_rules : "${ingress_rule.key}" => ingress_rule
}
security_group_id = each.value.security_group_id
cidr_ipv4 = each.value.cidr_ipv4
cidr_ipv6 = each.value.cidr_ipv6
from_port = each.value.from_port
ip_protocol = each.value.ip_protocol
to_port = each.value.to_port
tags = merge({
Name = each.value.name
},
each.value.tags
)
}
resource "aws_vpc_security_group_egress_rule" "vpc_security_group_egress_rule" {
for_each = {
for egress_rule in local.egress_rules : "${egress_rule.key}" => egress_rule
}
security_group_id = each.value.security_group_id
cidr_ipv4 = each.value.cidr_ipv4
cidr_ipv6 = each.value.cidr_ipv6
from_port = each.value.from_port
ip_protocol = each.value.ip_protocol
to_port = each.value.to_port
tags = merge({
Name = each.value.name
},
each.value.tags
)
}