# Set account-wide variables. These are automatically pulled in to configure the remote state bucket in the root
# terragrunt.hcl configuration.
locals {
  account_name   = "legacy-mdr-test"
  account_alias  = "" # No alias for legacy
  aws_account_id = "527700175026"
  instance_termination_protection = false # set to true for production!
  splunk_prefix = "moose"

  account_tags = {
    "Client": local.splunk_prefix
  }
  c2_account_standards_path = "../../mdr-test-c2/005-account-standards-c2"

  # For CIDR assignment, see https://github.mdr.defpoint.com/mdr-engineering/msoc-infrastructure/wiki/IP-Address-Allocation
  vpc_info = {} # "TODO"

  # Instance Configuration
  instance_types = {
    "jira-rds" = "db.t3.medium",  # legacy: db.t2.medium
  }
  jira_rds_storage = 50

  aws_waf_logs_hec_token = "FA38B8DD-1398-46D0-BD79-BA046C6064B0"
  portal_data_sync_hec_token = "eb79bb2d-b27d-455d-bc5c-e8cf3165b294"

  # Legacy accounts have some extra key users
  is_legacy = true
  extra_ebs_key_admins = [ 
    "arn:aws:iam::527700175026:root",
    "arn:aws:iam::527700175026:role/mdr_iam_admins",
    "arn:aws:iam::527700175026:role/mdr_powerusers"
  ]
  extra_ebs_key_users  = [ 
    "arn:aws:iam::527700175026:role/mdr_powerusers",
    "arn:aws:iam::527700175026:role/msoc-default-instance-role",
    "arn:aws:iam::527700175026:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling",
#    "arn:aws:iam::527700175026:role/portal-instance-role", # disalbed 2021-04
    "arn:aws:iam::527700175026:role/mdr_iam_admins"
  ]
  extra_ebs_key_attachers = [
    "arn:aws:iam::527700175026:role/mdr_powerusers",
    "arn:aws:iam::527700175026:role/msoc-default-instance-role",
    "arn:aws:iam::527700175026:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling",
#    "arn:aws:iam::527700175026:role/portal-instance-role",
  ] 

  # Legacy information
  # legacy_vpc information is required to connect the VPCs to the transit gateway.
  legacy_vpcs = {
    main_infrastructure = {
      id = "vpc-0b455a7f22a13412b",
      private_subnets = [ "subnet-053c6f1b9a48d4285", "subnet-047cba9290bc502fd", "subnet-01d13857b6f3899cb" ]
      public_subnets  = [ "subnet-0b1e9d82bcd8c0a2c", "subnet-0d65c22aa4f76b634", "subnet-07312c554fb87e4b5" ]
      private_route_tables = [ "rtb-0effbd34d78eabe6f", "rtb-02e8aaa2e4b82a665", "rtb-00928b94222c589a4" ]
      public_route_tables  = [ "rtb-022461b2a3c523e73" ]
    }
    ma-c19 = {
      id = "vpc-03522ef9cbaef2378",
      private_subnets = [ "subnet-0045fcb58b3ec017c", "subnet-05150379ec0cc4181", "subnet-0b4a35031fd20dcfb" ]
      public_subnets  = [ "subnet-0dee7a137d1598c4b", "subnet-0cc302d548e97188d", "subnet-0947439d65a8b54e2" ]
      private_route_tables = [ "rtb-01ad15c283474922a", "rtb-09be121675ff21a20", "rtb-08969d2fb85c343bb" ]
      public_route_tables  = [ "rtb-0d94202396743c4a5" ]
    }
    afs = {
      id = "vpc-0bb514965e384f13a",
      private_subnets = [ "subnet-0db1488cd94ad0b38", "subnet-0275d50060a77e726", "subnet-07a0c3f2ee215d5f1" ]
      public_subnets  = [ "subnet-05153a99ddb83712c", "subnet-044cf67369cee4967", "subnet-0bb9ec330ead3bab3" ]
      private_route_tables = [ "rtb-0f1ba98c1ce4a1306", "rtb-0861949990769ea9c", "rtb-00c008cd8a03f9a0d" ]
      public_route_tables  = [ "rtb-09261ab694d10ed4e" ]
    }
    la-c19 = {
      id = "vpc-0ce10fb98f1e9a078",
      private_subnets = [ "subnet-02ab0934a1161cd38", "subnet-07197e8b1661a3006", "subnet-00135f6f54e0ee4fc" ]
      public_subnets  = [ "subnet-0d0ef745c05339043", "subnet-01ab62a37d5c40eb3", "subnet-081ded06d577fd57d" ]
      private_route_tables = [ "rtb-098d239c29c96fb03", "rtb-0cd81b36f75e817e7", "rtb-06b060305a96cfab4" ]
      public_route_tables  = [ "rtb-0ca9389c1f764ced5" ]
    }
    dc-c19 = {
      id = "vpc-0f64ba0a5c72b7402",
      private_subnets = [ "subnet-01973d25e80bc4341", "subnet-0e2d94b352495b3c1", "subnet-0f68328639ccb8754" ]
      public_subnets  = [ "subnet-04188a43516592efa", "subnet-0a9b6fa8860a05751", "subnet-0281a55f386cf58f2" ]
      private_route_tables = [ "rtb-0f4babc621c88a81c", "rtb-093ce14bd550edfd2", "rtb-06e4a2609b3c63320" ]
      public_route_tables  = [ "rtb-0caf65533eea2f16c" ]
    }
  }
  # Qualys Connector
  qualys_connector_externalid = "1601947413043" # Needs to come from the qualys console
}
