Browse Source

Each partition.hcl and region.hcl are unique instead of symbolic links

Fred Damstra 5 năm trước cách đây
mục cha
commit
f17123f9c2

+ 0 - 1
prod/aws-us-gov/partition.hcl

@@ -1 +0,0 @@
-../../common/aws-us-gov/partition.hcl

+ 57 - 0
prod/aws-us-gov/partition.hcl

@@ -0,0 +1,57 @@
+# Set common variables for the environment. This is automatically pulled in in the root terragrunt.hcl configuration to
+# feed forward to the child modules.
+# 
+# NOTE: There is only one copy of this, in the `common/` tree, and the others are symbolic links.
+locals {
+  aws_partition = "aws-us-gov"
+  aws_partition_alias = "govcloud"
+  common_services_account = "701290387780"
+  common_profile = "${local.aws_partition == "aws-us-gov" ? "govcloud" : "commercial"}"
+
+  # Statically setting the 'last known good' ami gives us some added flexibility
+  # in building amis more regularly.
+  #
+  # Don't forget `lifecycle { ignore_changes = ["ami"] }` in yoru ec2
+  # builds!
+  amis = {
+    "rhel7-base"        = "ami-0b08c1f5f1c84d2e9"
+    "rhel7-master"      = "ami-0ceacf267454aba51"
+    "rhel7-minion"      = "ami-08505f005a686f476"
+    "ubuntu1804-base"   = "ami-0a84bd4b796860be8"
+    "ubuntu1804-minion" = "TBD"
+  }
+  default_ami = local.amis["rhel7-minion"] # Allows us to easily change to a new base standard
+
+  # If you need the raw list of all accounts, see `account_list` below
+  account_map = {
+    "prod" = [
+      "721817724804", # mdr-prod-c2
+      "738736370544", # mdr-prod-modelclient
+      "876865127438", # mdr-prod-malware
+    ],
+    "test" = [
+      "738800754746", # mdr-test-c2
+      "701341250728", # mdr-test-modelclient
+      "876942499057", # mdr-test-malware
+    ],
+    "common" = [
+      "701290387780", # mdr-common-services
+    ],
+  }
+  # flatten the map into a single list
+  account_list = flatten([
+    for env, accounts in local.account_map: accounts
+  ])
+  # This is similar to the account_map, but used for "what accounts am I responsible for"?
+  responsible_accounts = {
+    "prod"   = concat(local.account_map["prod"], local.account_map["common"]),
+    "test"   = local.account_map["test"],
+    "common" = concat(local.account_map["prod"], local.account_map["common"], local.account_map["test"]),
+  }
+
+  aws_marketplace_ubuntu_owner_id = "874634375141"
+
+  partition_tags = {
+    aws_partition = local.aws_partition
+  }
+}

+ 0 - 1
prod/aws-us-gov/region.hcl

@@ -1 +0,0 @@
-../../common/aws-us-gov/region.hcl

+ 10 - 0
prod/aws-us-gov/region.hcl

@@ -0,0 +1,10 @@
+# Set common variables for the region. This is automatically pulled in in the root terragrunt.hcl configuration to
+# feed forward to the child modules.
+#
+# NOTE: There is only one copy of this, in the `common/` tree, and the others are symbolic links.
+# 
+# At some point, this may need to be added as a hierarchical directory when we move to additional regions.
+locals {
+  aws_region = "us-gov-east-1"
+  region_tags = { }
+}

+ 0 - 1
prod/aws/partition.hcl

@@ -1 +0,0 @@
-../../common/aws/partition.hcl

+ 63 - 0
prod/aws/partition.hcl

@@ -0,0 +1,63 @@
+# Set common variables for the environment. This is automatically pulled in in the root terragrunt.hcl configuration to
+# feed forward to the child modules.
+#
+# NOTE: There is only one copy of this, in the `common/` tree, and the others are symbolic links.
+locals {
+  aws_partition = "aws"
+  aws_partition_alias = "commercial"
+  common_services_account = "471284459109"
+  common_profile = "${local.aws_partition == "aws-us-gov" ? "govcloud" : "commercial"}"
+
+  # Statically setting the 'last known good' ami gives us some added flexibility
+  # in building amis more regularly.
+  #
+  # Don't forget `lifecycle { ignore_changes = ["ami"] }` in yoru ec2
+  # builds!
+  amis = {
+    "rhel7-base"        = "ami-0de46d7d1a164b307"
+    "rhel7-master"      = "ami-0114330666839f2b9"
+    "rhel7-minion"      = "ami-0425efbff72b3c702"
+    "ubuntu1804-base"   = "TBD"
+    "ubuntu1804-minion" = "TBD"
+  }
+  default_ami = local.amis["rhel7-minion"] # Allows us to easily change to a new base standard
+
+  # If you need the raw list of all accounts, see `account_list` below
+  account_map = {
+    "prod" = [
+      "477548533976", # Legacy MDR Prod
+      "045312110490", # mdr-prod-c2
+      "425831147305", # mdr-prod-modelclient
+      "369723129071", # mdr-prod-malware
+    ],
+    "test" = [
+      "527700175026", # Legacy MDR Test
+      "816914342178", # mdr-test-c2
+      "449047653882", # mdr-test-modelclient
+      "404265901253", # mdr-test-malware
+    ],
+    "common" = [
+      "471284459109", # mdr-common-services
+      "350838957895", # MDR Service Root
+      "035764279020", # MDR Playground / "Duane Test"
+      "228011623757", # mdr-dev-ai
+      "952430311316", # mdr-cyber-range
+    ],
+  }
+  # flatten the map into a single list
+  account_list = flatten([
+    for env, accounts in local.account_map: accounts
+  ])
+  # This is similar to the account_map, but used for "what accounts am I responsible for"?
+  responsible_accounts = {
+    "prod"   = concat(local.account_map["prod"], local.account_map["common"]),
+    "test"   = local.account_map["test"],
+    "common" = concat(local.account_map["prod"], local.account_map["common"], local.account_map["test"]),
+  }
+
+  aws_marketplace_ubuntu_owner_id = "679593333241"
+
+  partition_tags = {
+    aws_partition = local.aws_partition
+  }
+}

+ 0 - 1
prod/aws/region.hcl

@@ -1 +0,0 @@
-../../common/aws/region.hcl

+ 10 - 0
prod/aws/region.hcl

@@ -0,0 +1,10 @@
+# Set common variables for the region. This is automatically pulled in in the root terragrunt.hcl configuration to
+# feed forward to the child modules.
+#
+# NOTE: There is only one copy of this, in the `common/` tree, and the others are symbolic links.
+# 
+# At some point, this may need to be added as a hierarchical directory when we move to additional regions.
+locals {
+  aws_region = "us-east-1"
+  region_tags = { }
+}

+ 0 - 1
test/aws-us-gov/partition.hcl

@@ -1 +0,0 @@
-../../common/aws-us-gov/partition.hcl

+ 57 - 0
test/aws-us-gov/partition.hcl

@@ -0,0 +1,57 @@
+# Set common variables for the environment. This is automatically pulled in in the root terragrunt.hcl configuration to
+# feed forward to the child modules.
+# 
+# NOTE: There is only one copy of this, in the `common/` tree, and the others are symbolic links.
+locals {
+  aws_partition = "aws-us-gov"
+  aws_partition_alias = "govcloud"
+  common_services_account = "701290387780"
+  common_profile = "${local.aws_partition == "aws-us-gov" ? "govcloud" : "commercial"}"
+
+  # Statically setting the 'last known good' ami gives us some added flexibility
+  # in building amis more regularly.
+  #
+  # Don't forget `lifecycle { ignore_changes = ["ami"] }` in yoru ec2
+  # builds!
+  amis = {
+    "rhel7-base"        = "ami-0b08c1f5f1c84d2e9"
+    "rhel7-master"      = "ami-0ceacf267454aba51"
+    "rhel7-minion"      = "ami-08505f005a686f476"
+    "ubuntu1804-base"   = "ami-0a84bd4b796860be8"
+    "ubuntu1804-minion" = "TBD"
+  }
+  default_ami = local.amis["rhel7-minion"] # Allows us to easily change to a new base standard
+
+  # If you need the raw list of all accounts, see `account_list` below
+  account_map = {
+    "prod" = [
+      "721817724804", # mdr-prod-c2
+      "738736370544", # mdr-prod-modelclient
+      "876865127438", # mdr-prod-malware
+    ],
+    "test" = [
+      "738800754746", # mdr-test-c2
+      "701341250728", # mdr-test-modelclient
+      "876942499057", # mdr-test-malware
+    ],
+    "common" = [
+      "701290387780", # mdr-common-services
+    ],
+  }
+  # flatten the map into a single list
+  account_list = flatten([
+    for env, accounts in local.account_map: accounts
+  ])
+  # This is similar to the account_map, but used for "what accounts am I responsible for"?
+  responsible_accounts = {
+    "prod"   = concat(local.account_map["prod"], local.account_map["common"]),
+    "test"   = local.account_map["test"],
+    "common" = concat(local.account_map["prod"], local.account_map["common"], local.account_map["test"]),
+  }
+
+  aws_marketplace_ubuntu_owner_id = "874634375141"
+
+  partition_tags = {
+    aws_partition = local.aws_partition
+  }
+}

+ 0 - 1
test/aws-us-gov/region.hcl

@@ -1 +0,0 @@
-../../common/aws-us-gov/region.hcl

+ 10 - 0
test/aws-us-gov/region.hcl

@@ -0,0 +1,10 @@
+# Set common variables for the region. This is automatically pulled in in the root terragrunt.hcl configuration to
+# feed forward to the child modules.
+#
+# NOTE: There is only one copy of this, in the `common/` tree, and the others are symbolic links.
+# 
+# At some point, this may need to be added as a hierarchical directory when we move to additional regions.
+locals {
+  aws_region = "us-gov-east-1"
+  region_tags = { }
+}

+ 0 - 1
test/aws/partition.hcl

@@ -1 +0,0 @@
-../../common/aws/partition.hcl

+ 63 - 0
test/aws/partition.hcl

@@ -0,0 +1,63 @@
+# Set common variables for the environment. This is automatically pulled in in the root terragrunt.hcl configuration to
+# feed forward to the child modules.
+#
+# NOTE: There is only one copy of this, in the `common/` tree, and the others are symbolic links.
+locals {
+  aws_partition = "aws"
+  aws_partition_alias = "commercial"
+  common_services_account = "471284459109"
+  common_profile = "${local.aws_partition == "aws-us-gov" ? "govcloud" : "commercial"}"
+
+  # Statically setting the 'last known good' ami gives us some added flexibility
+  # in building amis more regularly.
+  #
+  # Don't forget `lifecycle { ignore_changes = ["ami"] }` in yoru ec2
+  # builds!
+  amis = {
+    "rhel7-base"        = "ami-0de46d7d1a164b307"
+    "rhel7-master"      = "ami-0114330666839f2b9"
+    "rhel7-minion"      = "ami-0425efbff72b3c702"
+    "ubuntu1804-base"   = "TBD"
+    "ubuntu1804-minion" = "TBD"
+  }
+  default_ami = local.amis["rhel7-minion"] # Allows us to easily change to a new base standard
+
+  # If you need the raw list of all accounts, see `account_list` below
+  account_map = {
+    "prod" = [
+      "477548533976", # Legacy MDR Prod
+      "045312110490", # mdr-prod-c2
+      "425831147305", # mdr-prod-modelclient
+      "369723129071", # mdr-prod-malware
+    ],
+    "test" = [
+      "527700175026", # Legacy MDR Test
+      "816914342178", # mdr-test-c2
+      "449047653882", # mdr-test-modelclient
+      "404265901253", # mdr-test-malware
+    ],
+    "common" = [
+      "471284459109", # mdr-common-services
+      "350838957895", # MDR Service Root
+      "035764279020", # MDR Playground / "Duane Test"
+      "228011623757", # mdr-dev-ai
+      "952430311316", # mdr-cyber-range
+    ],
+  }
+  # flatten the map into a single list
+  account_list = flatten([
+    for env, accounts in local.account_map: accounts
+  ])
+  # This is similar to the account_map, but used for "what accounts am I responsible for"?
+  responsible_accounts = {
+    "prod"   = concat(local.account_map["prod"], local.account_map["common"]),
+    "test"   = local.account_map["test"],
+    "common" = concat(local.account_map["prod"], local.account_map["common"], local.account_map["test"]),
+  }
+
+  aws_marketplace_ubuntu_owner_id = "679593333241"
+
+  partition_tags = {
+    aws_partition = local.aws_partition
+  }
+}

+ 0 - 1
test/aws/region.hcl

@@ -1 +0,0 @@
-../../common/aws/region.hcl

+ 10 - 0
test/aws/region.hcl

@@ -0,0 +1,10 @@
+# Set common variables for the region. This is automatically pulled in in the root terragrunt.hcl configuration to
+# feed forward to the child modules.
+#
+# NOTE: There is only one copy of this, in the `common/` tree, and the others are symbolic links.
+# 
+# At some point, this may need to be added as a hierarchical directory when we move to additional regions.
+locals {
+  aws_region = "us-east-1"
+  region_tags = { }
+}