terraform-provider-hdns

command module
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 6 Imported by: 0

README

terraform-provider-hdns

Go Reference Go Report Card GitHub tag (latest SemVer) GitHub

A terraform provider for the Hetzner DNS API

Inspired by terraform-provider-hcloud

Usage

Get your API Token at https://dns.hetzner.com/settings/api-token

Add the provider configuration to your terraform.tf

terraform {
  required_providers {
    hdns = {
      source = "danielr1996/hdns"
      version = "1.0.2"
    }
  }
}

Add a provider block for hdns and add your token

provider "hdns" {
  token = "<api-token>"
}

Add a data block to retrieve the zone id from its name

data "hdns_zone" "zone" {
  name = "example.com"
}

Add a resource block for a dns record with the zone_id from the previous data block

resource "hdns_record" "record" {
  zone_id = data.hdns_zone.zone.id
  type = "A"
  name = "record.example.com"
  value = "1.2.3.4"
}
Full example
terraform {
  required_providers {
    hdns = {
      source = "danielr1996/hdns"
      version = "1.0.2"
    }
  }
}

provider "hdns" {
  token = "<api-token>"
}

data "hdns_zone" "zone" {
  name = "example.com"
}

resource "hdns_record" "sample" {
  zone_id = data.hdns_zone.zone.id
  type = "A"
  name = "record.example.com"
  value = "1.2.3.4"
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL