-
Notifications
You must be signed in to change notification settings - Fork 2
/
dns.tf
44 lines (41 loc) · 1.78 KB
/
dns.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# ------------------------------------------------------------------------------
# Trivadis - Part of Accenture, Platform Factory - Data Platforms
# Saegereistrasse 29, 8152 Glattbrugg, Switzerland
# ------------------------------------------------------------------------------
# Name.......: dns.tf
# Author.....: Stefan Oehrli (oes) [email protected]
# Editor.....: Stefan Oehrli
# Date.......: 2023.04.19
# Revision...:
# Purpose....: DNS registration for bastion jost.
# Notes......: --
# Reference..: --
# License....: Apache License Version 2.0, January 2004 as shown
# at http://www.apache.org/licenses/
# ------------------------------------------------------------------------------
# update DNS
resource "oci_dns_rrset" "bastion" {
count = var.bastion_enabled == true && local.dns_registration == true ? var.numberOf_labs : 0
zone_name_or_id = var.lab_domain
domain = join(".", [oci_core_instance.bastion[count.index].hostname_label, var.lab_domain])
rtype = "A"
items {
domain = join(".", [oci_core_instance.bastion[count.index].hostname_label, var.lab_domain])
rtype = "A"
rdata = oci_core_instance.bastion[count.index].public_ip
ttl = 30
}
}
resource "oci_dns_rrset" "webhost" {
count = var.bastion_enabled == true && local.dns_registration == true && var.webhost_name != "" ? var.numberOf_labs : 0
zone_name_or_id = var.lab_domain
domain = join(".", [var.webhost_name, var.lab_domain])
rtype = "A"
items {
domain = join(".", [var.webhost_name, var.lab_domain])
rtype = "A"
rdata = oci_core_instance.bastion[0].public_ip
ttl = 30
}
}
# --- EOF ----------------------------------------------------------------------