Feat/elastic beanstalk heroku#106
Open
azpaulp wants to merge 12 commits into
Open
Conversation
Change Heroku dyno migration default from Fargate to Elastic Beanstalk (Docker platform, AL2023). This preserves the PaaS-to-PaaS model: Heroku users push code, EB handles builds/deploys/scaling/patching. Fargate and EKS remain as user-selectable overrides via Q12c (renamed from "Kubernetes preference" to "Compute target preference"). Hierarchy: - Elastic Beanstalk (default) — managed platform like Heroku - Fargate (override) — direct container control - EKS (override) — full Kubernetes orchestration Includes dyno-to-EC2 instance type mapping table, EB environment type routing (web → LoadBalanced, worker → Worker+SQS), and backwards- compatible fallback from compute_target to kubernetes preference field.
Fix all blocking issues identified during review: Critical fixes: - Revert compute_target rename back to kubernetes field (add "elastic_beanstalk" as new valid value alongside existing values) - Update clarify-assemble.md validation to accept "elastic_beanstalk" - Update design-assemble.md route gate to accept EB entries - Add full EB Terraform generation (beanstalk.tf + pipeline.tf with CodePipeline for GitHub auto-deploy) - Add EB cost estimation formula (EC2 + ALB decomposition) High-priority fixes: - Update design.md conditional loading table for EB path - Update design-eks.md skip condition to include "elastic_beanstalk" Low-priority text fixes: - Update Q12b/Q11 Fargate references to be compute-target-agnostic - Update SKILL.md error handling and file tree descriptions - Update eks-mapping-table.md usage context
Critical fix: - Rename aws_security_group.fargate → aws_security_group.app (shared across EB/Fargate/EKS compute targets). Add SecurityGroups option setting to beanstalk.tf so EB instances can reach DB/Cache/MSK. Estimate fixes: - Compute Savings Plans now triggers for both EB and Fargate - Add EC2 Spot opportunity for EB worker environments - Fargate Spot limited to Fargate override path - Optimized tier description updated for EB Documentation: - design.md sub-files description mentions EB - EKS description says "instead of default EB path"
Critical: - MIGRATION_GUIDE Phase 3 now branches on compute target: EB path shows CodePipeline auto-deploy + manual CLI deploy; Fargate path preserved as override with original ECR/ECS flow High: - README artifact table uses correct filenames (beanstalk.tf, pipeline.tf, compute.tf, database.tf, cache.tf, messaging.tf, security.tf) with has_beanstalk/has_fargate conditionals - Fix fir_intent JSON path: preferences.global.fir_intent (not preferences.operational.fir_intent) per clarify-assemble schema Medium: - Containerization Prerequisites: "for AWS deployment" (not "for Fargate deployment") - Validation checklist: ECS Express Mode conditional on has_fargate; CodePipeline section conditional on has_beanstalk - Q11 option A: mentions "Elastic Beanstalk or Fargate, per Q12c" - CloudWatch Logs exception acknowledges both beanstalk.tf and compute.tf as valid compute config locations - Phase 4 health check: EB environment URL vs ALB endpoint Low: - SKILL.md sizing example: t3.small for EB (not 0.5 CPU for Fargate)
…pipeline Critical: - Define has_beanstalk and has_fargate detection flags in generate-docs.md (Step 0 detection table + Conditional Section Rules) Medium-High: - Fix worker tier: Heroku workers are persistent processes (Sidekiq, Celery), NOT SQS-triggered. Map to SingleInstance WebServer tier (Docker CMD runs continuously) instead of EB Worker tier - pipeline.tf now deploys to ALL environments (one action per env), not just web Medium: - estimate-defaults.json: add eb_environment log volume, add "Elastic Beanstalk" to savings plan targets, add ec2_spot entry - generate.md gate check includes beanstalk.tf and pipeline.tf - beanstalk.tf template updated for SingleInstance worker environments (tier = WebServer for all, no Worker tier used)
…ions
Critical:
- Add ec2.instances pricing data to aws-infra-pricing.json (t3.micro
through m5.4xlarge + r5.xlarge) matching the EB dyno-to-instance table
Medium:
- Security group: app SG ingress uses VPC CIDR instead of referencing
standalone ALB SG (EB manages its own ALB with its own SG)
- ALB SG marked as Fargate-override-only with skip note
- ECS IAM roles marked as Fargate-override-only with skip note
- Remove SQS from EB cost formula (workers are persistent processes,
not SQS-triggered)
- Add eb_environment to log volume prose enumeration
- Fix Q5b conditional rules: "Migration approach | Postgres present"
(was incorrectly "Migration urgency | Always")
- Remove batch size constraint text (was <=5, actual batches are larger)
Low:
- Add {{EB_ENVIRONMENT_URL}} to template variable resolution table
- Fix health check to use correct endpoint per compute target
Three issues that would cause terraform validate failure or incorrect deployment: 1. Add vpc_cidr to always-emitted global variables (security.tf references it unconditionally, but it was only defined in vpc.tf Path B). Now always present with note on how to populate per path. 2. Add EnvironmentType setting to beanstalk.tf template (LoadBalanced for web, SingleInstance for worker). Without this, EB defaults to SingleInstance and web dynos get no ALB. Also adds basic health reporting for workers (no HTTP endpoint to check). 3. Add PROCESS_TYPE env var per environment so the Dockerfile entrypoint can branch on process type. Includes documentation with example entrypoint.sh showing how to mirror Heroku's Procfile model in a single Docker image deployed to multiple environments.
…ix SingleInstance scaling 1. Extract dyno-eb-sizing.json following the established pattern (Fargate has dyno-fargate-sizing.json, EKS has eks-pod-sizing.json). Includes _comment, _match, _on_not_found, _environment_type, and _scaling metadata. design-mapping.md now references the JSON file instead of an inline markdown table. 2. Fix _knowledge _when condition: Fargate sizing now loads only when "ecs-fargate" (removed "or absent" since absent = EB default). Added EB sizing entry with "elastic_beanstalk or absent" condition. 3. Fix SingleInstance max_instances: always 1 (EB SingleInstance cannot auto-scale). If source formation has quantity > 1 for workers, emit a warning directing users to the Fargate override for horizontal worker scaling.
Revert two changes that fixed pre-existing issues but don't belong in this PR: - Q5b: restore original "Migration urgency | Always" label - Batch constraint: restore "(≤5 each)" text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add AWS Elastic Beanstalk (Docker platform, AL2023) as the default compute target for Heroku dyno migrations. Fargate and EKS remain as user-selectable overrides via Q12c.
This preserves the PaaS-to-PaaS model: Heroku users push code, EB handles builds/deploys/scaling/patching — the same operational experience they had on Heroku.
git pushto deploy via CodePipelineKey design decisions
Field naming: Kept
design_constraints.kuberneteswith"elastic_beanstalk"as a new valid value (alongside existing"ecs-fargate","eks-managed","eks-or-ecs"). Avoids a breaking schema rename across 10+ files and in-progress migration runs. A rename todesign_constraints.compute_targetis planned as a follow-up PR with a migration path.Worker mapping: Heroku workers are persistent processes (Sidekiq, Celery), NOT HTTP-triggered SQS consumers. They map to EB SingleInstance WebServer tier (Docker CMD runs continuously), not EB Worker tier. Horizontal worker scaling requires the Fargate override path.
Terraform generation:
beanstalk.tf(EB app/environments/IAM) +pipeline.tf(CodePipeline from GitHub for auto-deploy). CodePipeline mirrors Heroku'sgit pushdeploy model.Security model: App SG uses VPC CIDR ingress (EB manages its own ALB with its own SG internally).
Pricing: EB cost = EC2 instances + ALB (for LoadBalanced). EC2 instance rates added to
aws-infra-pricing.json. Decomposed in estimate via existing EC2/ALB formulas.Sizing data: Extracted to
knowledge/design/dyno-eb-sizing.jsonfollowing the established pattern (dyno-fargate-sizing.json,eks-pod-sizing.json). Declared in_knowledgefrontmatter with appropriate_whencondition.Changes by phase
clarify-interview.mdclarify-assemble.md"elastic_beanstalk"added to valid valuesdesign.md_knowledgeentry for EB sizing, lookup table updateddesign-mapping.mddesign-assemble.mddyno-eb-sizing.jsonestimate-cost-engine.mdestimate-defaults.jsoneb_environmentlog volume, EB in savings plan targetsgenerate-terraform.mdappgenerate-docs.mdhas_beanstalkdefinition, Phase 3 EB deploy, artifact tablegenerate.mdaws-infra-pricing.jsonSKILL.mdTest plan
mise run buildpasses locally (frontmatter validation, tsc, fmt:check, security)Known limitations
solution_stack_nameis hardcoded (v4.4.0) — should use a data source in production; documented as a template customization point