Skip to content

Instantly share code, notes, and snippets.

@pathcl
Last active July 26, 2019 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pathcl/fab5911e7aea0a41ff2e9928377ea266 to your computer and use it in GitHub Desktop.
Save pathcl/fab5911e7aea0a41ff2e9928377ea266 to your computer and use it in GitHub Desktop.
Dns && terraform
// Configure the DNS Provider
// dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 256 -n HOST domain.tld.
provider "dns" {
update {
server = "192.168.0.1"
key_name = "domain.tld."
key_algorithm = "hmac-md5"
key_secret = "yoursecrethere"
}
}
resource "dns_a_record_set" "elastic" {
count = "${length(module.elastic.vm)}"
zone = "domain.tld."
name = module.elastic.vm[count.index].name
addresses = [module.elastic.vm[count.index].default_ip_address]
ttl = 30
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment