Jelajahi Sumber

GitHub Enterprise to Govcloud

Set instances to 0 in test to save a little cash, unless
somebody feels like configuring it.
Fred Damstra 4 tahun lalu
induk
melakukan
e8d424ff76

+ 1 - 0
prod/aws-us-gov/mdr-prod-c2/090-instance-github/.tfswitch.toml

@@ -0,0 +1 @@
+../../../../.tfswitch.toml

+ 1 - 0
prod/aws-us-gov/mdr-prod-c2/090-instance-github/README.md

@@ -0,0 +1 @@
+# Github

+ 44 - 0
prod/aws-us-gov/mdr-prod-c2/090-instance-github/terragrunt.hcl

@@ -0,0 +1,44 @@
+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.
+  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/github?ref=v1.20.10"
+}
+
+dependency "vpc" {
+  config_path = "../010-vpc-public"
+}
+
+# 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 = {
+    Purpose = "GitHub Enterprise"
+    Terraform = "aws/${basename(get_parent_terragrunt_dir())}/${path_relative_to_include()}/"
+    Schedule  = "none"
+  }
+  instance_type = local.account_vars.locals.instance_types["github"]
+  instance_count = local.account_vars.locals.github_instance_count
+  vpc_id = dependency.vpc.outputs.vpc_id
+  azs = dependency.vpc.outputs.azs
+  public_subnets = dependency.vpc.outputs.public_subnets
+  private_subnets = dependency.vpc.outputs.private_subnets
+}

+ 5 - 0
prod/aws-us-gov/mdr-prod-c2/account.hcl

@@ -146,11 +146,16 @@ locals {
     "splunk-hf"      = "m5a.xlarge",
     "splunk-sh"      = "m5a.4xlarge",
     "qcompliance"    = "c5a.8xlarge", # legacy: c4.8xlarge
+    "github"         = "c5a.4xlarge", # legacy: c4.4xlarge in prod, c5.2xlarge in test
   }
 
   # Bastion
   bastion_instance_type = "t3a.micro"
 
+  # GitHub
+  github_instance_count = 1
+  github_data_volume_size = 500
+
   # Salt Master
   salt_master_instance_type = "t3a.xlarge"
 

+ 1 - 0
test/aws-us-gov/mdr-test-c2/090-instance-github/.tfswitch.toml

@@ -0,0 +1 @@
+../../../../.tfswitch.toml

+ 1 - 0
test/aws-us-gov/mdr-test-c2/090-instance-github/README.md

@@ -0,0 +1 @@
+# Github

+ 44 - 0
test/aws-us-gov/mdr-test-c2/090-instance-github/terragrunt.hcl

@@ -0,0 +1,44 @@
+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.
+  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/github?ref=v1.20.10"
+}
+
+dependency "vpc" {
+  config_path = "../010-vpc-public"
+}
+
+# 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 = {
+    Purpose = "GitHub Enterprise"
+    Terraform = "aws/${basename(get_parent_terragrunt_dir())}/${path_relative_to_include()}/"
+    Schedule  = "none"
+  }
+  instance_type = local.account_vars.locals.instance_types["github"]
+  instance_count = local.account_vars.locals.github_instance_count
+  vpc_id = dependency.vpc.outputs.vpc_id
+  azs = dependency.vpc.outputs.azs
+  public_subnets = dependency.vpc.outputs.public_subnets
+  private_subnets = dependency.vpc.outputs.private_subnets
+}

+ 5 - 0
test/aws-us-gov/mdr-test-c2/account.hcl

@@ -150,6 +150,7 @@ locals {
     "splunk-hf"      = "t3a.small", # legacy: t2.medium
     "splunk-sh"      = "t3a.small", # legacy: ? not sure
     "qcompliance"    = "t3a.small", # legacy: ? not sure
+    "github"         = "c5a.2xlarge", # legacy: c4.4xlarge in prod, c5.2xlarge in test
   }
 
   # TODO: The instance types below should be moved to the instance_type map above
@@ -180,6 +181,10 @@ locals {
   # Sensu Server
   sensu_server_instance_type = "t3a.medium"
 
+  # Github Servers
+  github_instance_count = 0
+  github_data_volume_size = 500
+
   # ALSI Servers
   alsi_workers = 2
   alsi_splunk_nlb = true # splunk://moose-alsi-splunk.xdr{,test}.accenturefederalcyber.com:9997 and 9998