Domain 3 of 4 · Chapter 3 of 4

Automated Deployment Testing

Unlock the complete study guide + 1,040 practice questions across 16 full exams.

Bundled into the existing AWS Certified Developer - Associate premium course — no separate purchase.

Included in this chapter:

  • The one model: a deploy shifts traffic in increments, and a test gates each one
  • CodeDeploy mechanics: predefined deployment configurations and AppSpec validation hooks
  • Automatic rollback and the alias the deploy acts on
  • Exam-pattern recognition: stem cues to the right answer
Deployment configHow traffic shiftsValidation window before full rolloutTypical use
CodeDeployDefault.LambdaAllAtOnce100% of traffic to the new version at onceNone (no incremental gate)Lowest-risk changes or non-prod where speed beats blast-radius control
CodeDeployDefault.LambdaCanary10Percent5Minutes10% first, remaining 90% five minutes later5-minute window to catch failures on 10% of trafficProduction change wanting a real-traffic smoke test before full shift
CodeDeployDefault.LambdaLinear10PercentEvery1Minute10% every minute until 100% is shiftedContinuous: each increment is gated, alarm can halt mid-shiftGradual rollout where metrics are watched throughout
CodeDeployDefault.ECSAllAtOnceAll traffic to the updated ECS task set at onceNone (required config when using a Network Load Balancer)ECS blue/green cutover with no incremental shift

Decision tree

Lambda or ECS servicewith weighted traffic shift?No (EC2 / on-prem)YesIn-place by host healthAllAtOnce / HalfAtATime / OneAtATimeNeed an incremental windowto gate before full rollout?NoYesAllAtOnce100% at once, no gating canaryWatch metrics throughout,alarm can halt mid-shift?No, one smoke testYesCanary10% first, remaining 90% 5 min laterLinear10% every minute, gated

Cheat sheet

  • Automate deployment testing by wiring tests into the release so a failure stops promotion
  • Gate a pipeline with a CodePipeline test action placed before the deploy action
  • Read the four strategies as one model with a different increment size
  • In-place vs blue/green is an orthogonal axis from the increment size
  • In-place is EC2/on-premises only; Lambda and ECS are blue/green only
  • Lambda all-at-once shifts 100 percent immediately, leaving no validation window
  • Canary configs shift a 10 percent slice first, then the rest after a fixed hold
  • Linear configs shift equal slices on a fixed interval, gating every step
  • ECS offers parallel canary and linear configs to Lambda's
  • EC2/on-premises configs are minimum-healthy-host counts, not traffic percentages
  • A Lambda deployment has exactly two scriptable AppSpec hooks: BeforeAllowTraffic and AfterAllowTraffic
  • An ECS deployment adds install hooks plus AfterAllowTestTraffic for a pre-prod test listener
  • An AppSpec hook function must report back with putLifecycleEventHookExecutionStatus
  • Enable automatic rollback to reverse a bad release without a human in the loop
  • Rollback redeploys the last good revision as a new deployment, it does not restore the old one
  • CodeDeploy shifts a Lambda alias's weighted traffic between immutable versions
  • Point staging at an immutable version so production promotes the exact tested artifact
  • Elastic Beanstalk immutable deployment gives the fastest, safest rollback
  • Elastic Beanstalk all-at-once is the quickest policy but drops service during the deploy
  • Elastic Beanstalk rolling deployments update instances in batches, so both versions run at once
  • Elastic Beanstalk traffic splitting is the canary policy: a traffic percentage for an evaluation period
  • Elastic Beanstalk blue/green is a swap of environment URLs, and the database must be decoupled first
  • SAM DeploymentPreference with Alarms is how a Lambda canary auto-rolls-back
  • A CodeDeploy/SAM pre-traffic hook needs lambda:InvokeFunction to test the new version
  • CodeDeploy alarm-based rollback needs cloudwatch:DescribeAlarms on the service role
  • CodeDeploy keeps EC2 instances available during a deploy via MinimumHealthyHosts

Unlock with Premium — includes all practice exams and the complete study guide.

Also tested in

References

  1. What is AWS CodePipeline?
  2. What is AWS CodeBuild?
  3. What is CodeDeploy?
  4. Working with deployment configurations in CodeDeploy
  5. AppSpec 'hooks' section
  6. Redeploy and roll back a deployment with CodeDeploy
  7. Lambda function versions and aliases (traffic shifting)
  8. PutLifecycleEventHookExecutionStatus