Skip to content

dhoppeIT/terraform-hcloud-rdns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5802b15 · Jan 31, 2022

History

16 Commits
Jan 31, 2022
Jan 29, 2022
Jan 29, 2022
Jan 29, 2022
Jan 31, 2022
Jan 14, 2022
Jan 31, 2022
Jan 14, 2022
Jan 14, 2022
Jan 17, 2022
Jan 17, 2022
Jan 14, 2022
Jan 31, 2022

Repository files navigation

terraform-hcloud-rdns

Terraform module to manage the Hetzner Cloud resource (hcloud_rdns).

Graph

Graph

Usage

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

Create one reverse DNS entry:

data "hcloud_server" "default" {
  name = "debian"
}

module "hcloud_rdns" {
  source = "dhoppeIT/rdns/hcloud"

  server_id  = data.hcloud_server.default.id
  ip_address = data.hcloud_server.default.ipv4_address
  dns_ptr    = "${data.hcloud_server.default.name}.dhoppe.it"
}

Create multiple reverse DNS entries:

data "hcloud_servers" "default" {}

module "hcloud_rdns" {
  source = "dhoppeIT/rdns/hcloud"

  count = length(data.hcloud_servers.default.servers)

  server_id  = data.hcloud_servers.default.servers[count.index].id
  ip_address = data.hcloud_servers.default.servers[count.index].ipv4_address
  dns_ptr    = "${data.hcloud_servers.default.servers[count.index].name}.dhoppe.it"
}

Requirements

Name Version
terraform >= 1.0
hcloud ~> 1.0

Providers

Name Version
hcloud 1.32.2

Modules

No modules.

Resources

Name Type
hcloud_rdns.default resource

Inputs

Name Description Type Default Required
dns_ptr The DNS address the ip_address should resolve to string n/a yes
floating_ip_id The Floating IP the ip_address belongs to number null no
ip_address The IP address that should point to dns_ptr string n/a yes
load_balancer_id The Load Balancer the ip_address belongs to number null no
server_id The server the ip_address belongs to number null no

Outputs

Name Description
dns_ptr DNS pointer for the IP address
ip_address IP address

Authors

Created and maintained by Dennis Hoppe.

License

Apache 2 licensed. See LICENSE for full details.