Procházet zdrojové kódy

Merge pull request #307 from mdr-engineering/feature/ftd_MSOCI-1276_DeployDNSServerInVMRayVPC

Updates the DNS Server Instance to Allow for more dynamic hostnames
Frederick Damstra před 3 roky
rodič
revize
6495bcc01e

+ 2 - 2
base/dns/resolver_instance/main.tf

@@ -1,5 +1,5 @@
 locals {
-  instance_name = "resolver-${var.aws_partition_alias}-${var.instance_number}"
+  instance_name = "${var.instance_prefix}-${var.instance_number}"
 }
 
 # Rather than pass in the aws security group, we just look it up. This will
@@ -94,7 +94,7 @@ data "template_cloudinit_config" "cloud-init" {
     content      = templatefile("${path.module}/cloud-init/cloud-init.tpl",
       {
         hostname = local.instance_name
-        fqdn = "resolver-${var.aws_partition_alias}-${var.instance_number}.${var.dns_info["private"]["zone"]}"
+        fqdn = "${local.instance_name}.${var.dns_info["private"]["zone"]}"
         environment = var.environment
         # can't use the DNS name like we would most places, because this is the DNS server
         saltmaster  = var.salt_master_ip

+ 6 - 0
base/dns/resolver_instance/vars.tf

@@ -1,3 +1,9 @@
+variable "instance_prefix" {
+  type = string
+  description = "Prefix for instance names."
+  default = "resolver-govcloud"
+}
+
 variable "instance_number" {
   type = number
   default = 1