Skip to content

Commit

Permalink
feat: add vswitch management
Browse files Browse the repository at this point in the history
  • Loading branch information
KoLiBer committed Oct 30, 2024
1 parent 5967e87 commit 7fe7188
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 23 deletions.
32 changes: 16 additions & 16 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions network.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
resource "hcloud_network" "this" {
name = var.name
ip_range = var.cidr
labels = var.labels
delete_protection = var.protection
name = var.name
ip_range = var.cidr
labels = var.labels
delete_protection = var.protection
expose_routes_to_vswitch = var.expose_vswitch
}

resource "hcloud_network_subnet" "this" {
for_each = var.subnets

network_id = hcloud_network.this.id
network_zone = var.zone
network_id = hcloud_network.this.id
type = each.value.type
ip_range = each.value.cidr
vswitch_id = each.value.vswitch
}

resource "hcloud_network_route" "this" {
Expand Down
12 changes: 10 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,18 @@ variable "protection" {
description = "Network Protection"
}

variable "expose_vswitch" {
type = bool
default = null
sensitive = false
description = "Network Expose VSwitch"
}

variable "subnets" {
type = map(object({
type = string
cidr = string
type = string
cidr = string
vswitch = optional(number)
}))
default = {}
sensitive = false
Expand Down

0 comments on commit 7fe7188

Please sign in to comment.