Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions infra/environments/prod/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ terraform {
source = "hashicorp/aws"
version = "~> 6.0"
}
helm = {
source = "hashicorp/helm"
version = "~> 3.0"
}
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 5.0"
Expand Down Expand Up @@ -51,20 +47,3 @@ provider "aws" {
}
}
}

# Helm provider authenticates to EKS via `aws eks get-token`, which uses
# whatever AWS credentials are already in the environment (the OIDC role
# in CI; the local user otherwise). Both paths have cluster admin —
# CI via enable_cluster_creator_admin_permissions on the EKS module,
# local via the cluster_admin_principals access entry.
provider "helm" {
kubernetes = {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
exec = {
api_version = "client.authentication.k8s.io/v1beta1"
command = "aws"
args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name, "--region", "us-west-2"]
}
}
}
42 changes: 0 additions & 42 deletions infra/environments/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,6 @@ module "vpc" {
cluster_name = local.cluster_name
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the dangling Helm provider references

After deleting module.eks from the prod root module, backend.tf still configures the Helm provider using module.eks.cluster_endpoint, module.eks.cluster_certificate_authority_data, and module.eks.cluster_name at lines 62–67. Consequently, every terraform validate, plan, or apply for infra/environments/prod fails with references to an undeclared module, blocking the teardown configuration from being applied; remove the obsolete Helm provider configuration along with the EKS module.

Useful? React with 👍 / 👎.

module "eks" {
source = "../../modules/eks"

name = local.cluster_name
kubernetes_version = "1.35"

vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnet_ids

# Both the local IAM user (admin-cli) and the CI OIDC role need cluster
# admin. Listed explicitly so the set is stable regardless of who runs
# terraform — the module's auto-cluster-creator flag is disabled to
# avoid the entry flipping between appliers.
cluster_admin_principals = [
"arn:aws:iam::211125506628:user/admin-cli",
"arn:aws:iam::211125506628:role/github-actions-terraform",
]
}

module "argocd" {
source = "../../modules/argocd"

domain = "argocd.gauchoracing.com"

# Sentinel-generated client_id for the registered ArgoCD application.
oidc_client_id = "b9OrCRXdo1VQ"

depends_on = [module.eks]
}

# Wildcard cert for *.gauchoracing.com — every service (argocd, sentinel,
# whatever else lands later) terminates TLS on its ALB using this cert.
# Public-facing TLS terminates at the Cloudflare edge using Cloudflare's
Expand Down Expand Up @@ -97,10 +67,6 @@ module "postgres" {
# a known set of admin IPs makes sense.
associate_public_ip = true
admin_cidr_blocks = ["0.0.0.0/0"]

allowed_security_group_ids = [
module.eks.node_security_group_id,
]
}

# Cloudflare DNS record for the Postgres EIP. Gray-cloud (proxied = false)
Expand Down Expand Up @@ -144,10 +110,6 @@ module "mqtt" {

associate_public_ip = true
admin_cidr_blocks = ["0.0.0.0/0"]

allowed_security_group_ids = [
module.eks.node_security_group_id,
]
}

resource "cloudflare_dns_record" "gr_mqtt" {
Expand Down Expand Up @@ -185,10 +147,6 @@ module "clickhouse" {

associate_public_ip = true
admin_cidr_blocks = ["0.0.0.0/0"]

allowed_security_group_ids = [
module.eks.node_security_group_id,
]
}

resource "cloudflare_dns_record" "gr_clickhouse" {
Expand Down
12 changes: 0 additions & 12 deletions infra/environments/prod/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@ output "public_subnet_ids" {
value = module.vpc.public_subnet_ids
}

output "cluster_name" {
value = module.eks.cluster_name
}

output "cluster_endpoint" {
value = module.eks.cluster_endpoint
}

output "cluster_oidc_provider_arn" {
value = module.eks.oidc_provider_arn
}

output "acm_certificate_arn" {
description = "ACM ARN for the *.gauchoracing.com origin cert. Used in Ingress annotations (or picked up automatically by the ALB controller via SAN match)."
value = module.origin_cert.acm_certificate_arn
Expand Down
Loading