Skip to main content

ecsodus

PyPI CI Python License AWS e2e

Safely migrate AWS Copilot CLI apps to Terraform-managed ECS.

ecsodus: report what a stack delete would destroy, then generate Terraform imports, retain patches and a gated runbook

AWS ended support for the Copilot CLI on 2026-06-12 and archived its repository on 2026-06-22. Your Copilot services keep running as CloudFormation stacks. Moving them to Terraform means deleting those stacks without deleting what they manage, and done naively that destroys production:

  • Custom-resource Delete handlers. When a stack is deleted, Copilot's Lambda-backed custom resources delete ACM certificates, DNS alias and validation records, and the NS delegation, and they empty the ELB access-logs bucket.
  • The env-controller. Deleting the last service stack makes the env-controller remove the shared ALB, the NAT gateways and the EFS file system from the environment stack.
  • Unprotected addons. Addon databases (Aurora, DynamoDB) live in nested stacks with no DeletionPolicy.
  • --retain-resources doesn't help. The obvious flag only works on stacks already in DELETE_FAILED.

ecsodus knows where these traps are. It reads your Copilot app and adopts it in place: Terraform imports the resources exactly as they run today, and no traffic moves. It writes retain patches so that no stack delete can remove anything, and a step-by-step runbook with a machine check before every mutating step.

Status: v0.1.0, alpha. It is tested offline against real Copilot-generated templates, and it passed a real AWS end-to-end run on 2026-09-30, including teardown (report). Read the verified scope before running it against production.

Install

pipx install ecsodus      # or run it without installing: uvx ecsodus --help

What it does

ecsodus inventory --app myapp -o inventory.json    # read-only: stacks, templates, live state
ecsodus report    inventory.json                   # REPORT.md: readiness, fates, blockers
ecsodus generate  inventory.json --out infra/      # Terraform + retain patches + RUNBOOK.md
ecsodus check     plan.json --manifest infra/ecsodus-manifest.json --phase import
ecsodus verify-retain --app myapp                  # read-only: is every resource Retain?
  • Read-only by construction. Every AWS client refuses any operation that isn't Describe/List/Get/Lookup, and secret values are never read. ecsodus never applies Terraform, deletes anything or moves traffic. You run the runbook.
  • Exact imports. Imported resources become flat aws_* blocks built from literal deployed values, so the first plan is import-only. check --phase import rejects any update, create, delete or replacement.
  • Retain everything first. Every resource in every handed-off stack gets DeletionPolicy: Retain and UpdateReplacePolicy: Retain. The patch edits the deployed template line by line, so every other byte stays identical. It is applied through change sets, and check --changeset accepts only change sets that change policies and nothing else.
  • Never split a stack. A stack is either handed off completely or kept on Copilot completely. If anything is unsupported, the stack and everything it depends on stay on Copilot, and the report says why. Nothing is ever dropped silently.
  • Honest baseline. Every report starts with the zero-risk option: keep the CloudFormation.

How it compares

Approach Moves traffic? Keeps your data? Ends on Terraform? Handles Copilot's Delete handlers?
ecsodus (adopt in place) No Yes, every resource is retained, then imported Yes Yes: retain patches, verified on AWS
Rebuild on ECS Express Mode or CDK (AWS's suggestion) Yes, a cutover You migrate stateful resources yourself No (Express Mode / CDK) Not applicable until you delete the old stacks
Convert templates with cf2tf Depends Only if you import and retain by hand Yes No
Keep the CloudFormation No Yes No Not triggered

If you don't need Terraform, keeping the CloudFormation is the zero-risk choice, and every ecsodus report says so first.

Scope (v0.1)

Supported:

  • Load Balanced Web Services and Backend Services
  • their environment (created or imported VPC)
  • workload and environment addons: Aurora/RDS, DynamoDB, S3
  • aliases and custom domains
  • the app stack and StackSet

Detected and reported as blocked: Worker Services, Scheduled Jobs, Request-Driven Web Services, Static Sites, NLB, CloudFront, sidecars, Service Connect, pipelines and multi-account environments.

Planned:

  • v0.2: App Runner, with a rebuild-in-parallel mode
  • v0.3: more workload types

Documentation

Development

uv sync
uv run pytest            # offline: fixtures, moto, and terraform validate if terraform is installed
uv run ruff check . && uv run mypy src

See CONTRIBUTING.md and SECURITY.md.

Citation

If you use ecsodus, please cite it: see CITATION.cff. GitHub's "Cite this repository" button reads it.

License

Apache-2.0. Test fixtures under tests/fixtures/copilot/ are copied verbatim from aws/copilot-cli (Apache-2.0); see SOURCE.md there.

Metadata

Release files for ecsodus 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecsodus 0.1.1
File Size Uploaded
ecsodus-0.1.1.tar.gz 105.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ecsodus 0.1.1
File Interpreter ABI Platform
ecsodus-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 225.1 kB

Release files / ecsodus-0.1.1.tar.gz

Download URL ecsodus-0.1.1.tar.gz
Size 105.0 kB
Tags Source
SHA-256 checksum
How to use checksums
06e2df4ecf8ac72c2d8956727d892dfa096730439c94f33b3502a1ccb5e5f310
BLAKE2b-256 checksum
How to use checksums
e442e4da0dbcd60acd9b961b44e3e986d0ccefb5adeda53277a135aec579c82d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ecsodus-0.1.1-py3-none-any.whl

Download URL ecsodus-0.1.1-py3-none-any.whl
Size 120.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e0798c74618905721762a9390d55faae02c0ea99ad27e0f1147beb553891715
BLAKE2b-256 checksum
How to use checksums
cfebca87907ef3c0941e447798b1698fd5c3d2c5c189461bdd402402652fdd29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page