Lambda function
Point the live alias back at the last stable version. The deploy plan does this on its own if an alarm trips at any traffic step.
lambda-lifeline rollback --function <name> --alias live --apply
Exhibit 3.1, step 8
What an End-of-Life Migration Sprint hands over, shown on Quarrytide Logistics, a fictional company: the inventory as the kits printed it, the cutover and rollback runbook, the CI gate and the pack you would sign.
One AWS account, three environments, five functions per environment, one Amazon Linux 2 host group and ECS workers. Account 111122223333 is the example ID AWS uses in its own documentation.
| File | What it is | SHA-256 |
|---|---|---|
| README.txt | The demo label, in the folder itself | 23c9ba55e855fc3551ac94a9fed82d24480373c14417888cb297e33f68851010 |
| services/template.yaml | SAM template: five functions per stage | 4550543eaf5731270c2a8967433c7ae2fd4c7b5270716e32c03b47aa4437af6f |
| services/label-render/package.json | Dependencies of the label renderer | 1ecf64d086019a8fd088ff852cb9ce9fa3b8abba860d0f53a278136165683bfa |
| services/quote-api/package.json | Dependencies of the quote API | e5954bb2fd2f24558dbda1d81b706c432bbd755f6ef11550429da45df0fd31ae |
| infra/hosts.tf | Terraform: dispatch host group and ECS workers | 0e6bbc4016e9616d8a952e7b9469afe88aece74cad5a0f7f74b83d5699214112 |
| hosts/user-data.sh | User data the dispatch hosts boot with | 78b1779a8e59075d7a6864f60b842af6a7f3703fae5b043dd9dbd5e6c132c43e |
| hosts/packages.txt | Packages the hosts install | 4fd912ebf8d55271d473c35788701688a892c3ffbf18d57af7930c1fa106474d |
| aws/lambda-inventory.json | What the read-only role lists: Lambda | 8836f512a240b0b53f8fdfb84cebe717457e2e23f2a6c14769a8750c921cb949 |
| aws/ec2-inventory.json | What the read-only role lists: EC2 | e276a3ed48b019f3fb7ee89de287fea3b383d812aeb78d48dd045b14428403b2 |
Download any file and hash it; the bytes match. In a real sprint the two
aws/ inventories come from a read-only role in your account. Here they are
written by hand in the same shape, so the kits ran offline with no AWS credentials
(Node 26.8.2, Python 3.12.3).
Milestone 1. Every exhibit is the kit’s own output, unedited, with the time it ran and its exit code. The work list under them is what a quote would price.
lambda-lifeline scan --fixture aws/lambda-inventory.json
▸ Scanning fixture: aws/lambda-inventory.json
ℹ Scanned 15 functions · 0 healthy · 15 at risk
Function Runtime Region Severity Days Target
---------------------------------------------------------------------------------------------------
qt-dev-quote-api nodejs20.x us-east-1 high 114 nodejs24.x
qt-dev-label-render nodejs20.x us-east-1 high 114 nodejs24.x
qt-dev-manifest-import python3.10 us-east-1 high 114 python3.12
qt-dev-rate-sync python3.11 us-east-1 medium 295 python3.12
qt-dev-scan-ingest provided.al2 us-east-1 high 114 provided.al2023
qt-staging-quote-api nodejs20.x us-east-1 high 114 nodejs24.x
qt-staging-label-render nodejs20.x us-east-1 high 114 nodejs24.x
qt-staging-manifest-import python3.10 us-east-1 high 114 python3.12
qt-staging-rate-sync python3.11 us-east-1 medium 295 python3.12
qt-staging-scan-ingest provided.al2 us-east-1 high 114 provided.al2023
qt-prod-quote-api nodejs20.x us-east-1 high 114 nodejs24.x
qt-prod-label-render nodejs20.x us-east-1 high 114 nodejs24.x
qt-prod-manifest-import python3.10 us-east-1 high 114 python3.12
qt-prod-rate-sync python3.11 us-east-1 medium 295 python3.12
qt-prod-scan-ingest provided.al2 us-east-1 high 114 provided.al2023
⚠ Next: run `lambda-lifeline codemod --path <your-repo>` then `audit`, `iac`, and `deploy`. Severity and Days count to the kit’s own block-update date, 3 Mar 2027. That date is out of date: AWS’s runtimes table, verified 10 Nov 2026, says update blocked 31 Aug 2027. Fixed in the next kit release.
Lambda dates: see AWS’s runtimes table
lambda-lifeline iac --path services
▸ IaC patcher · services · nodejs14.x,nodejs16.x,nodejs18.x,nodejs20.x,nodejs22.x → nodejs24.x · DRY-RUN
scanning 3 candidate file(s)
ℹ [SAM/CFN] services/template.yaml · 2 runtime ref(s): nodejs20.x, nodejs20.x
✓ 1 file(s) · 2 runtime ref(s) would be updated.
ℹ Re-run with --apply to write changes. Review diff with `git diff`. Preview only: nothing was written. This kit patches Node.js runtimes; the Python and provided.al2 lines are on the work list below.
lambda-lifeline audit --path services/label-render
▸ Audit native dependencies · services/label-render/package.json
⚠ sharp UPGRADE declared 0.32.6 → need ≥ 0.33.0
libvips native binding; verify the current release on Node.js 24.
⚠ 1 native dep(s) need action before Node.js 24.
ℹ Next: bump versions in package.json, run `npm install && npm rebuild`, then `npm test`. lambda-lifeline audit --path services/quote-api
▸ Audit native dependencies · services/quote-api/package.json
⚠ bcrypt UPGRADE declared 5.0.1 → need ≥ 5.1.1
Native bcrypt. Consider bcryptjs for pure-JS drop-in.
⚠ 1 native dep(s) need action before Node.js 24.
ℹ Next: bump versions in package.json, run `npm install && npm rebuild`, then `npm test`. al2023-gate scan --fixture aws/ec2-inventory.json
▸ Scanning fixture aws/ec2-inventory.json
ℹ Scanned 7 resource(s). 6 AL2, 0 AL1
Type Id Region Platform Severity
--------------------------------------------------------------------------------------------
launch_template lt-0c7a1e9f3b5d20481 us-east-1 al2 critical-eol
ec2_instance i-0d4f6a8c0e2b41357 us-east-1 al2 critical-eol
ec2_instance i-0e5a7b9c1d3f52468 us-east-1 al2 critical-eol
launch_template lt-03b5d7f9a1c360592 us-east-1 al2 critical-eol
ec2_instance i-0f6b8c0d2e4a63579 us-east-1 al2 critical-eol
ec2_instance i-07c9d1e3f5a274680 us-east-1 al2 critical-eol
ec2_instance i-01a3c5e7f9b285791 us-east-1 al2023 ok
⚠ AL2 EOL: 131 day(s) ago. Next: `al2023-gate packer` to scaffold an AL2023 AMI build. The day count runs from AWS’s published end of support, 30 Jun 2026. One dev host was already moved by hand, so it reads ok.
al2023-gate cloudinit hosts/user-data.sh
▸ cloud-init diff · 1 file(s)
hosts/user-data.sh
[medium] line 5: yum-to-dnf
yum update -y
→ `yum` still works as a compat alias on AL2023 but is deprecated.
✎ Replace `yum` with `dnf` for forward compatibility.
[medium] line 7: yum-to-dnf
yum install -y python3 jq
→ `yum` still works as a compat alias on AL2023 but is deprecated.
✎ Replace `yum` with `dnf` for forward compatibility.
[critical] line 6: amazon-linux-extras
amazon-linux-extras install nginx1 -y
→ `amazon-linux-extras` does NOT exist on AL2023.
✎ Move the packages to mainline dnf install commands (see `al2023-gate remap`).
[critical] line 13: python2-shebang
#!/usr/bin/python
→ Python 2 is removed. `#!/usr/bin/python` will 404 on AL2023.
✎ Use `#!/usr/bin/env python3` or `#!/usr/bin/python3.11`.
[high] line 9: ntp-service
systemctl enable ntpd
→ `ntpd` is not installed by default on AL2023 (chrony replaces it).
✎ Use `systemctl enable --now chronyd` and remove ntpd package references.
[high] line 10: ntp-service
systemctl start ntpd
→ `ntpd` is not installed by default on AL2023 (chrony replaces it).
✎ Use `systemctl enable --now chronyd` and remove ntpd package references.
⚠ 6 finding(s) across 1 file(s). Line numbers refer to hosts/user-data.sh, linked on sheet 1.
al2023-gate remap --file hosts/packages.txt
AL2 PACKAGE AL2023 EQUIVALENT CATEGORY NOTE
---------------------------------------------------
nginx1 nginx renamed AL2 extras `nginx1` → AL2023 `nginx` (mainline).
python3 python3 unknown Not in our curated remap table; verify it exists in AL2023.
jq jq unknown Not in our curated remap table; verify it exists in AL2023.
ntp chrony replaced_by ! ntpd is removed. AL2023 uses chrony for time sync.
yum-utils dnf-utils renamed DNF replaces YUM. `yum-config-manager` is now `dnf config-manager`.
docker docker extras_to_dnf ! AL2 used `amazon-linux-extras install docker`. AL2023: `dnf install docker`. Read from the exhibits and the files. Each row is one change, where it lives, and how it gets made. Line numbers are looked up in the files when this page is built.
nodejs20.x → nodejs24.x AWS Transform where it fits · reviewed nodejs20.x → nodejs24.x AWS Transform where it fits · reviewed python3.10 → python3.12 AWS Transform where it fits · reviewed python3.11 → python3.12 By hand · tested provided.al2 → provided.al2023 By hand · tested 0.32.6 → 0.33.0 or later By hand · tested 5.0.1 → 5.1.1 or later By hand · tested amzn2-ami-kernel-5.10 → al2023-ami-*-kernel-6.1 IaC change amazon-linux-2 → amazon-linux-2023 IaC change amazon-linux-extras → dnf install nginx Host change Python 2 → Python 3 Host change One environment at a time, in this order. Production is run by the client’s engineer, never by me: I hold no production credentials.
Written, not executed No cutover has been run on this estate. This line changes only when a recorded demo cutover and rollback exist.
| Environment | Who runs it | When |
|---|---|---|
| dev | Me, after the inventory, with dev deploy rights | Milestone 1, days 1–3 |
| staging | Me, with staging deploy rights. Rollback rehearsed here | Days 4–10 |
| prod | Quarrytide’s engineer, under their own MFA identity, from this runbook. I watch | Days 13–15, in their window |
lambda-lifeline plan --function qt-staging-quote-api
▸ Deploy plan for qt-staging-quote-api
1. Verify alias "live" has one stable version and every alarm is OK
2. Update function runtime → nodejs24.x
3. Publish new version (N+1)
4. Shift 5% of traffic to N+1 with weighted routing · hold 10 min · check alarms
5. Shift 25% of traffic to N+1 with weighted routing · hold 10 min · check alarms
6. Shift 50% of traffic to N+1 with weighted routing · hold 10 min · check alarms
7. Cut alias to N+1 · hold 10 min · check alarms
8. On any alarm trip: auto-rollback alias to LATEST_STABLE and halt
ℹ Run with `deploy --apply` to execute. Staging first. Production uses the same plan with Quarrytide’s CloudWatch alarm as the guard.
al2023-gate runbook --kind asg --name qt-staging-dispatch-asg --region us-east-1
# EC2 Auto Scaling Group — AL2 → AL2023 swap
Target: ASG `qt-staging-dispatch-asg` in `us-east-1`.
Approach: rolling replacement via new Launch Template version + `instance-refresh`.
## Pre-flight
- [ ] New AL2023 AMI built and tagged (`al2023-gate packer --out ./build/`)
- [ ] AL2023 AMI tested in a staging ASG with real traffic for ≥24h
- [ ] Target tracking / step-scaling policies reviewed
- [ ] CloudWatch alarms for HealthyHostCount and TargetResponseTime exist
- [ ] Cordon window communicated to stakeholders
## Execute
1. Create new Launch Template version pointing at the AL2023 AMI id:
```bash
aws ec2 create-launch-template-version \
--launch-template-id $LT_ID \
--version-description "AL2023 migration" \
--source-version $(aws ec2 describe-launch-template-versions \
--launch-template-id $LT_ID --versions '$Latest' \
--query 'LaunchTemplateVersions[0].VersionNumber' --output text) \
--launch-template-data '{"ImageId":"ami-xxxxxxxx"}'
```
2. Update ASG to use `$Latest`:
```bash
aws autoscaling update-auto-scaling-group \
--auto-scaling-group-name qt-staging-dispatch-asg \
--launch-template "LaunchTemplateId=$LT_ID,Version=\$Latest"
```
3. Start instance refresh with canary warm-up:
```bash
aws autoscaling start-instance-refresh \
--auto-scaling-group-name qt-staging-dispatch-asg \
--strategy Rolling \
--preferences '{"MinHealthyPercentage":90,"InstanceWarmup":300,"CheckpointPercentages":[25,50,75,100],"CheckpointDelay":600}'
```
4. Watch CloudWatch alarms + ASG event log for 60 min.
## Rollback
```bash
aws autoscaling start-instance-refresh --auto-scaling-group-name qt-staging-dispatch-asg --preferences '{"MinHealthyPercentage":90}'
# with LT version rolled back first:
aws autoscaling update-auto-scaling-group --auto-scaling-group-name qt-staging-dispatch-asg \
--launch-template "LaunchTemplateId=$LT_ID,Version=<previous-version>"
``` Generated by the kit for the staging group; ami-xxxxxxxx is filled in once the AL2023 image is built and tested.
Every change on sheet 3 has a way back, written before the change is made. In a sprint one of these is executed on staging, and that run is acceptance check A3.
Not rehearsed · demo Written, not executed, like the runbook.
Point the live alias back at the last stable version. The deploy plan does this on its own if an alarm trips at any traffic step.
lambda-lifeline rollback --function <name> --alias live --apply
Exhibit 3.1, step 8
Set the Auto Scaling group back to the previous launch template version, then start an instance refresh.
aws autoscaling update-auto-scaling-group … Version=<previous-version>
Exhibit 3.2, Rollback
The same launch template swap on the workers’ Auto Scaling group, draining tasks before each instance is replaced.
aws autoscaling start-instance-refresh …
Exhibit 3.2, Rollback
The same scan with --strict exits 1 while any Amazon Linux 2 resource remains, so a pipeline stops on it. In a sprint the gate runs on every commit, and check A4 proves it trips.
al2023-gate scan --fixture aws/ec2-inventory.json --strict
▸ Scanning fixture aws/ec2-inventory.json
ℹ Scanned 7 resource(s). 6 AL2, 0 AL1
Type Id Region Platform Severity
--------------------------------------------------------------------------------------------
launch_template lt-0c7a1e9f3b5d20481 us-east-1 al2 critical-eol
ec2_instance i-0d4f6a8c0e2b41357 us-east-1 al2 critical-eol
ec2_instance i-0e5a7b9c1d3f52468 us-east-1 al2 critical-eol
launch_template lt-03b5d7f9a1c360592 us-east-1 al2 critical-eol
ec2_instance i-0f6b8c0d2e4a63579 us-east-1 al2 critical-eol
ec2_instance i-07c9d1e3f5a274680 us-east-1 al2 critical-eol
ec2_instance i-01a3c5e7f9b285791 us-east-1 al2023 ok
⚠ AL2 EOL: 131 day(s) ago. Next: `al2023-gate packer` to scaffold an AL2023 AMI build. One per environment; production is shown. The method comes from the Migration Acceptance Kit: agree the pass condition before work starts, account for every quoted item, and write down what the pack does not check.
Production is accepted when every quoted resource is migrated or excluded by a written rule, none is still deprecated or missing, every new one is explained, and checks A1 to A5 pass.
| Resource | Kind | From → to | At the re-run |
|---|---|---|---|
qt-prod-quote-api | Lambda function | nodejs20.x → nodejs24.x | Not run · demo |
qt-prod-label-render | Lambda function | nodejs20.x → nodejs24.x | Not run · demo |
qt-prod-manifest-import | Lambda function | python3.10 → python3.12 | Not run · demo |
qt-prod-rate-sync | Lambda function | python3.11 → python3.12 | Not run · demo |
qt-prod-scan-ingest | Lambda function | provided.al2 → provided.al2023 | Not run · demo |
lt-0c7a1e9f3b5d20481 | Launch template | Amazon Linux 2 → AL2023 | Not run · demo |
i-0d4f6a8c0e2b41357 | EC2 host | Amazon Linux 2 → AL2023 | Not run · demo |
i-0e5a7b9c1d3f52468 | EC2 host | Amazon Linux 2 → AL2023 | Not run · demo |
i-07c9d1e3f5a274680 | ECS container instance | Amazon Linux 2 → AL2023 | Not run · demo |
Unsigned · Demo — fictional company, synthetic data
The data-migration version of this method is free to read: the acceptance checklist
Kits run This output stays as printed. A re-run on a later day changes the day counts, not the findings.
Describe the AWS account, the environments and what is still on a dead runtime. A fixed scope and price come back in writing within 1 business day, with these checks written in.
Read the End-of-Life Migration Sprint scope