Skip to content

Release: Phase 12 EC2 deploy + Phase 20 HTTPS via Caddy (closes #64) - #80

Merged
Poojithvsc merged 6 commits into
mainfrom
dev
Jun 6, 2026
Merged

Release: Phase 12 EC2 deploy + Phase 20 HTTPS via Caddy (closes #64)#80
Poojithvsc merged 6 commits into
mainfrom
dev

Conversation

@Poojithvsc

Copy link
Copy Markdown
Owner

Release PR for the Phase 12 + Phase 20 batch (#58 + #64 — they share one ephemeral EC2). Deployed and QA'd live on AWS on 2026-06-06.

Closes

  • Closes Phase 20: HTTPS via Caddy reverse proxy #64HTTPS via Caddy: proven live. Browser loads https://<ip> (self-signed warning expected), health 200 returned through Caddy. Includes the default_sni fix for bare-IP/no-SNI browsers.

Included but #58 stays OPEN

Notable changes (born from the live run)

  • use_rds toggle + container-Postgres localdb profile (RDS-denied fallback)
  • t2.micro OOM fix: swapfile + Kafka/app heap caps
  • create_instance_profile toggle (lab denies iam:CreateRole)
  • associate_public_ip_address=true; robust public-IP fetch for Caddy's cert SAN
  • Caddy default_sni; lab runbook updated with all eight blockers

Also carries one trailing Phase-18b doc commit (observability QA checklist).

🤖 Generated with Claude Code

Poojithvsc and others added 6 commits June 6, 2026 01:15
…logs/Kafka UI

The end-to-end checks mvn verify can't make: Grafana panels light up,
{container="shopsphere-app"} |= "<orderId>" returns every module's line, and
Kafka UI shows topics/offsets. Companion to qa-walkthrough.md (which is
dev-mode); this one runs the full compose profile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
….cloud.yml) [#58]

One-apply terraform/ec2 module: EC2 (AL2023, templated user-data installs Docker,
writes compose.cloud.yml, pulls poojithvsc/shopsphere:latest, brings up app+Kafka)
+ PRIVATE RDS (ingress only from the EC2 SG) + minimal IAM profile. compose.cloud.yml
runs app+Kafka against RDS, S3 dormant. ADR-0012 (self-hosted Kafka over MSK; Docker
Hub over ECR; RDS posture flip) + lab runbook. terraform validate passes; mvn verify
green. Lab-only ACs (apply, RDS-private timeout, QA over EC2, destroy) run in one
Whizlabs session — does not close #58 yet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Caddyfile reverse-proxies :443 -> app:8080 with a self-signed tls-internal cert;
site address via {$CADDY_SITE_ADDRESS:localhost} so the same file serves localhost
locally and the EC2 public IP in the lab. caddy added to docker-compose.yml (full
profile) and compose.cloud.yml (caddy profile). TLS termination PROVEN locally:
https://localhost/actuator/health returns the app JSON through Caddy, /api/v1/products
-> 401. ADR-0020 (self-signed over Let's Encrypt-impossible; Caddy over nginx;
ACM/ALB as own-AWS replacement). Lab-only ACs run with #58 — does not close #64 yet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-Postgres fallback [#58]

Live Whizlabs run surfaced several constraints; fixes:
- use_rds toggle: when false, skip all RDS resources (count=0) and run postgres:16
  in a localdb compose profile on the EC2 (sandbox denied RDS, even rds:Describe).
  The managed-private-RDS path is untouched (use_rds=true, validate-clean).
- t2.micro OOM: 2 GiB swapfile in user-data + KAFKA_HEAP_OPTS=-Xmx384m and app
  JAVA_TOOL_OPTIONS=-Xmx384m (cp-kafka defaults to -Xmx1G, which alone OOM-kills 1 GiB).
- create_instance_profile toggle: lab IAM user is denied iam:CreateRole (empty
  SSM-placeholder role made optional).
- associate_public_ip_address=true: sandbox default subnet has MapPublicIpOnLaunch=false.
- robust public-IP fetch (checkip.amazonaws.com + IMDS fallback) so Caddy's cert SAN
  gets the IP (supports #64).
- ADR-0012: document use_rds as a genuine two-value seam; RDS-private test deferred.

RDS-private negative test stays deferred (no RDS-capable AWS); #58 remains open.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…64]

Browsers send no SNI for a bare-IP URL, so Caddy couldn't match the IP-keyed site
and served an empty no-SAN fallback cert -> ERR_SSL_PROTOCOL_ERROR. Adding
default_sni {$CADDY_SITE_ADDRESS} makes Caddy present the IP cert (IP in SAN) to
no-SNI clients. Verified live via openssl (no -servername) and a browser.

Note: Windows curl/PowerShell (SChannel) still can't handshake with `tls internal`
certs — a client limitation, not a server fault; verify with openssl or a browser.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…PS lab [#58][#64]

Whizlabs constraints box (t2.micro-only, no IAM roles, no session token), fresh-lab
restart procedure, get-console-output diagnostic (no SSH), and OOM mitigation notes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Poojithvsc
Poojithvsc merged commit 4f76d8a into main Jun 6, 2026
2 checks passed
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.

Phase 20: HTTPS via Caddy reverse proxy

1 participant