Skip to content

feat: add EKS platform with monitoring and GitHub deployments - #1

Merged
patrick-hudson merged 4 commits into
mainfrom
codex/build-eks-platform-reference
Oct 14, 2026
Merged

patrick-hudson merged 4 commits into
mainfrom
codex/build-eks-platform-reference

Conversation

@patrick-hudson

@patrick-hudson patrick-hudson commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Provision dev or prod EKS from shared Terraform code, with private worker nodes, public HTTPS Grafana, GitHub OIDC deployments, and a cleanup procedure that checks AWS for leftover billable resources.

Design decisions

  • Dev shares one NAT gateway to keep short test runs affordable; prod uses a NAT gateway per zone and larger managed nodes.
  • Workspaces isolate state and select settings from auto-loaded tfvars maps. Platform and monitoring have separate states so Helm connects to an existing cluster and monitoring can be destroyed first.
  • Native S3 locking avoids a separate lock database. GitHub uses distinct plan and apply roles rather than stored AWS keys; apply roles remain privileged account administration.
  • PRs plan both environments and update a bot comment per environment with resource counts, status, commit and workflow link. Merges run validation only. Applies require a manual run on main with an environment selected; manual runs default to plan. Destructive cluster plans stop before apply so ALB and volume cleanup can finish while controllers still run.

Validation

  • Formatting and all three Terraform roots validate with pinned providers, including dev/prod settings when starting from the default workspace on a fresh runner.
  • Eleven offline Terraform plans cover both workspace configurations and actual plan/apply IAM trust policies.
  • Twenty-four Python tests cover audit failures, deployment ordering, manual operations, push rejection, lock behavior, cluster replacement rejection, plan counts, safe comment contents and bot-comment updates across paginated results.
  • actionlint 1.7.12 validates the workflow. A scratch-copy mutation test rejects a wildcard GitHub OIDC subject.
  • The monitoring charts were rendered and inspected for storage, authentication and controller identity.

The live dev apply is being verified separately. These checks do not establish live account permissions, quotas, ALB reconciliation, DNS or teardown success. GitHub comment publication, workflow expressions and inventory collection still require the documented live checks in addition to the command-level tests. Raw plan values and JSON are never posted in comments.

Operating notes

The README includes hourly and daily AWS estimates, setup commands, design tradeoffs, and scope limits. The cleanup guide captures resource IDs before destruction and requires a read-only AWS audit afterward; bootstrap state and the existing hosted zone are retained unless explicitly retired.

This PR is a draft while the live deployment is being checked. Plan jobs use the existing approval-protected dev-plan and prod-plan environments. No AWS apply or destroy was run while preparing the PR.

Share Terraform roots across dev and prod workspaces, keep worker nodes
private, and expose Grafana through an HTTPS ALB and Route 53.

Use S3 state locking and separate GitHub OIDC plan/apply roles. Support
manual reruns for one environment, guard destructive cluster changes,
and document AWS costs and a resource inventory audit for teardown.
Validate dev and prod from a fresh runner without selecting remote state.
Keep main pushes validation-only and require manual apply runs.
Update one PR plan comment per environment with safe change counts.
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Terraform plan: prod

Job result: success. Commit: ec54c10e9b8a322d82769ccd6773e6b91e61b367. Workflow run.

Root Result Add Change Destroy Replace
Platform Planned 58 0 0 0
Monitoring Deferred: cluster does not exist — — — —

Replacements also count toward Add and Destroy. Counts describe managed resources; output-only changes are not included.

A deferred monitoring plan requires an existing cluster. Check the workflow logs for any failure or incomplete results.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Terraform plan: dev

Job result: success. Commit: ec54c10e9b8a322d82769ccd6773e6b91e61b367. Workflow run.

Root Result Add Change Destroy Replace
Platform Planned 50 0 0 0
Monitoring Deferred: cluster does not exist — — — —

Replacements also count toward Add and Destroy. Counts describe managed resources; output-only changes are not included.

A deferred monitoring plan requires an existing cluster. Check the workflow logs for any failure or incomplete results.

@patrick-hudson
patrick-hudson merged commit 2de6c61 into main Oct 14, 2026
3 checks passed

This branch was successfully deployed

2 active deployments
dev-plan — ec54c10e Deployed Oct 14, 2026 by patrick-hudson via Terraform (dev) #4
prod-plan — ec54c10e Deployed Oct 14, 2026 by patrick-hudson via Terraform (prod) #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant