-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
399 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,380 @@ | ||
| locals { | ||
| environment = "development" | ||
| region = "us-gov-east-1" | ||
| project_name = "csvd-platform-lab-mcm" | ||
| base_source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-" | ||
|
|
||
| } | ||
|
|
||
| # Define the EKS cluster unit | ||
| unit "eks" { | ||
| source = format("%v%v", local.base_source, "eks") | ||
| path = "eks" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Core Cluster Configuration | ||
| cluster_name = include.root.inputs.cluster_name | ||
| cluster_version = include.root.inputs.cluster_version | ||
|
|
||
| # Additional Configuration | ||
| tags = include.root.inputs.tags | ||
| } | ||
| } | ||
|
|
||
| unit "metrics" { | ||
| source = format("%v%v", local.base_source, "metrics-server") | ||
| path = "metrics-server" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Cluster Configuration | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
|
|
||
| # Metrics Server Configuration | ||
| metrics_server_helm_chart = include.root.inputs.metrics_server_helm_chart | ||
| metrics_server_tag = include.root.inputs.metrics_server_tag | ||
| namespace = include.root.inputs.namespaces["metrics-server"] | ||
| } | ||
| } | ||
|
|
||
| unit "karpenter" { | ||
| source = format("%v%v", local.base_source, "karpenter") | ||
| path = "karpenter" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Cluster Configuration | ||
| cluster_endpoint = dependency.eks.outputs.cluster_endpoint | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
| oidc_provider_arn = dependency.eks.outputs.oidc_provider_arn | ||
| vpc_id = dependency.eks.outputs.vpc_id | ||
|
|
||
| # Karpenter Configuration | ||
| karpenter_tag = include.root.inputs.karpenter_tag | ||
| karpenter_helm_chart = include.root.inputs.karpenter_helm_chart | ||
| karpenter_node_group_name = dependency.eks.outputs.node_group_name | ||
| namespace = include.root.inputs.namespaces["karpenter"] | ||
| } | ||
| } | ||
|
|
||
| # Add other components as needed (node groups, addons, etc.) | ||
| unit "config" { | ||
| source = format("%v%v", local.base_source, "eks-config") | ||
| path = "eks-config" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Core Cluster Configuration | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
| eks_managed_node_groups_autoscaling_group_names = dependency.eks.outputs.eks_managed_node_groups_autoscaling_group_names | ||
| oidc_provider_arn = dependency.eks.outputs.oidc_provider_arn | ||
| security_group_all_worker_mgmt_id = dependency.eks.outputs.security_group_all_worker_mgmt_id | ||
| subnets = dependency.eks.outputs.subnets | ||
| vpc_id = dependency.eks.outputs.vpc_id | ||
| operators_ns = include.root.inputs.operator_namespace | ||
| telemetry_ns = include.root.inputs.telemetry_namespace | ||
| } | ||
| } | ||
|
|
||
| # Add other components as needed (node groups, addons, etc.) | ||
| unit "cert_manager" { | ||
| source = format("%v%v", local.base_source, "cert-manager") | ||
| path = "cert-manager" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Cluster Configuration | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
| cluster_mailing_list = include.root.inputs.cluster_mailing_list | ||
| oidc_provider_arn = dependency.eks.outputs.oidc_provider_arn | ||
|
|
||
| # Cert Manager Configuration | ||
| cert_manager_helm_chart = include.root.inputs.cert_manager_helm_chart | ||
| cluster_issuer_name = include.root.inputs.cluster_issuer_name | ||
| namespace = include.root.inputs.namespaces["cert-manager"] | ||
|
|
||
| # Version Tags | ||
| cert_manager_cainjector_tag = include.root.inputs.cert_manager_cainjector_tag | ||
| cert_manager_controller_tag = include.root.inputs.cert_manager_controller_tag | ||
| cert_manager_startupapicheck_tag = include.root.inputs.cert_manager_startupapicheck_tag | ||
| cert_manager_webhook_tag = include.root.inputs.cert_manager_webhook_tag | ||
| } | ||
| } | ||
|
|
||
| # Add other components as needed (node groups, addons, etc.) | ||
| unit "loki" { | ||
| source = format("%v%v", local.base_source, "loki") | ||
| path = "loki" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Cluster Configuration | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
| oidc_provider_arn = dependency.eks.outputs.oidc_provider_arn | ||
|
|
||
| # Loki Configuration | ||
| loki_chart_version = include.root.inputs.loki_chart_version | ||
| loki_tag = include.root.inputs.loki_tag | ||
| namespace = include.root.inputs.namespaces["loki"] | ||
| rwo_storage_class = dependency.eks_config.outputs.rwo_storage_class | ||
| } | ||
| } | ||
|
|
||
| # Add modules for monitoring, logging, etc. | ||
| unit "prometheus" { | ||
| source = format("%v%v", local.base_source, "prometheus") | ||
| path = "prometheus" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Cluster Configuration | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
| oidc_provider_arn = dependency.eks.outputs.oidc_provider_arn | ||
|
|
||
| # Prometheus Configuration | ||
| prometheus_chart_version = include.root.inputs.prometheus_chart_version | ||
| prometheus_server_tag = include.root.inputs.prometheus_server_tag | ||
| prometheus_config_reloader_tag = include.root.inputs.prometheus_config_reloader_tag | ||
| alertmanager_tag = include.root.inputs.alertmanager_tag | ||
| kube_state_metrics_tag = include.root.inputs.kube_state_metrics_tag | ||
| namespace = include.root.inputs.namespaces["prometheus"] | ||
| node_exporter_tag = include.root.inputs.node_exporter_tag | ||
| pushgateway_tag = include.root.inputs.pushgateway_tag | ||
| rwo_storage_class = dependency.eks_config.outputs.rwo_storage_class | ||
| } | ||
| } | ||
|
|
||
| # Add other components as needed (node groups, addons, etc.) | ||
| unit "istio" { | ||
| source = format("%v%v", local.base_source, "istio") | ||
| path = "istio" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Cluster Configuration | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
| oidc_provider_arn = dependency.eks.outputs.oidc_provider_arn | ||
|
|
||
| # Istio Configuration | ||
| namespace = include.root.inputs.namespaces["istio"] | ||
| istio_version = include.root.inputs.istio_version | ||
| } | ||
| } | ||
|
|
||
| # Add other components as needed (node groups, addons, etc.) | ||
| unit "tempo" { | ||
| source = format("%v%v", local.base_source, "tempo") | ||
| path = "tempo" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Cluster Configuration | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
| oidc_provider_arn = dependency.eks.outputs.oidc_provider_arn | ||
|
|
||
| # Prometheus Configuration | ||
| prometheus_namespace = dependency.eks-prometheus.outputs.prometheus_namespace | ||
| prometheus_port = dependency.eks-prometheus.outputs.prometheus_server_internal_endpoint.port_number | ||
|
|
||
| # Tempo Configuration | ||
| tempo_chart_version = include.root.inputs.tempo_chart_version | ||
| tempo_tag = include.root.inputs.tempo_tag | ||
| namespace = include.root.inputs.namespaces["tempo"] | ||
| } | ||
| } | ||
|
|
||
| # Add other components as needed (node groups, addons, etc.) | ||
| unit "dns" { | ||
| source = format("%v%v", local.base_source, "dns") | ||
| path = "dns" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Cluster Configuration | ||
| cluster_name = include.root.inputs.cluster_name | ||
|
|
||
| # Network Configuration | ||
| istio_ingress_lb = dependency.eks-istio.outputs.istio_ingress_lb | ||
| route53_endpoints = include.root.inputs.route53_endpoints | ||
| vpc_domain_name = include.root.inputs.vpc_domain_name | ||
| vpc_name = include.root.inputs.vpc_name | ||
|
|
||
| # Additional Configuration | ||
| tags = include.root.inputs.tags | ||
| } | ||
| } | ||
|
|
||
| # Add other components as needed (node groups, addons, etc.) | ||
| unit "open_telemetry" { | ||
| source = format("%v%v", local.base_source, "open-telemetry") | ||
| path = "otel" | ||
|
|
||
| values = { | ||
| profile = include.root.inputs.aws_profile | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
| region = include.root.inputs.aws_region | ||
| namespace = include.root.inputs.namespaces["otel"] | ||
| loki_endpoint = dependency.eks-loki.outputs.gateway_internal_endpoint.url | ||
| tempo_endpoint = dependency.eks-tempo.outputs.tempo_otlp_endpoint.url | ||
| } | ||
| } | ||
|
|
||
| unit "grafana" { | ||
| source = format("%v%v", local.base_source, "grafana") | ||
| path = "grafana" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Cluster Configuration | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
| cluster_domain = dependency.eks_dns.outputs.cluster_domain | ||
| oidc_provider_arn = dependency.eks.outputs.oidc_provider_arn | ||
|
|
||
| # Storage Configuration | ||
| rwo_storage_class = dependency.eks_loki.outputs.rwo_storage_class | ||
|
|
||
| # Grafana Configuration | ||
| grafana_operator_chart_version = include.root.inputs.grafana_operator_chart_version | ||
| grafana_operator_tag = include.root.inputs.grafana_operator_tag | ||
| grafana_tag = include.root.inputs.grafana_tag | ||
| namespace = include.root.inputs.namespaces["grafana"] | ||
| os_shell_image_tag = include.root.inputs.os_shell_image_tag | ||
| service_name = "grafana" | ||
| loki_endpoint = dependency.eks_loki.outputs.gateway_internal_endpoint.url | ||
| prometheus_endpoint = dependency.eks_prometheus.outputs.prometheus_server_internal_endpoint.url | ||
| tempo_endpoint = dependency.eks_tempo.outputs.tempo_internal_endpoint.url | ||
| } | ||
| } | ||
|
|
||
| unit "dashboard" { | ||
| source = format("%v%v", local.base_source, "k8s-dashboard") | ||
| path = "k8s-dashboard" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Cluster Configuration | ||
| cluster_domain = dependency.eks_dns.outputs.cluster_domain | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
|
|
||
| # Dashboard Configuration | ||
| service_name = include.root.inputs.dashboard_hostname | ||
| k8s_dashboard_version = include.root.inputs.k8s_dashboard_version | ||
| namespace = include.root.inputs.namespaces["k8s-dashboard"] | ||
| } | ||
| } | ||
|
|
||
| unit "keycloak" { | ||
| source = format("%v%v", local.base_source, "keycloak") | ||
| path = "keycloak" | ||
|
|
||
| values = { | ||
| cluster_domain = dependency.eks_dns.outputs.cluster_domain | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
| namespace = include.root.inputs.namespaces["keycloak"] | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # keycloak config | ||
| default_storage_class = dependency.eks_config.outputs.rwo_storage_class | ||
| keycloak_chart_version = include.root.inputs.keycloak_chart_version | ||
| keycloak_hostname = include.root.inputs.keycloak_hostname | ||
| keycloak_tag = include.root.inputs.keycloak_tag | ||
| realm_email = include.root.inputs.cluster_mailing_list | ||
| realm_name = "master" | ||
| realm_password = include.root.inputs.keycloak_password | ||
| realm_username = include.root.inputs.keycloak_username | ||
| service_name = "keycloak" | ||
| telemetry_namespace = include.root.inputs.telemetry_namespace | ||
|
|
||
| # # Database configuration | ||
| keycloak_database = include.root.inputs.keycloak_database | ||
| keycloak_user = include.root.inputs.keycloak_username | ||
| keycloak_password = include.root.inputs.keycloak_password | ||
| } | ||
| } | ||
|
|
||
| unit "kiali" { | ||
| source = format("%v%v", local.base_source, "kiali") | ||
| path = "kiali" | ||
|
|
||
| values = { | ||
| # AWS Configuration | ||
| account_id = include.root.inputs.aws_account_id | ||
| profile = include.root.inputs.aws_profile | ||
| region = include.root.inputs.aws_region | ||
|
|
||
| # Cluster Configuration | ||
| cluster_domain = dependency.eks_dns.outputs.cluster_domain | ||
| cluster_name = dependency.eks.outputs.cluster_name | ||
| certificate_issuer = dependency.eks_cert_manager.outputs.cluster_issuer_name | ||
|
|
||
| # Kiali Configuration | ||
| service_name = "kiali" | ||
| namespace = include.root.inputs.namespaces["kiali"] | ||
| istio_namespace = include.root.inputs.namespaces["istio"] | ||
| 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 | ||
|
|
||
| prometheus_internal_url = dependency.eks_prometheus.outputs.prometheus_server_internal_endpoint.url | ||
| 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 | ||
| } | ||
| } |
Oops, something went wrong.