Deployment
What you must know
Know the CI/CD stack: CodePipeline stages and actions with artifacts passed through S3, CodeBuild buildspec phases (install, pre_build, build, post_build) and environment variables, and CodeDeploy applications, deployment groups, and the appsec file. For EC2, CodeDeploy supports in-place and blue/green and requires the CodeDeploy agent plus a service role. For Lambda, it offers canary, linear, and all-at-once traffic shifting. For ECS, blue/green targets two task sets behind a load balancer.
Know Elastic Beanstalk deployment policies (all at once, rolling, rolling with additional batch, immutable, and blue/green via URL swap) and CloudFormation fundamentals: templates, parameters, change sets, DeletionPolicy, stack policies, rollback on failure, and drift detection. Know SAM for serverless packaging and the CDK for programmatic infrastructure. For serverless releases, Lambda versions and aliases with weighted routing, plus API Gateway stages and canary settings, are the traffic-shifting tools.
Traps
Thinking $LATEST can receive weighted traffic (only published versions can); forgetting the CodeDeploy agent on EC2; assuming an in-place deployment gives zero downtime; and treating CloudFormation drift as an error rather than a detected difference.
Rule of thumb
Release in small, reversible steps: publish a Lambda version, point an alias at it with 10 percent weight, attach a CloudWatch alarm, and let CodeDeploy roll back automatically if the alarm fires. The same pattern applies to API Gateway canary stages and ECS blue/green.