-
Notifications
You must be signed in to change notification settings - Fork 0
/
net.tf
42 lines (35 loc) · 1018 Bytes
/
net.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
resource "yandex_vpc_network" "net" {
name = "net"
}
//
resource "yandex_vpc_subnet" "net-a" {
v4_cidr_blocks = ["10.230.1.0/24"]
zone = "ru-central1-a"
network_id = yandex_vpc_network.net.id
route_table_id = yandex_vpc_route_table.rt.id
}
resource "yandex_vpc_subnet" "net-b" {
v4_cidr_blocks = ["10.230.2.0/24"]
zone = "ru-central1-b"
network_id = yandex_vpc_network.net.id
route_table_id = yandex_vpc_route_table.rt.id
}
resource "yandex_vpc_subnet" "net-c" {
v4_cidr_blocks = ["10.230.3.0/24"]
zone = "ru-central1-c"
network_id = yandex_vpc_network.net.id
route_table_id = yandex_vpc_route_table.rt.id
}
//
resource "yandex_vpc_gateway" "nat_gateway" {
name = "nat-gateway"
shared_egress_gateway {}
}
resource "yandex_vpc_route_table" "rt" {
name = "nat-route-table"
network_id = yandex_vpc_network.net.id
static_route {
destination_prefix = "0.0.0.0/0"
gateway_id = yandex_vpc_gateway.nat_gateway.id
}
}