From 26769b6059e299103e2ee5427ac71b30533c204f Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 8 Jan 2021 10:20:43 +0100 Subject: Working terraform setup. --- acme-apps/terraform/scaleway-machine-acme-1.tf | 12 ++++++++---- acme-apps/terraform/scaleway-machine-acme-2.tf | 12 ++++++++---- acme-apps/terraform/scaleway-machine-acme-3.tf | 12 ++++++++---- j2/terraform-machine.j2 | 12 ++++++++---- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/acme-apps/terraform/scaleway-machine-acme-1.tf b/acme-apps/terraform/scaleway-machine-acme-1.tf index 8100533..46fc0dd 100644 --- a/acme-apps/terraform/scaleway-machine-acme-1.tf +++ b/acme-apps/terraform/scaleway-machine-acme-1.tf @@ -9,7 +9,11 @@ resource "scaleway_instance_server" "acme-1" { resource "scaleway_instance_ip" "acme-1" {} -#resource "scaleway_instance_ip_reverse_dns" "acme-1" { -# ip_id = scaleway_instance_ip.acme-1.id -# reverse = "acme-1.${google_dns_managed_zone.machine.dns_name}" -#} +resource "scaleway_instance_ip_reverse_dns" "acme-1" { + ip_id = scaleway_instance_ip.acme-1.id + reverse = "acme-1.machine.acme.com." +} + +output "acme-1_public_ip" { + value = scaleway_instance_server.acme-1.public_ip +} diff --git a/acme-apps/terraform/scaleway-machine-acme-2.tf b/acme-apps/terraform/scaleway-machine-acme-2.tf index 07d5e8b..aa9387e 100644 --- a/acme-apps/terraform/scaleway-machine-acme-2.tf +++ b/acme-apps/terraform/scaleway-machine-acme-2.tf @@ -9,7 +9,11 @@ resource "scaleway_instance_server" "acme-2" { resource "scaleway_instance_ip" "acme-2" {} -#resource "scaleway_instance_ip_reverse_dns" "acme-2" { -# ip_id = scaleway_instance_ip.acme-2.id -# reverse = "acme-2.${google_dns_managed_zone.machine.dns_name}" -#} +resource "scaleway_instance_ip_reverse_dns" "acme-2" { + ip_id = scaleway_instance_ip.acme-2.id + reverse = "acme-2.machine.acme.com." +} + +output "acme-2_public_ip" { + value = scaleway_instance_server.acme-2.public_ip +} diff --git a/acme-apps/terraform/scaleway-machine-acme-3.tf b/acme-apps/terraform/scaleway-machine-acme-3.tf index a2246bc..61971ab 100644 --- a/acme-apps/terraform/scaleway-machine-acme-3.tf +++ b/acme-apps/terraform/scaleway-machine-acme-3.tf @@ -9,7 +9,11 @@ resource "scaleway_instance_server" "acme-3" { resource "scaleway_instance_ip" "acme-3" {} -#resource "scaleway_instance_ip_reverse_dns" "acme-3" { -# ip_id = scaleway_instance_ip.acme-3.id -# reverse = "acme-3.${google_dns_managed_zone.machine.dns_name}" -#} +resource "scaleway_instance_ip_reverse_dns" "acme-3" { + ip_id = scaleway_instance_ip.acme-3.id + reverse = "acme-3.machine.acme.com." +} + +output "acme-3_public_ip" { + value = scaleway_instance_server.acme-3.public_ip +} diff --git a/j2/terraform-machine.j2 b/j2/terraform-machine.j2 index 95a28eb..c83bc48 100644 --- a/j2/terraform-machine.j2 +++ b/j2/terraform-machine.j2 @@ -9,7 +9,11 @@ resource "scaleway_instance_server" "{{ scw.key }}" { resource "scaleway_instance_ip" "{{ scw.key }}" {} -#resource "scaleway_instance_ip_reverse_dns" "{{ scw.key }}" { -# ip_id = scaleway_instance_ip.{{ scw.key }}.id -# reverse = "{{ scw.key }}.${google_dns_managed_zone.machine.dns_name}" -#} +resource "scaleway_instance_ip_reverse_dns" "{{ scw.key }}" { + ip_id = scaleway_instance_ip.{{ scw.key }}.id + reverse = "{{ m.fqdn }}" +} + +output "{{scw.key}}_public_ip" { + value = scaleway_instance_server.{{ scw.key }}.public_ip +} -- cgit v1.2.3