Skip to content

Commit

Permalink
feat: Manage the following Terraform resource
Browse files Browse the repository at this point in the history
* hcloud_rdns
  • Loading branch information
dhoppe committed Jan 14, 2022
1 parent 6568255 commit af0c32d
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
repository:
name: terraform-child-module
description: Terraform module to manage the Terraform Cloud/Enterprise resource (tfe_FIXME)
homepage: https://registry.terraform.io/modules/dhoppeIT/FIXME/tfe/latest
topics: terraform, tfe, FIXME
private: true
name: terraform-hcloud-rdns
description: Terraform module to manage the Hetzner Cloud resource (hcloud_rdns)
homepage: https://registry.terraform.io/modules/dhoppeIT/rdns/hcloud/latest
topics: terraform, hcloud, rdns
private: false
has_issues: true
has_projects: false
has_wiki: false
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.1.0
- name: Terraform Format
run: terraform fmt -check -diff
- name: Terraform Init
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [2021] Dennis Hoppe
Copyright [2022] Dennis Hoppe

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# FIXME
# terraform-hcloud-rdns

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

## Graph

![Graph](https://github.com/dhoppeIT/FIXME/blob/main/rover.png)
![Graph](https://github.com/dhoppeIT/terraform-hcloud-rdns/blob/main/rover.png)

## Usage

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

```hcl
module "FIXME" {
source = "dhoppeIT/FIXME/tfe"
...
module "hcloud-rdns" {
source = "dhoppeIT/rdns/hcloud"
server_id = 17273771
ip_address = "10.0.0.2"
dns_ptr = "debian.dhoppe.it"
}
```

Expand All @@ -26,4 +29,4 @@ Created and maintained by [Dennis Hoppe](https://github.com/dhoppeIT/).

## License

Apache 2 licensed. See [LICENSE](https://github.com/dhoppeIT/FIXME/blob/main/LICENSE) for full details.
Apache 2 licensed. See [LICENSE](https://github.com/dhoppeIT/terraform-hcloud-rdns/blob/main/LICENSE) for full details.
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "hcloud_rdns" "default" {
dns_ptr = var.dns_ptr
ip_address = var.ip_address
server_id = var.server_id
floating_ip_id = var.floating_ip_id
load_balancer_id = var.load_balancer_id
}
9 changes: 9 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
output "dns_ptr" {
description = "DNS pointer for the IP address"
value = hcloud_rdns.default.dns_ptr
}

output "ip_address" {
description = " IP address"
value = hcloud_rdns.default.ip_address
}
Binary file added rover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
variable "dns_ptr" {
type = string
description = "The DNS address the ip_address should resolve to"
}

variable "ip_address" {
type = string
description = "The IP address that should point to dns_ptr"
}

variable "server_id" {
type = number
default = null
description = "The server the ip_address belongs to"
}

variable "floating_ip_id" {
type = number
default = null
description = "The Floating IP the ip_address belongs to"
}

variable "load_balancer_id" {
type = number
default = null
description = "The Load Balancer the ip_address belongs to"
}
7 changes: 6 additions & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
terraform {
required_providers {}
required_providers {
hcloud = {
source = "hetznercloud/hcloud"
version = ">= 1.0.0, < 2.0.0"
}
}

required_version = ">= 1.0"
}

0 comments on commit af0c32d

Please sign in to comment.