diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2020-12-27 21:44:09 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2020-12-27 21:44:09 +0100 |
commit | b8af5cdf274a60f364d34192d4f483f4f4800282 (patch) | |
tree | f5977d9a13259da488edfebab392884cee394c39 /j2/terraform-machine.j2 | |
parent | 13d7de5dab25c830deacf335bb704aed0e2db3a7 (diff) | |
download | rules-sandbox-b8af5cdf274a60f364d34192d4f483f4f4800282.tar.gz rules-sandbox-b8af5cdf274a60f364d34192d4f483f4f4800282.tar.bz2 rules-sandbox-b8af5cdf274a60f364d34192d4f483f4f4800282.tar.xz rules-sandbox-b8af5cdf274a60f364d34192d4f483f4f4800282.zip |
Adding ansible and terraform configs.
Diffstat (limited to 'j2/terraform-machine.j2')
-rw-r--r-- | j2/terraform-machine.j2 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/j2/terraform-machine.j2 b/j2/terraform-machine.j2 new file mode 100644 index 0000000..7a00001 --- /dev/null +++ b/j2/terraform-machine.j2 @@ -0,0 +1,26 @@ +resource "scaleway_instance_server" "{{ m.key }}" { + name = "acme-1" + type = "DEV1-S" + image = "b3042271-d2b1-4f87-b407-aedd3bbd1663" + ip_id = scaleway_instance_ip.{{ m.key }}.id + enable_dynamic_ip = false + enable_ipv6 = true +} + +resource "scaleway_instance_ip" "{{ m.key }}" {} + +resource "scaleway_instance_ip_reverse_dns" "{{ m.key }}" { + ip_id = scaleway_instance_ip.{{ m.key }}.id + reverse = "{{ m.key }}.${google_dns_managed_zone.machine.dns_name}" +} + +resource "google_dns_record_set" "{{ m.key }}" { + name = "{{ m.key }}.${google_dns_managed_zone.machine.dns_name}" + managed_zone = google_dns_managed_zone.machine.name + type = "A" + ttl = 300 + + rrdatas = [scaleway_instance_ip.{{ m.key }}.public_ip] + + depends_on = [google_dns_managed_zone.ci] +} |