summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2021-01-08 10:20:43 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2021-01-08 10:24:37 +0100
commit26769b6059e299103e2ee5427ac71b30533c204f (patch)
tree8621901931487053370f7029db5d2729dbf835d4
parent3d25f7059f518dd8c857dd5e45552ba3ab733aa6 (diff)
downloadrules-sandbox-26769b6059e299103e2ee5427ac71b30533c204f.tar.gz
rules-sandbox-26769b6059e299103e2ee5427ac71b30533c204f.tar.bz2
rules-sandbox-26769b6059e299103e2ee5427ac71b30533c204f.tar.xz
rules-sandbox-26769b6059e299103e2ee5427ac71b30533c204f.zip
Working terraform setup.
-rw-r--r--acme-apps/terraform/scaleway-machine-acme-1.tf12
-rw-r--r--acme-apps/terraform/scaleway-machine-acme-2.tf12
-rw-r--r--acme-apps/terraform/scaleway-machine-acme-3.tf12
-rw-r--r--j2/terraform-machine.j212
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
+}