Skip to content

Terraform module to manage the following Hetzner Cloud resources (hcloud_network, hcloud_network_subnet)

License

Notifications You must be signed in to change notification settings

dhoppeIT/terraform-hcloud-network

Repository files navigation

terraform-hcloud-network

Terraform module to manage the following Hetzner Cloud resources:

  • hcloud_network
  • hcloud_network_subnet

Graph

Graph

Usage

Copy and paste into your Terraform configuration, insert the variables and run terraform init:

module "hcloud_network" {
  source  = "dhoppeIT/network/hcloud"
  version = "~> 0.3"

  name             = "private"
  ip_range_network = "10.0.0.0/16"

  type            = "cloud"
  ip_range_subnet = ["10.0.0.0/24"]
  network_zone    = "eu-central"
}

Requirements

Name Version
terraform >= 1.0
hcloud ~> 1.0

Providers

Name Version
hcloud 1.36.0

Modules

No modules.

Resources

Name Type
hcloud_network.default resource
hcloud_network_subnet.default resource

Inputs

Name Description Type Default Required
delete_protection Enable or disable delete protection bool false no
ip_range_network IP Range of the whole Network which must span all included subnets and route destinations string n/a yes
ip_range_subnet Range to allocate IPs from list(string) n/a yes
labels User-defined labels (key-value pairs) should be created with map(string) {} no
name Name of the Network to create string n/a yes
network_zone Name of network zone string n/a yes
type Type of subnet string n/a yes
vswitch_id ID of the vswitch number null no

Outputs

Name Description
id_network Unique ID of the network
id_subnet ID of the Network subnet
ip_range_network IPv4 Prefix of the whole Network
ip_range_subnet Range to allocate IPs from
name Name of the network

Authors

Created and maintained by Dennis Hoppe.

License

Apache 2 licensed. See LICENSE for full details.