From e08ad869e99207462484d9c72237702efe350eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 28 May 2019 17:30:23 -0400 Subject: [PATCH] add record for host only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- main.tf | 32 ++++++++++++++++++++------------ variables.tf | 4 ++-- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/main.tf b/main.tf index ee35f66..49afee7 100644 --- a/main.tf +++ b/main.tf @@ -112,18 +112,18 @@ resource "gandi_domainattachment" "dap_ps" { /* MAIL SITE ------------------------------------*/ /* This is the main site hosted on GitHub */ -resource "gandi_zonerecord" "dap_ps_site" { - zone = "${gandi_zone.dap_ps_zone.id}" - name = "mail" - type = "TXT" - ttl = 3600 - values = [ - "185.199.108.153", - "185.199.109.153", - "185.199.110.153", - "185.199.111.153", - ] -} +//resource "gandi_zonerecord" "dap_ps_site" { +// zone = "${gandi_zone.dap_ps_zone.id}" +// name = "mail" +// type = "TXT" +// ttl = 3600 +// values = [ +// "185.199.108.153", +// "185.199.109.153", +// "185.199.110.153", +// "185.199.111.153", +// ] +//} /* RESOURCES ------------------------------------*/ @@ -152,6 +152,14 @@ resource "aws_instance" "dap_ps_dev" { } } +resource "gandi_zonerecord" "dap_ps_dev" { + zone = "${gandi_zone.dap_ps_zone.id}" + name = "${aws_instance.dap_ps_dev.tags.Name}.${var.hosts_subdomain}" + type = "A" + ttl = 3600 + values = ["${aws_instance.dap_ps_dev.public_ip}"] +} + resource "gandi_zonerecord" "main" { zone = "${gandi_zone.dap_ps_zone.id}" name = "dev" diff --git a/variables.tf b/variables.tf index 911d700..5c3fef6 100644 --- a/variables.tf +++ b/variables.tf @@ -14,9 +14,9 @@ variable gandi_api_token { /* GENERAL --------------------------------------*/ -variable hosts_domain { +variable hosts_subdomain { description = "Domain for hosts entries." - default = "hosts.dap.ps" + default = "hosts" } variable public_domain {