-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
61 lines (55 loc) · 1.5 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
terraform {
required_providers {
binarylane = {
source = "oscarhermoso/binarylane"
}
}
}
provider "binarylane" {}
resource "binarylane_vpc" "example" {
name = "tf-example-vpc"
ip_range = "10.240.0.0/16"
}
# Web & NAT server
resource "binarylane_server" "web" {
name = "tf-example-vpc-web"
region = "per"
image = "ubuntu-24.04"
size = "std-min"
vpc_id = binarylane_vpc.example.id
public_ipv4_count = 1
}
# Database server
resource "binarylane_server" "db" {
name = "tf-example-vpc-db"
region = "per"
image = "ubuntu-24.04"
size = "std-min"
vpc_id = binarylane_vpc.example.id
public_ipv4_count = 0
}
# VPN server
resource "binarylane_server" "vpn" {
name = "tf-example-vpc-vpn"
region = "per"
image = "ubuntu-24.04"
size = "std-min"
vpc_id = binarylane_vpc.example.id
public_ipv4_count = 1
source_and_destination_check = false
}
resource "binarylane_vpc_route_entries" "example" {
vpc_id = binarylane_vpc.example.id
route_entries = [
{
description = "NAT"
destination = "0.0.0.0/0"
router = binarylane_server.web.private_ipv4_addresses.0
},
{
description = "VPN"
destination = "192.168.1.0/24"
router = binarylane_server.vpn.private_ipv4_addresses.0
}
]
}