Skip to content

feat(infra): PR #7 — Terraform ECS compute + autoscaling - #178

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1784572399-infra-compute
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1784572399-infra-compute

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 20, 2026

Copy link
Copy Markdown

Summary

Wave 2 / PR #7. Self-contained Terraform root infra/compute/ running the GnuCOBOL batch/service containers on ECS Fargate with health checks and target-tracking autoscaling. Consumes infra/network (subnets, SG) and infra/storage (EFS id/access point) outputs via variables; parameterized by var.programs so onboarding a service is config-only.

infra/compute/
  main.tf         # ecs_cluster; per-program task_definition (EFS volume -> data_root,
                  #   container healthCheck -> /health sidecar, awslogs) + ecs_service (Fargate, circuit breaker)
  iam.tf          # execution role (ECR pull + logs) and task role (EFS ClientMount/Write)
  autoscaling.tf  # appautoscaling_target + CPU target tracking (always);
                  #   optional SQS queue-depth (backlog/task) when scale_on_queue_depth=true
  variables.tf outputs.tf versions.tf

Key points hard to see from the diff:

  • Health check uses python3 urllib (already in the image — no curl needed) so ECS marks a task unhealthy when /health returns 503, which the entrypoint sets on program failure.
  • Task runs with MODE=service so the container stays up for the service/autoscaling model (vs oneshot batch).
  • local.images falls back to a placeholder ECR URL when ecr_repository_urls is empty, so the root plans/validates offline before Add User ID alphanumeric validation for MBA-123 #5 outputs are wired.

Verified locally

  • terraform fmt, terraform init -backend=false, terraform validateSuccess! The configuration is valid.

Links

Link to Devin session: https://app.devin.ai/sessions/c0f261ce337a4aee965332f1754d037a
Requested by: @vibhaseshadri-cognition


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

…nfra/compute) (feature)

PR #7 / Wave 2: self-contained Terraform root infra/compute - ECS Fargate
cluster, per-program task definition (EFS volume for AWS.M2.CARDDEMO.* datasets,
container health check hitting the /health sidecar, awslogs) and service, IAM
execution/task roles (ECR pull, logs, EFS client access), and target-tracking
autoscaling (CPU always-on; optional SQS queue-depth backlog-per-task).
Parameterized by var.programs and consumes network/storage outputs. Validates
offline.

Co-Authored-By: Vibha  Seshadri <vibha.seshadri@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

0 participants