Skip to content

Commit

Permalink
Add direct connect resources
Browse files Browse the repository at this point in the history
  • Loading branch information
schirevko committed Sep 12, 2023
1 parent 96e02af commit 33eb595
Show file tree
Hide file tree
Showing 61 changed files with 4,473 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/dc/bgp_instance/base-router.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "vkcs_dc_router" "dc_router" {
availability_zone = "GZ1"
flavor = "standard"
name = "tf-example"
description = "tf-example-description"
}
10 changes: 10 additions & 0 deletions examples/dc/bgp_instance/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "vkcs_dc_bgp_instance" "dc_bgp_instance" {
name = "tf-example"
description = "tf-example-description"
dc_router_id = vkcs_dc_router.dc_router.id
bgp_router_id = "192.168.1.2"
asn = 12345
ecmp_enabled = true
enabled = true
graceful_restart = true
}
10 changes: 10 additions & 0 deletions examples/dc/bgp_neighbor/base-bgp-instance.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "vkcs_dc_bgp_instance" "dc_bgp_instance" {
name = "tf-example"
description = "tf-example-description"
dc_router_id = vkcs_dc_router.dc_router.id
bgp_router_id = "192.168.1.2"
asn = 12345
ecmp_enabled = true
enabled = true
graceful_restart = true
}
6 changes: 6 additions & 0 deletions examples/dc/bgp_neighbor/base-router.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "vkcs_dc_router" "dc_router" {
availability_zone = "GZ1"
flavor = "standard"
name = "tf-example"
description = "tf-example-description"
}
9 changes: 9 additions & 0 deletions examples/dc/bgp_neighbor/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "vkcs_dc_bgp_neighbor" "dc_bgp_neighbor" {
name = "tf-example"
add_paths = "on"
description = "tf-example-description"
dc_bgp_id = vkcs_dc_bgp_instance.dc_bgp_instance.id
remote_asn = 1
remote_ip = "192.168.1.3"
enabled = true
}
10 changes: 10 additions & 0 deletions examples/dc/bgp_static_announce/base-bgp-instance.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "vkcs_dc_bgp_instance" "dc_bgp_instance" {
name = "tf-example"
description = "tf-example-description"
dc_router_id = vkcs_dc_router.dc_router.id
bgp_router_id = "192.168.1.2"
asn = 12345
ecmp_enabled = true
enabled = true
graceful_restart = true
}
6 changes: 6 additions & 0 deletions examples/dc/bgp_static_announce/base-router.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "vkcs_dc_router" "dc_router" {
availability_zone = "GZ1"
flavor = "standard"
name = "tf-example"
description = "tf-example-description"
}
8 changes: 8 additions & 0 deletions examples/dc/bgp_static_announce/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "vkcs_dc_bgp_static_announce" "dc_bgp_static_announce" {
name = "tf-example"
description = "tf-example-description"
dc_bgp_id = vkcs_dc_bgp_instance.dc_bgp_instance.id
network = "192.168.1.0/24"
gateway = "192.168.1.3"
enabled = true
}
1 change: 1 addition & 0 deletions examples/dc/interface/base-networking.tf
6 changes: 6 additions & 0 deletions examples/dc/interface/base-router.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "vkcs_dc_router" "dc_router" {
availability_zone = "GZ1"
flavor = "standard"
name = "tf-example"
description = "tf-example-description"
}
8 changes: 8 additions & 0 deletions examples/dc/interface/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "vkcs_dc_interface" "dc_interface" {
name = "tf-example"
description = "tf-example-description"
dc_router_id = vkcs_dc_router.dc_router.id
network_id = vkcs_networking_network.app.id
subnet_id = vkcs_networking_subnet.app.id
bgp_announce_enabled = true
}
6 changes: 6 additions & 0 deletions examples/dc/router/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "vkcs_dc_router" "dc_router" {
availability_zone = "GZ1"
flavor = "standard"
name = "tf-example"
description = "tf-example-description"
}
6 changes: 6 additions & 0 deletions examples/dc/static_route/base-router.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "vkcs_dc_router" "dc_router" {
availability_zone = "GZ1"
flavor = "standard"
name = "tf-example"
description = "tf-example-description"
}
8 changes: 8 additions & 0 deletions examples/dc/static_route/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "vkcs_dc_static_route" "dc_static_route" {
name = "tf-example"
description = "tf-example-description"
dc_router_id = vkcs_dc_router.dc_router.id
network = "192.168.1.0/24"
gateway = "192.168.1.3"
metric = 1
}
45 changes: 45 additions & 0 deletions examples/dc/vrrp/base-networking.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Create networks
resource "vkcs_networking_network" "app" {
name = "app-tf-example"
description = "Application network"
}

resource "vkcs_networking_subnet" "app" {
name = "app-tf-example"
network_id = vkcs_networking_network.app.id
cidr = "192.168.199.0/24"
}

resource "vkcs_networking_network" "db" {
name = "db-tf-example"
description = "Database network"
}

resource "vkcs_networking_subnet" "db" {
name = "db-tf-example"
network_id = vkcs_networking_network.db.id
cidr = "192.168.166.0/24"
}

# Get external network with Inernet access
data "vkcs_networking_network" "extnet" {
name = "ext-net"
}

# Create a router to connect netwoks
resource "vkcs_networking_router" "router" {
name = "router-tf-example"
# Connect router to Internet
external_network_id = data.vkcs_networking_network.extnet.id
}

# Connect networks to the router
resource "vkcs_networking_router_interface" "app" {
router_id = vkcs_networking_router.router.id
subnet_id = vkcs_networking_subnet.app.id
}

resource "vkcs_networking_router_interface" "db" {
router_id = vkcs_networking_router.router.id
subnet_id = vkcs_networking_subnet.db.id
}
9 changes: 9 additions & 0 deletions examples/dc/vrrp/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "vkcs_dc_vrrp" "dc_vrrp" {
name = "tf-example"
description = "tf-example-description"
group_id = 100
network_id = vkcs_networking_network.app.id
subnet_id = vkcs_networking_subnet.app.id
advert_interval = 1
enabled = true
}
45 changes: 45 additions & 0 deletions examples/dc/vrrp_address/base-networking.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Create networks
resource "vkcs_networking_network" "app" {
name = "app-tf-example"
description = "Application network"
}

resource "vkcs_networking_subnet" "app" {
name = "app-tf-example"
network_id = vkcs_networking_network.app.id
cidr = "192.168.199.0/24"
}

resource "vkcs_networking_network" "db" {
name = "db-tf-example"
description = "Database network"
}

resource "vkcs_networking_subnet" "db" {
name = "db-tf-example"
network_id = vkcs_networking_network.db.id
cidr = "192.168.166.0/24"
}

# Get external network with Inernet access
data "vkcs_networking_network" "extnet" {
name = "ext-net"
}

# Create a router to connect netwoks
resource "vkcs_networking_router" "router" {
name = "router-tf-example"
# Connect router to Internet
external_network_id = data.vkcs_networking_network.extnet.id
}

# Connect networks to the router
resource "vkcs_networking_router_interface" "app" {
router_id = vkcs_networking_router.router.id
subnet_id = vkcs_networking_subnet.app.id
}

resource "vkcs_networking_router_interface" "db" {
router_id = vkcs_networking_router.router.id
subnet_id = vkcs_networking_subnet.db.id
}
9 changes: 9 additions & 0 deletions examples/dc/vrrp_address/base-vrrp.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "vkcs_dc_vrrp" "dc_vrrp" {
name = "tf-example"
description = "tf-example-description"
group_id = 100
network_id = vkcs_networking_network.app.id
subnet_id = vkcs_networking_subnet.app.id
advert_interval = 1
enabled = true
}
6 changes: 6 additions & 0 deletions examples/dc/vrrp_address/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "vkcs_dc_vrrp_address" "dc_vrrp_address" {
name = "tf-example"
description = "tf-example-description"
dc_vrrp_id = vkcs_dc_vrrp.dc_vrrp.id
ip_address = "192.168.199.1"
}
8 changes: 8 additions & 0 deletions examples/dc/vrrp_interface/base-interface.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "vkcs_dc_interface" "dc_interface" {
name = "tf-example"
description = "tf-example-description"
dc_router_id = vkcs_dc_router.dc_router.id
network_id = vkcs_networking_network.app.id
subnet_id = vkcs_networking_subnet.app.id
bgp_announce_enabled = true
}
45 changes: 45 additions & 0 deletions examples/dc/vrrp_interface/base-networking.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Create networks
resource "vkcs_networking_network" "app" {
name = "app-tf-example"
description = "Application network"
}

resource "vkcs_networking_subnet" "app" {
name = "app-tf-example"
network_id = vkcs_networking_network.app.id
cidr = "192.168.199.0/24"
}

resource "vkcs_networking_network" "db" {
name = "db-tf-example"
description = "Database network"
}

resource "vkcs_networking_subnet" "db" {
name = "db-tf-example"
network_id = vkcs_networking_network.db.id
cidr = "192.168.166.0/24"
}

# Get external network with Inernet access
data "vkcs_networking_network" "extnet" {
name = "ext-net"
}

# Create a router to connect netwoks
resource "vkcs_networking_router" "router" {
name = "router-tf-example"
# Connect router to Internet
external_network_id = data.vkcs_networking_network.extnet.id
}

# Connect networks to the router
resource "vkcs_networking_router_interface" "app" {
router_id = vkcs_networking_router.router.id
subnet_id = vkcs_networking_subnet.app.id
}

resource "vkcs_networking_router_interface" "db" {
router_id = vkcs_networking_router.router.id
subnet_id = vkcs_networking_subnet.db.id
}
6 changes: 6 additions & 0 deletions examples/dc/vrrp_interface/base-router.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "vkcs_dc_router" "dc_router" {
availability_zone = "GZ1"
flavor = "standard"
name = "tf-example"
description = "tf-example-description"
}
9 changes: 9 additions & 0 deletions examples/dc/vrrp_interface/base-vrrp.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "vkcs_dc_vrrp" "dc_vrrp" {
name = "tf-example"
description = "tf-example-description"
group_id = 100
network_id = vkcs_networking_network.app.id
subnet_id = vkcs_networking_subnet.app.id
advert_interval = 1
enabled = true
}
9 changes: 9 additions & 0 deletions examples/dc/vrrp_interface/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "vkcs_dc_vrrp_interface" "dc_vrrp_interface" {
name = "tf-example"
description = "tf-example-description"
dc_vrrp_id = vkcs_dc_vrrp.dc_vrrp.id
dc_interface_id = vkcs_dc_interface.dc_interface.id
priority = 100
preempt = true
master = true
}
Loading

0 comments on commit 33eb595

Please sign in to comment.