Blog
Thoughts on engineering, design, and building great products.
CI/CD: Automating Build and Canary Deploy With Rollback
Throughout the series we deployed by typing sam deploy by hand. This article builds CI/CD: a GitHub Actions workflow that builds and validates the template on every push, and deploys safely with canary via CodeDeploy, shifting traffic gradually and rolling back automatically if an error alarm fires. Plus two real traps hit along the way: esbuild missing from the CI PATH, and a circular dependency between the function and the alarm.
Blue/Green Deploy With ALB and Automatic Rollback
In-place deploys have a window where a machine is offline. Blue/green avoids it: stand up a new fleet (green) in parallel, validate it, then shift traffic over with a load balancer — blue stays intact for an instant return. This article builds an ALB, switches the deployment group to blue/green, runs it for real (including a very realistic IAM error), and configures automatic rollback per CloudWatch alarm.
Deploying to an Auto Scaling Group and Deployment Config
From one instance to many: deploying to an Auto Scaling Group. Create a launch template and ASG, attach the deployment group to the ASG, then pick a deployment config (OneAtATime, HalfAtATime, AllAtOnce) to control whether the deploy goes machine by machine or all at once. Plus a key mechanism: CodeDeploy automatically deploys the latest revision to instances the ASG launches later.
CodeDeploy Lifecycle Hooks: Order, Variables, and When a Hook Fails
A deep dive into CodeDeploy's hook layer: what order the lifecycle events run in, which hook fits which job, why ApplicationStop runs from the old revision rather than the new one, the environment variables CodeDeploy passes into your scripts, and what happens when a hook fails — the deploy stops right there, and later events don't run.
CodeDeploy: The First In-Place Deploy to EC2
Opening Part IV: putting artifacts onto EC2 with CodeDeploy. Stand up an instance with the agent, create an application and a deployment group targeted by tag, write appspec.yml with lifecycle hooks, then run the first in-place deploy — watch the agent pull the revision from S3 and run through each lifecycle event until the app actually serves.