Browse Source

Merge pull request #41 from mdr-engineering/feature/bp_MSOCI-1386_portal_domain

Adds Portal DNS
Brad Poulton 5 years ago
parent
commit
e34b0840a9
2 changed files with 17 additions and 0 deletions
  1. 12 0
      base/dns/legacy_dns_entries/main.tf
  2. 5 0
      base/dns/legacy_dns_entries/vars.tf

+ 12 - 0
base/dns/legacy_dns_entries/main.tf

@@ -42,3 +42,15 @@ resource "aws_route53_record" "public" {
   records = [ each.value ]
   provider = aws.mdr-common-services-commercial
 }
+
+# Public cname
+resource "aws_route53_record" "public_cname" {
+  for_each = var.legacy_public_cname_dns
+
+  name = each.key
+  type = "CNAME"
+  ttl  = 300
+  zone_id = var.dns_info["public"]["zone_id"]
+  records = [ each.value ]
+  provider = aws.mdr-common-services-commercial
+}

+ 5 - 0
base/dns/legacy_dns_entries/vars.tf

@@ -8,6 +8,11 @@ variable legacy_public_dns {
   type = map 
 }
 
+variable legacy_public_cname_dns { 
+  description = "A map of legacy hostnames to lists of dns entries. To disable, just remove an entry."
+  type = map 
+}
+
 # inherited variables
 variable tags { type = map }
 variable dns_info { type = map }