浏览代码

Creates legacy DNS entries for ease of transition.

Fred Damstra 5 年之前
父节点
当前提交
31f192681f

+ 34 - 0
prod/aws/legacy-mdr-prod/026-legacy-dns-entries/terragrunt.hcl

@@ -0,0 +1,34 @@
+locals {
+  # If you want to use any of the variables in _this_ file, you have to load them here.
+  # However, they will all be available as inputs to the module loaded in terraform.source
+  # below.
+
+  # e.g. inherited variables:
+  environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
+  partition_vars = read_terragrunt_config(find_in_parent_folders("partition.hcl"))
+  region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
+  account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
+  global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
+}
+
+# Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
+# working directory, into a temporary folder, and execute your Terraform commands in that folder.
+terraform {
+  # Double slash is intentional and required to show root of modules
+  source = "git@github.mdr.defpoint.com:mdr-engineering/xdr-terraform-modules.git//base/dns/legacy_dns_entries?ref=v0.5.12"
+}
+
+# Include all settings from the root terragrunt.hcl file
+include {
+  path = find_in_parent_folders()
+}
+
+# These are the variables we have to pass in to use the module specified in the terragrunt source above
+inputs = {
+  # All of the inputs from the inherited hcl files are available automatically
+  # (via the `inputs` section of the root `terragrunt.hcl`). However, modules
+  # will be more flexible if you specify particular input values.
+  tags = {
+    Terraform = "aws/${basename(get_parent_terragrunt_dir())}/${path_relative_to_include()}/"
+  }
+}

+ 31 - 0
prod/env.hcl

@@ -48,4 +48,35 @@ locals {
     "id" = "Z2HYR9YEZ4KLDE"
     "name" = "mdr.defpoint.com"
   }
+
+  # Provide some legacy DNS entries so that systems we build
+  # don't have to be rebuilt when we migrate the supporting systems.
+  # Idea here is just to build entries for those systems we need during
+  # the transition.
+  #
+  # When you migrate one of the systems below:
+  # 1) Remove the entry from this list.
+  # 2) Reapply the legacy-mdr-*/026-legacy-dns-entries module.
+  # 3) Create a new entry in the module with which you're creating the new instance.
+  legacy_private_dns = {
+    #"jira-server" = "10.80.101.250",
+    "mailrelay" = "10.80.1.107",
+    #"openvpn" = "10.100.0.129",
+    #"phantom" = "10.80.101.221",
+    "proxy" = "10.80.101.166",
+    "reposerver" = "10.80.101.197",
+    "sensu" = "10.80.101.230",
+    #"splunk-mc" = "10.80.1.27",
+    #"vault-1" = "10.80.1.134",
+    #"vault-2" = "10.80.2.236",
+    #"vault-3" = "10.80.3.61",
+    "salt-master" = "10.80.101.170",
+  }
+  legacy_public_dns = {
+    "bastion" = "18.233.216.6",
+    "proxy" = "35.153.103.164",
+    "reposerver" = "18.234.16.205",
+    "salt-master" = "52.5.165.105",
+    "sensu" = "52.6.95.246",
+  }
 }

+ 34 - 0
test/aws/legacy-mdr-test/026-legacy-dns-entries/terragrunt.hcl

@@ -0,0 +1,34 @@
+locals {
+  # If you want to use any of the variables in _this_ file, you have to load them here.
+  # However, they will all be available as inputs to the module loaded in terraform.source
+  # below.
+
+  # e.g. inherited variables:
+  environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
+  partition_vars = read_terragrunt_config(find_in_parent_folders("partition.hcl"))
+  region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
+  account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
+  global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
+}
+
+# Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
+# working directory, into a temporary folder, and execute your Terraform commands in that folder.
+terraform {
+  # Double slash is intentional and required to show root of modules
+  source = "git@github.mdr.defpoint.com:mdr-engineering/xdr-terraform-modules.git//base/dns/legacy_dns_entries?ref=v0.5.12"
+}
+
+# Include all settings from the root terragrunt.hcl file
+include {
+  path = find_in_parent_folders()
+}
+
+# These are the variables we have to pass in to use the module specified in the terragrunt source above
+inputs = {
+  # All of the inputs from the inherited hcl files are available automatically
+  # (via the `inputs` section of the root `terragrunt.hcl`). However, modules
+  # will be more flexible if you specify particular input values.
+  tags = {
+    Terraform = "aws/${basename(get_parent_terragrunt_dir())}/${path_relative_to_include()}/"
+  }
+}

+ 36 - 0
test/env.hcl

@@ -48,4 +48,40 @@ locals {
     "name" = "mdr-test.defpoint.com"
   }
 
+  # Provide some legacy DNS entries so that systems we build
+  # don't have to be rebuilt when we migrate the supporting systems.
+  # Idea here is just to build entries for those systems we need during
+  # the transition.
+  #
+  # When you migrate one of the systems below:
+  # 1) Remove the entry from this list.
+  # 2) Reapply the legacy-mdr-*/026-legacy-dns-entries module.
+  # 3) Create a new entry in the module with which you're creating the new instance.
+  legacy_private_dns = {
+    #"moose-splunk-cm" = "10.96.101.87",
+    #"moose-splunk-hf" = "10.96.101.75",
+    #"moose-splunk-sh" = "10.96.101.59",
+    #"clu" = "10.96.101.122",
+    #"fm-shared-search" = "10.96.1.39",
+    #"ghe-backup" = "10.96.101.71",
+    "mailrelay" = "10.96.1.160",
+    #"openvpn" = "10.96.101.249",
+    #"phantom" = "10.96.101.186",
+    "proxy" = "10.96.101.188",
+    "reposerver" = "10.96.101.160",
+    "sensu" = "10.96.101.43",
+    #"splunk-mc" = "10.96.1.133",
+    #"vault-1" = "10.96.1.38",
+    #"vault-2" = "10.96.2.63",
+    #"vault-3" = "10.96.3.88",
+    "salt-master" = "10.96.101.161",
+  }
+  # not many public entries, as the use of saml negates their usefulness
+  legacy_public_dns = {
+    "bastion" = "34.237.123.128",
+    "proxy" = "18.214.39.158",
+    "reposerver" = "34.202.16.40",
+    "salt-master" = "18.233.43.236",
+    "sensu" = "34.235.81.176"
+  }
 }