Skip to content

Add Terraform-based AWS deployment path for Apollo#1032

Draft
cdoten wants to merge 13 commits intonditech:developfrom
cdoten:feature/aws-ecs-terraform
Draft

Add Terraform-based AWS deployment path for Apollo#1032
cdoten wants to merge 13 commits intonditech:developfrom
cdoten:feature/aws-ecs-terraform

Conversation

@cdoten
Copy link
Copy Markdown

@cdoten cdoten commented Apr 9, 2026

Summary

This PR adds a Terraform-based AWS deployment path for Apollo.

It introduces:

  • infra/bootstrap/ for Terraform remote-state bootstrap
  • infra/terraform/ for the main Apollo infrastructure stack
  • infra/scripts/ for repeatable helper workflows
  • infrastructure documentation under infra/

The stack provides an end-to-end AWS path for running Apollo in ECS behind an ALB, with PostgreSQL, Redis, and S3-backed attachments.

What this infrastructure provisions

  • VPC, subnets, and routing
  • security groups
  • S3 bucket for attachments
  • RDS PostgreSQL
  • ElastiCache Redis
  • ECR repository
  • IAM roles and policies
  • Secrets Manager secrets
  • ECS cluster
  • ECS task definitions for migration, web, and worker
  • ECS services for web and worker
  • ALB / HTTPS / DNS wiring

Notes

This is intended as an additional deployment path for Apollo.

The current implementation reflects practical bring-up tradeoffs, including ECS tasks currently running in public subnets and Apollo’s current reliance on explicit AWS credentials for S3 attachment initialization.

Validation completed

  • ECS migration task ran successfully

  • web app loaded successfully

  • login worked

  • initial admin setup was completed

  • Adding .claude to .gitignore

  • Add initial Terraform setup and S3 attachments bucket

  • Created AWS terraform state bucket and repointed state info there

  • Add initial Terraform AWS infrastructure for Apollo

  • Further terraform implementation, including initial Redis work. Updated the readme to match.

  • Add ECS runtime infrastructure for Apollo deployment

  • Ongoing major changes to Apollo Terraform scripts. However, this all appears to work

  • Refactoring Terraform config files to make it more clear, including splitting deployment and foundational elements from variables and outputs.

  • Updated readme with current status

  • Creating test setup fixtures to get the system running.

  • Adding local config file examples

  • Looks like modern apollo doesn't need settings.ini

  • Updating terraform.tfvars example with current requirements

cdoten added 13 commits March 29, 2026 02:57
Set up Terraform under infra/terraform and a bootstrap stack under
infra/bootstrap for remote state. Create S3-backed remote state with
versioning, encryption, and locking, and add the Apollo attachments
bucket with encryption, versioning, and blocked public access.

Build the initial AWS network foundation with a VPC, public/private
subnets across two AZs, an internet gateway, and public routing.
Add security groups for the ALB, web, worker, RDS, and Redis tiers
with explicit SG-to-SG traffic rules.

Provision a private RDS PostgreSQL instance and DB subnet group, and
add an infra README documenting the current architecture and design
goal of keeping the stack inexpensive but stable.
- add ECR repository management to Terraform
- add ECS cluster and task/task-execution IAM roles
- add Secrets Manager secrets for app runtime
- add CloudWatch log groups for migration, web, and worker
- add ECS task definitions for migration, web, and worker
- add ALB, target group, listeners, and ECS services for web/worker
- expand variables and outputs for runtime and public hostname configuration
…plitting deployment and foundational elements from variables and outputs.
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