From 2e55cd2484324ca22cfc9a96877fd50d0985c8aa Mon Sep 17 00:00:00 2001 From: Dennis Hoppe Date: Tue, 8 Feb 2022 16:45:57 +0100 Subject: [PATCH] feat: Add ID of reverse DNS entry as output (#15) * feat: Add ID of reverse DNS entry as output * docs: Add missing version argument to module block * chore: Remove empty file (locals.tf) * docs: Generate README.md Co-authored-by: github-actions[bot] --- README.md | 13 +++++++++---- examples/multiple_entries/README.md | 1 + examples/multiple_entries/outputs.tf | 5 +++++ examples/multiple_entries/rover.svg | 2 +- examples/single_entry/README.md | 1 + examples/single_entry/outputs.tf | 5 +++++ examples/single_entry/rover.svg | 2 +- locals.tf | 1 - outputs.tf | 5 +++++ rover.svg | 2 +- 10 files changed, 29 insertions(+), 8 deletions(-) delete mode 100644 locals.tf diff --git a/README.md b/README.md index 2e6d2f7..05bfe9b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # terraform-hcloud-rdns -Terraform module to manage the Hetzner Cloud resource (hcloud_rdns). +Terraform module to manage the following Hetzner Cloud resource: + +* hcloud_rdns ## Graph @@ -18,7 +20,8 @@ data "hcloud_server" "default" { } module "hcloud_rdns" { - source = "dhoppeIT/rdns/hcloud" + source = "dhoppeIT/rdns/hcloud" + version = "~> 0.1" server_id = data.hcloud_server.default.id ip_address = data.hcloud_server.default.ipv4_address @@ -29,10 +32,11 @@ module "hcloud_rdns" { **Create multiple reverse DNS entries:** ```hcl -data "hcloud_servers" "default" {} + module "hcloud_rdns" { - source = "dhoppeIT/rdns/hcloud" + source = "dhoppeIT/rdns/hcloud" + version = "~> 0.1" count = length(data.hcloud_servers.default.servers) @@ -81,6 +85,7 @@ No modules. | Name | Description | |------|-------------| | [dns\_ptr](#output\_dns\_ptr) | DNS pointer for the IP address | +| [id](#output\_id) | Unique ID of the Reverse DNS entry | | [ip\_address](#output\_ip\_address) | IP address | diff --git a/examples/multiple_entries/README.md b/examples/multiple_entries/README.md index d1533fd..474e834 100644 --- a/examples/multiple_entries/README.md +++ b/examples/multiple_entries/README.md @@ -56,6 +56,7 @@ $ terraform apply | Name | Description | |------|-------------| | [rdns\_dns\_ptr](#output\_rdns\_dns\_ptr) | DNS pointer for the IP address | +| [rdns\_id](#output\_rdns\_id) | Unique ID of the Reverse DNS entry | | [rdns\_ip\_address](#output\_rdns\_ip\_address) | IP address | diff --git a/examples/multiple_entries/outputs.tf b/examples/multiple_entries/outputs.tf index 64971bc..1223b5b 100644 --- a/examples/multiple_entries/outputs.tf +++ b/examples/multiple_entries/outputs.tf @@ -1,3 +1,8 @@ +output "rdns_id" { + description = "Unique ID of the Reverse DNS entry" + value = module.hcloud_rdns.id +} + output "rdns_dns_ptr" { description = "DNS pointer for the IP address" value = module.hcloud_rdns.*.dns_ptr diff --git a/examples/multiple_entries/rover.svg b/examples/multiple_entries/rover.svg index d2283d3..8f1f96d 100644 --- a/examples/multiple_entries/rover.svg +++ b/examples/multiple_entries/rover.svg @@ -1 +1 @@ -.variables.tfdata.tfmain.tfunknown fileoutputs.tfhcloud_servershcloud_rdnshcloud_rdns[0]hcloud_rdns[1]hcloud_rdns[2]outputs.tfvariables.tfmain.tfoutputs.tfvariables.tfmain.tfvariables.tfmain.tfoutputs.tfhcloud_rdnshcloud_rdnshcloud_rdnstokendefaultdns_ptrip_addressdns_ptrip_addressserver_idfloating_ip_idload_balancer_iddefaultdns_ptrip_addressfloating_ip_idload_balancer_iddns_ptrip_addressserver_iddefaultfloating_ip_idload_balancer_iddns_ptrip_addressserver_iddefaultdns_ptrip_addressdns_ptrrdns_dns_ptrrdns_ip_address \ No newline at end of file +.variables.tfdata.tfmain.tfunknown fileoutputs.tfhcloud_servershcloud_rdnshcloud_rdns[0]hcloud_rdns[1]hcloud_rdns[2]outputs.tfvariables.tfmain.tfmain.tfoutputs.tfvariables.tfoutputs.tfvariables.tfmain.tfhcloud_rdnshcloud_rdnshcloud_rdnstokendefaultip_addressdns_ptrdns_ptrip_addressserver_idfloating_ip_idload_balancer_iddefaultdefaultdns_ptrip_addressdns_ptrip_addressserver_idfloating_ip_idload_balancer_iddns_ptrip_addressdns_ptrip_addressserver_idfloating_ip_idload_balancer_iddefaultdns_ptrrdns_dns_ptrrdns_ip_addressrdns_id \ No newline at end of file diff --git a/examples/single_entry/README.md b/examples/single_entry/README.md index c7bcd3f..aee9bce 100644 --- a/examples/single_entry/README.md +++ b/examples/single_entry/README.md @@ -56,6 +56,7 @@ $ terraform apply | Name | Description | |------|-------------| | [rdns\_dns\_ptr](#output\_rdns\_dns\_ptr) | DNS pointer for the IP address | +| [rdns\_id](#output\_rdns\_id) | Unique ID of the Reverse DNS entry | | [rdns\_ip\_address](#output\_rdns\_ip\_address) | IP address | diff --git a/examples/single_entry/outputs.tf b/examples/single_entry/outputs.tf index 3874c9c..ff8b707 100644 --- a/examples/single_entry/outputs.tf +++ b/examples/single_entry/outputs.tf @@ -1,3 +1,8 @@ +output "rdns_id" { + description = "Unique ID of the Reverse DNS entry" + value = module.hcloud_rdns.id +} + output "rdns_dns_ptr" { description = "DNS pointer for the IP address" value = module.hcloud_rdns.dns_ptr diff --git a/examples/single_entry/rover.svg b/examples/single_entry/rover.svg index e26f303..00aa2fd 100644 --- a/examples/single_entry/rover.svg +++ b/examples/single_entry/rover.svg @@ -1 +1 @@ -.outputs.tfvariables.tfdata.tfmain.tfunknown filehcloud_serverhcloud_rdnsoutputs.tfvariables.tfmain.tfhcloud_rdnsrdns_ip_addressrdns_dns_ptrtokendefaultdns_ptrip_addressfloating_ip_idload_balancer_iddns_ptrip_addressserver_iddefaultdns_ptr \ No newline at end of file +.variables.tfdata.tfmain.tfunknown fileoutputs.tfhcloud_serverhcloud_rdnsoutputs.tfvariables.tfmain.tfhcloud_rdnstokendefaultip_addressdns_ptrdns_ptrip_addressserver_idfloating_ip_idload_balancer_iddefaultdns_ptrrdns_idrdns_dns_ptrrdns_ip_address \ No newline at end of file diff --git a/locals.tf b/locals.tf deleted file mode 100644 index 066066c..0000000 --- a/locals.tf +++ /dev/null @@ -1 +0,0 @@ -locals {} diff --git a/outputs.tf b/outputs.tf index 85157b7..d7881e9 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,3 +1,8 @@ +output "id" { + description = "Unique ID of the Reverse DNS entry" + value = hcloud_rdns.default.id +} + output "dns_ptr" { description = "DNS pointer for the IP address" value = hcloud_rdns.default.dns_ptr diff --git a/rover.svg b/rover.svg index 6d7fac3..e9d1a1a 100644 --- a/rover.svg +++ b/rover.svg @@ -1 +1 @@ -.outputs.tfvariables.tfmain.tfhcloud_rdnsdns_ptrip_addressip_addressserver_idfloating_ip_idload_balancer_iddns_ptrdefault \ No newline at end of file +.outputs.tfvariables.tfmain.tfhcloud_rdnsiddns_ptrip_addressfloating_ip_idload_balancer_iddns_ptrip_addressserver_iddefault \ No newline at end of file