Skip to content

Commit 8e438a8

Browse files
authored
Merge pull request #142 from Gaucho-Racing/bk1031/eks-teardown
chore(prod): remove eks and argocd modules after cluster teardown
2 parents 9de944d + a2d5514 commit 8e438a8

3 files changed

Lines changed: 0 additions & 75 deletions

File tree

infra/environments/prod/backend.tf

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ terraform {
1616
source = "hashicorp/aws"
1717
version = "~> 6.0"
1818
}
19-
helm = {
20-
source = "hashicorp/helm"
21-
version = "~> 3.0"
22-
}
2319
cloudflare = {
2420
source = "cloudflare/cloudflare"
2521
version = "~> 5.0"
@@ -51,20 +47,3 @@ provider "aws" {
5147
}
5248
}
5349
}
54-
55-
# Helm provider authenticates to EKS via `aws eks get-token`, which uses
56-
# whatever AWS credentials are already in the environment (the OIDC role
57-
# in CI; the local user otherwise). Both paths have cluster admin —
58-
# CI via enable_cluster_creator_admin_permissions on the EKS module,
59-
# local via the cluster_admin_principals access entry.
60-
provider "helm" {
61-
kubernetes = {
62-
host = module.eks.cluster_endpoint
63-
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
64-
exec = {
65-
api_version = "client.authentication.k8s.io/v1beta1"
66-
command = "aws"
67-
args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name, "--region", "us-west-2"]
68-
}
69-
}
70-
}

infra/environments/prod/main.tf

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,6 @@ module "vpc" {
2020
cluster_name = local.cluster_name
2121
}
2222

23-
module "eks" {
24-
source = "../../modules/eks"
25-
26-
name = local.cluster_name
27-
kubernetes_version = "1.35"
28-
29-
vpc_id = module.vpc.vpc_id
30-
subnet_ids = module.vpc.private_subnet_ids
31-
32-
# Both the local IAM user (admin-cli) and the CI OIDC role need cluster
33-
# admin. Listed explicitly so the set is stable regardless of who runs
34-
# terraform — the module's auto-cluster-creator flag is disabled to
35-
# avoid the entry flipping between appliers.
36-
cluster_admin_principals = [
37-
"arn:aws:iam::211125506628:user/admin-cli",
38-
"arn:aws:iam::211125506628:role/github-actions-terraform",
39-
]
40-
}
41-
42-
module "argocd" {
43-
source = "../../modules/argocd"
44-
45-
domain = "argocd.gauchoracing.com"
46-
47-
# Sentinel-generated client_id for the registered ArgoCD application.
48-
oidc_client_id = "b9OrCRXdo1VQ"
49-
50-
depends_on = [module.eks]
51-
}
52-
5323
# Wildcard cert for *.gauchoracing.com — every service (argocd, sentinel,
5424
# whatever else lands later) terminates TLS on its ALB using this cert.
5525
# Public-facing TLS terminates at the Cloudflare edge using Cloudflare's
@@ -97,10 +67,6 @@ module "postgres" {
9767
# a known set of admin IPs makes sense.
9868
associate_public_ip = true
9969
admin_cidr_blocks = ["0.0.0.0/0"]
100-
101-
allowed_security_group_ids = [
102-
module.eks.node_security_group_id,
103-
]
10470
}
10571

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

145111
associate_public_ip = true
146112
admin_cidr_blocks = ["0.0.0.0/0"]
147-
148-
allowed_security_group_ids = [
149-
module.eks.node_security_group_id,
150-
]
151113
}
152114

153115
resource "cloudflare_dns_record" "gr_mqtt" {
@@ -185,10 +147,6 @@ module "clickhouse" {
185147

186148
associate_public_ip = true
187149
admin_cidr_blocks = ["0.0.0.0/0"]
188-
189-
allowed_security_group_ids = [
190-
module.eks.node_security_group_id,
191-
]
192150
}
193151

194152
resource "cloudflare_dns_record" "gr_clickhouse" {

infra/environments/prod/outputs.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ output "public_subnet_ids" {
1010
value = module.vpc.public_subnet_ids
1111
}
1212

13-
output "cluster_name" {
14-
value = module.eks.cluster_name
15-
}
16-
17-
output "cluster_endpoint" {
18-
value = module.eks.cluster_endpoint
19-
}
20-
21-
output "cluster_oidc_provider_arn" {
22-
value = module.eks.oidc_provider_arn
23-
}
24-
2513
output "acm_certificate_arn" {
2614
description = "ACM ARN for the *.gauchoracing.com origin cert. Used in Ingress annotations (or picked up automatically by the ALB controller via SAN match)."
2715
value = module.origin_cert.acm_certificate_arn

0 commit comments

Comments
 (0)