Serverless migration framework
297 serverless stacks owned by 13 teams sat on runtimes heading for end of life, with their pipelines going away alongside Jenkins. I designed the migration and built self-service scripts that scanned each stack and gave its team the exact steps.
13 teams migrated their own stacks off the deprecated runtimes and off Jenkins, each on its own schedule.
- 297stacks in scope, from 1197 found
- 13teams migrated their own stacks
Context
Every deployment rebuilt everything and touched infrastructure, with no split between infrastructure and code. The serverless.yml files were inconsistent and the internal deployment system had no Lambda support.
What I did
-
Found 1197 stacks. Removing duplicates and org-level stacks left 297.
-
Wrote a CloudFormation to Terraform import script. For each stack:
- Generate the templates and copy them to the account repository.
- Validate with no changes expected.
- Ignore the fields the deployment system manages.
- Apply with CodePipeline.
- Tag the stack as managed by Terraform, which blocks Jenkins deploys.
The CloudFormation stack stays as it was until the apply completes, so a failed import rolls back by doing nothing.
-
Built a ticket generator. Each stack gets 4 linked tickets in order: QA, production, TeamCity and the deployment system.
-
Ran Phase 1 for stacks with no Lambda functions, QA first, with no work needed from app teams.
-
Built a migration generator for Phase 2. It scans a serverless folder, applies the changes and writes a migration plan for the team.
-
Set the order by how often each stack changes, in priority buckets P0 to P4.
-
Held a kickoff meeting with each of the 13 teams.
Numbers
- The migration finished in Q1 2026. Leftover stacks went to a separate cleanup project, which removed them by Q3 2026.
Diagrams
Terraform
Infrastructure
TeamCity build
Internal deployment system
Code only
Jenkins job
Serverless deploy
Infrastructure and code together