Skip to content

Phase 12: EC2 deploy + self-hosted Kafka; RDS becomes private #58

Description

@Poojithvsc

What to build

Extend the Terraform to provision an EC2 instance that pulls poojithvsc/shopsphere:latest from Docker Hub via user-data, runs the app + Kafka as compose services, and connects to the Phase-11 RDS. RDS posture flips to private: publicly_accessible = false, security group now allows inbound only from the EC2's security group — proven by attempting psql from the laptop and getting a connection timeout. The full QA walkthrough runs end-to-end against http://<ec2-public-ip>:8080.

HITL — needs a Whizlabs lab session.

Full design in PLAN-002 §Phase 12.

Acceptance criteria

  • Terraform module under code/terraform/ec2/ (or extends rds/): provisions t3.micro Amazon Linux 2023, EC2 security group, IAM instance profile (no SSM permissions yet)
  • EC2 user-data installs Docker + docker-compose, writes compose.cloud.yml (app + Kafka), pulls poojithvsc/shopsphere:latest, brings up the stack
  • RDS module updated: publicly_accessible = false, SG now allows ingress only from the EC2's SG (not laptop IP)
  • terraform apply provisions RDS + EC2 in one apply
  • App reachable at http://<ec2-public-ip>:8080/swagger-ui.html
  • RDS is private — verified: psql -h <rds-endpoint> from the laptop times out
  • QA walkthrough passes end-to-end against the EC2 endpoint
  • Image is built locally and pushed to Docker Hub manually in this phase (Phase 19 automates push); document the manual push commands in the PR description
  • terraform destroy cleans up both RDS and EC2
  • mvn verify stays green
  • ADR-0012 written (EC2 + self-hosted Kafka over MSK / Confluent Cloud; Docker Hub over ECR; RDS posture flip); books cited
  • Article stub: articles/drafts/phase-12-ec2-deploy.md

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentHas enough spec for an AFK Claude session to pick up cold

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions