Skip to content

dhoppeIT/terraform-hcloud-network

Repository files navigation

terraform-hcloud-network

Terraform module to manage the following Hetzner Cloud resources:

  • hcloud_network
  • hcloud_network_subnet

Usage

Copy and paste the following code snippet to your Terraform configuration, specify the required variables and run the command terraform init.

module "hcloud_network" {
  source  = "gitlab.com/terraform-child-modules-48151/terraform-hcloud-network/local"
  version = "1.0.0"

  name             = "example-network"
  ip_range_network = "10.0.0.0/8"

  type            = "cloud"
  network_zone    = "eu-central"
  ip_range_subnet = "10.0.1.0/24"
}

Requirements

Name Version
terraform >= 1.0
hcloud ~> 1.0

Providers

Name Version
hcloud ~> 1.0

Modules

No modules.

Resources

Name Type
hcloud_network.this resource
hcloud_network_subnet.this resource

Inputs

Name Description Type Default Required
delete_protection Enable or disable delete protection bool false no
expose_routes_to_vswitch Enable or disable exposing the routes to the vSwitch connection 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 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
vswtich_id ID of the vswitch, Required if type is vswitch number null no

Outputs

Name Description
delete_protection Whether delete protection is enabled
expose_routes_to_vswitch Indicates if the routes from this network should be exposed to the vSwitch connection
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
labels User-defined labels (key-value pairs)
name Name of the network
network_zone Name of network zone
type Type of subnet
vswitch_id ID of the vswitch, when type is vswitch

Authors

Created and maintained by Dennis Hoppe.

License

Apache 2 licensed. See LICENSE for full details.