diff --git a/.github/platform-tg-infra.code-workspace b/.github/platform-tg-infra.code-workspace index 8e81bf9..e0d9202 100644 --- a/.github/platform-tg-infra.code-workspace +++ b/.github/platform-tg-infra.code-workspace @@ -25,8 +25,8 @@ "path": "../../tfmod-eks-dns" }, { - "name": "tfmod-ersi-arcgis", - "path": "../../tfmod-ersi-arcgis" + "name": "tfmod-esri-arcgis", + "path": "../../tfmod-esri-arcgis" }, { "name": "tfmod-grafana", diff --git a/lab/_envcommon/common-variables.hcl b/lab/_envcommon/common-variables.hcl index f3b5387..89c502a 100644 --- a/lab/_envcommon/common-variables.hcl +++ b/lab/_envcommon/common-variables.hcl @@ -16,19 +16,24 @@ locals { "us-gov-west-1" = "vpc-08b7b4db6a5ddf9c1" } } - eecr_account_id = local.enterprise_ecr_account.lab["account_id"] - eecr_alias = local.enterprise_ecr_account.lab["alias"] - eecr_profile = format("%v-%v", local.eecr_account_id, local.eecr_alias) enterprise_ecr_account = { lab = { "account_id" = "269222635945" "alias" = "lab-gov-shared-nonprod" + "profile" = "269222635945-lab-gov-shared-nonprod" "region" = "us-gov-east-1" } prod = { "account_id" = "067074201825" "alias" = "ent-gov-shared-prod" + "profile" = "067074201825-ent-gov-shared-prod" "region" = "us-gov-east-1" } } + eecr_info = { + account_id = local.enterprise_ecr_account.lab["account_id"] + alias = local.enterprise_ecr_account.lab["alias"] + profile = local.enterprise_ecr_account.lab["profile"] + region = local.enterprise_ecr_account.lab["region"] + } } diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-arcgis/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-arcgis/terragrunt.hcl index 51e9dbf..38cf455 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-arcgis/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-arcgis/terragrunt.hcl @@ -61,6 +61,7 @@ inputs = { account_id = include.root.inputs.aws_account_id profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region + eecr_info = include.root.inputs.eecr_info # Cluster Configuration cluster_domain = dependency.eks_dns.outputs.cluster_domain diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-cert-manager/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-cert-manager/terragrunt.hcl index 3b43495..d369a43 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-cert-manager/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-cert-manager/terragrunt.hcl @@ -50,7 +50,7 @@ inputs = { account_id = include.root.inputs.aws_account_id profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region - eecr_account_id = include.root.inputs.eecr_account_id + eecr_info = include.root.inputs.eecr_info # Cluster Configuration cluster_name = dependency.eks.outputs.cluster_name diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-config/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-config/terragrunt.hcl index fa63483..49fa79c 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-config/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-config/terragrunt.hcl @@ -53,7 +53,6 @@ inputs = { account_id = include.root.inputs.aws_account_id profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region - eecr_account_id = include.root.inputs.eecr_account_id # Core Cluster Configuration cluster_name = dependency.eks.outputs.cluster_name diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-dns/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-dns/terragrunt.hcl index f9fda09..3d3672c 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-dns/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-dns/terragrunt.hcl @@ -56,7 +56,6 @@ inputs = { account_id = include.root.inputs.aws_account_id profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region - eecr_account_id = include.root.inputs.enterprise_ecr_account # Cluster Configuration cluster_name = include.root.inputs.cluster_name diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-grafana/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-grafana/terragrunt.hcl index a897c12..25d1b2b 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-grafana/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-grafana/terragrunt.hcl @@ -87,7 +87,7 @@ dependencies { inputs = { # AWS Configuration account_id = include.root.inputs.aws_account_id - eecr_account_id = include.root.inputs.eecr_account_id + eecr_info = include.root.inputs.eecr_info profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-istio/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-istio/terragrunt.hcl index cc0c03b..77bfa9c 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-istio/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-istio/terragrunt.hcl @@ -43,7 +43,7 @@ dependency "eks" { inputs = { # AWS Configuration account_id = include.root.inputs.aws_account_id - eecr_account_id = include.root.inputs.eecr_account_id + eecr_info = include.root.inputs.eecr_info profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-k8s-dashboard/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-k8s-dashboard/terragrunt.hcl index 84dab13..bd61ec0 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-k8s-dashboard/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-k8s-dashboard/terragrunt.hcl @@ -53,11 +53,11 @@ inputs = { account_id = include.root.inputs.aws_account_id profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region + eecr_info = include.root.inputs.eecr_info # Cluster Configuration cluster_domain = dependency.eks_dns.outputs.cluster_domain cluster_name = dependency.eks.outputs.cluster_name - eecr_account_id = include.root.inputs.eecr_account_id # Dashboard Configuration service_name = include.root.inputs.dashboard_hostname diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-karpenter/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-karpenter/terragrunt.hcl index 8ca10b6..f8e3f41 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-karpenter/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-karpenter/terragrunt.hcl @@ -49,7 +49,7 @@ inputs = { account_id = include.root.inputs.aws_account_id profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region - eecr_account_id = include.root.inputs.eecr_account_id + eecr_info = include.root.inputs.eecr_info # Cluster Configuration cluster_endpoint = dependency.eks.outputs.cluster_endpoint diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-keycloak/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-keycloak/terragrunt.hcl index fc97d70..7c84d1f 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-keycloak/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-keycloak/terragrunt.hcl @@ -60,7 +60,7 @@ dependencies { inputs = { cluster_domain = dependency.eks_dns.outputs.cluster_domain cluster_name = dependency.eks.outputs.cluster_name - eecr_account_id = include.root.inputs.eecr_account_id + eecr_info = include.root.inputs.eecr_info namespace = include.root.inputs.namespaces["keycloak"] profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-kiali/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-kiali/terragrunt.hcl index 05e4ff7..8913def 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-kiali/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-kiali/terragrunt.hcl @@ -58,11 +58,6 @@ dependency "eks_grafana" { url = "https://grafana.mock.svc.cluster.local:80/" } namespace = "grafana" - public_endpoint = { - hostname = "grafana.mock.lab.csp2.census.gov" - port_number = "80" - url = "https://grafana.mock.lab.csp2.census.gov:80/" - } secret_name = "grafana" tempo_datasource_id = "mock-tempo-datasource-id" } @@ -107,7 +102,7 @@ dependencies { inputs = { # AWS Configuration account_id = include.root.inputs.aws_account_id - eecr_account_id = include.root.inputs.eecr_account_id + eecr_info = include.root.inputs.eecr_info profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region @@ -123,7 +118,6 @@ inputs = { grafana_internal_url = dependency.eks_grafana.outputs.internal_endpoint.url grafana_namespace = dependency.eks_grafana.outputs.namespace grafana_secret_name = dependency.eks_grafana.outputs.secret_name - grafana_public_url = dependency.eks_grafana.outputs.public_endpoint kiali_application_version = include.root.inputs.kiali_application_version kiali_operator_version = include.root.inputs.kiali_operator_version @@ -132,7 +126,6 @@ inputs = { grafana_namespace = dependency.eks_grafana.outputs.namespace grafana_secret_name = dependency.eks_grafana.outputs.secret_name grafana_internal_url = dependency.eks_grafana.outputs.internal_endpoint.url - grafana_public_url = dependency.eks_grafana.outputs.public_endpoint tempo_datasource_id = dependency.eks_grafana.outputs.tempo_datasource_id tempo_internal_url = dependency.eks_tempo.outputs.tempo_internal_endpoint.url } diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-loki/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-loki/terragrunt.hcl index 36d44b2..401ad3a 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-loki/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-loki/terragrunt.hcl @@ -51,7 +51,7 @@ dependencies { inputs = { # AWS Configuration account_id = include.root.inputs.aws_account_id - eecr_account_id = include.root.inputs.eecr_account_id + eecr_info = include.root.inputs.eecr_info profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-metrics-server/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-metrics-server/terragrunt.hcl index ede644a..0fa527f 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-metrics-server/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-metrics-server/terragrunt.hcl @@ -40,7 +40,7 @@ dependencies { inputs = { # AWS Configuration account_id = include.root.inputs.aws_account_id - eecr_account_id = include.root.inputs.eecr_account_id + eecr_info = include.root.inputs.eecr_info profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-otel/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-otel/terragrunt.hcl index 1d6ff7f..693ba17 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-otel/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-otel/terragrunt.hcl @@ -65,9 +65,10 @@ dependencies { inputs = { # AWS Configuration account_id = include.root.inputs.aws_account_id - eecr_account_id = include.root.inputs.eecr_account_id + eecr_info = include.root.inputs.eecr_info profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region + # Clouster Config cluster_name = dependency.eks.outputs.cluster_name diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-prometheus/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-prometheus/terragrunt.hcl index fd7a50c..2752527 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-prometheus/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-prometheus/terragrunt.hcl @@ -52,7 +52,7 @@ dependency "eks_config" { inputs = { # AWS Configuration account_id = include.root.inputs.aws_account_id - eecr_account_id = include.root.inputs.eecr_account_id + eecr_info = include.root.inputs.eecr_info profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region diff --git a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-tempo/terragrunt.hcl b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-tempo/terragrunt.hcl index f3cafec..6a05943 100644 --- a/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-tempo/terragrunt.hcl +++ b/lab/development/us-gov-east-1/vpc/csvd-platform-lab-mcm/eks-tempo/terragrunt.hcl @@ -55,7 +55,7 @@ dependencies { inputs = { # AWS Configuration account_id = include.root.inputs.aws_account_id - eecr_account_id = include.root.inputs.eecr_account_id + eecr_info = include.root.inputs.eecr_info profile = include.root.inputs.aws_profile region = include.root.inputs.aws_region diff --git a/lab/root.hcl b/lab/root.hcl index 86b5573..be5a3fd 100644 --- a/lab/root.hcl +++ b/lab/root.hcl @@ -24,12 +24,15 @@ locals { # Automatically load vpc-level variables vpc_vars = read_terragrunt_config(find_in_parent_folders("vpc.hcl")) + # Check if copy_images.tf exists in the module directory + has_copy_images = fileexists("${get_original_terragrunt_dir()}/copy_images.tf") + + # Add any other locals you want to expose + # only expose things not already included via local.xxx_vars.locals.* root_locals_for_inputs = { is_module_enabled = local.is_module_enabled module_name = local.module_name - eecr_profile = local.eecr_profile - # Add any other locals you want to expose - # only expose things not already included via local.xxx_vars.locals.* + has_copy_images = local.has_copy_images } # Extract the variables we need for easy access @@ -38,8 +41,7 @@ locals { aws_profile = local.account_vars.locals.aws_profile aws_region = local.region_vars.locals.aws_region cluster_name = local.cluster_vars.locals.cluster_name - eecr_account_id = local.common_vars.locals.eecr_account_id - eecr_profile = local.common_vars.locals.eecr_profile + eecr_info = local.common_vars.locals.eecr_info environment_abbr = local.account_vars.locals.environment_abbr finops_project_name = local.cluster_vars.locals.finops_project_name finops_project_number = local.cluster_vars.locals.finops_project_number @@ -156,23 +158,6 @@ generate "aws-provider" { EOF } -generate "eecr-provider" { - path = "eecr-provider.tf" - if_exists = "overwrite" - contents = <<-EOF - provider "aws" { - alias = "eecr" - profile = "${local.eecr_profile}" - region = "${local.aws_region}" - } - data "aws_ecr_authorization_token" "ecr_token" { - provider = aws.eecr - registry_id = var.eecr_account_id - } - -EOF -} - # --------------------------------------------------------------------------------------------------------------------- # GLOBAL PARAMETERS # These variables apply to all configurations in this subfolder. These are automatically merged into the child