-
Notifications
You must be signed in to change notification settings - Fork 1
/
route-switcher.tf
66 lines (66 loc) · 2.63 KB
/
route-switcher.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
module "route_switcher" {
source = "github.com/yandex-cloud-examples/yc-route-switcher"
start_module = false
folder_id = yandex_resourcemanager_folder.folder4.id
route_table_folder_list = [yandex_resourcemanager_folder.folder1.id, yandex_resourcemanager_folder.folder2.id, yandex_resourcemanager_folder.folder4.id, yandex_resourcemanager_folder.folder5.id]
route_table_list = [yandex_vpc_route_table.dmz-rt.id, yandex_vpc_route_table.app-rt.id, yandex_vpc_route_table.mgmt-rt.id, yandex_vpc_route_table.database-rt.id]
router_healthcheck_port = 443
router_healthcheck_interval = 60
back_to_primary = true
routers = [
{
# fw-a
healthchecked_ip = "${cidrhost(var.subnet-a_vpc_4, 10)}"
healthchecked_subnet_id = yandex_vpc_subnet.subnet-a_vpc_4.id
interfaces = [
{
# mgmt-int
own_ip = yandex_compute_instance.fw-a.network_interface.0.ip_address
backup_peer_ip = yandex_compute_instance.fw-b.network_interface.0.ip_address
},
{
# dmz-int
own_ip = yandex_compute_instance.fw-a.network_interface.2.ip_address
backup_peer_ip = yandex_compute_instance.fw-b.network_interface.2.ip_address
},
{
# app-int
own_ip = yandex_compute_instance.fw-a.network_interface.3.ip_address
backup_peer_ip = yandex_compute_instance.fw-b.network_interface.3.ip_address
},
{
# database-int
own_ip = yandex_compute_instance.fw-a.network_interface.4.ip_address
backup_peer_ip = yandex_compute_instance.fw-b.network_interface.4.ip_address
}
]
},
{
# fw-b
healthchecked_ip = "${cidrhost(var.subnet-b_vpc_4, 10)}"
healthchecked_subnet_id = yandex_vpc_subnet.subnet-b_vpc_4.id
interfaces = [
{
# mgmt-int
own_ip = yandex_compute_instance.fw-b.network_interface.0.ip_address
backup_peer_ip = yandex_compute_instance.fw-a.network_interface.0.ip_address
},
{
# dmz-int
own_ip = yandex_compute_instance.fw-b.network_interface.2.ip_address
backup_peer_ip = yandex_compute_instance.fw-a.network_interface.2.ip_address
},
{
# app-int
own_ip = yandex_compute_instance.fw-b.network_interface.3.ip_address
backup_peer_ip = yandex_compute_instance.fw-a.network_interface.3.ip_address
},
{
# database-int
own_ip = yandex_compute_instance.fw-b.network_interface.4.ip_address
backup_peer_ip = yandex_compute_instance.fw-a.network_interface.4.ip_address
}
]
}
]
}