Skip to content

Commit

Permalink
docs: Describe how to create multiple reverse DNS entries (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoppe authored Jan 17, 2022
1 parent 9aed694 commit c945860
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Terraform module to manage the Hetzner Cloud resource (hcloud_rdns).

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

**Create one reverse DNS entry:**

```hcl
module "hcloud-rdns" {
source = "dhoppeIT/rdns/hcloud"
Expand All @@ -20,6 +22,22 @@ module "hcloud-rdns" {
}
```

**Create multiple reverse DNS entries:**

```hcl
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"
}
```

<!--- BEGIN_TF_DOCS --->
## Requirements

Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ output "dns_ptr" {
}

output "ip_address" {
description = " IP address"
description = "IP address"
value = hcloud_rdns.default.ip_address
}

0 comments on commit c945860

Please sign in to comment.