Skip to content

Commit

Permalink
start using oci_dns_rrset
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Oehrli committed Oct 27, 2020
1 parent c294a0f commit a3d1a1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@
# ---------------------------------------------------------------------------

# update DNS
resource "oci_dns_record" "bastion" {
resource "oci_dns_rrset" "bastion" {
count = var.bastion_enabled == true && var.bastion_dns_registration == true ? var.tvd_participants : 0
zone_name_or_id = var.tvd_domain
domain = join(".", [oci_core_instance.bastion.*.hostname_label[count.index], var.tvd_domain])
rtype = "A"
rdata = oci_core_instance.bastion.*.public_ip[count.index]
ttl = 30
items {
domain = join(".", [oci_core_instance.bastion.*.hostname_label[count.index], var.tvd_domain])
rtype = "A"
rdata = oci_core_instance.bastion.*.public_ip[count.index]
ttl = 30
}

}
# --- EOF -------------------------------------------------------------------
# --- EOF -------------------------------------------------------------------
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ output "bastion_private_ip" {

output "bastion_dns_records" {
description = "The DNS records for the bastion server instances."
value = [oci_dns_record.bastion.*.rdata]
value = [oci_dns_rrset.bastion.*.rdata]
}
# --- EOF -------------------------------------------------------------------

0 comments on commit a3d1a1e

Please sign in to comment.