-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.tf
42 lines (40 loc) · 1019 Bytes
/
local.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
locals {
azs = data.aws_availability_zones.available.names
prefix = "${var.project}-${var.environment}"
# Define inbound and outbound ACL rules for any peering connections.
peer_inbound_acls = [
for peer in var.peers : {
action = "allow"
cidr_block = peer.cidr
from_port = 0
protocol = -1
rule_number = 200
to_port = 0
}
]
peer_outbound_acls = [
for peer in var.peers : {
action = "allow"
cidr_block = peer.cidr
from_port = 0
protocol = -1
rule_number = 200
to_port = 0
}
]
# Create a set of peering routes based on the provided peers and the created
# private route tables.
peer_cidrs = [
for key, value in var.peers : {
key = key
cidr = value.cidr
}
]
peer_routes = [
for pair in setproduct(local.peer_cidrs, module.vpc.private_route_table_ids) : {
cidr = pair[0].cidr
key = pair[0].key
table_id = pair[1]
}
]
}