AWS Certified DevOps Engineer - Professional Practice Questions

AWS Certified DevOps Engineer - Professional (DOP-C02) exam preparation

AWS Certified DevOps Engineer - Professional practice questions in English: 180 questions with explanations. The mock exam has 75 questions and 180 minutes.

AWS Certified DevOps Engineer - Professional free question 2 / 10 · Domain 1: SDLC Automation

A SAM template declares a Lambda function with a DeploymentPreference of type Canary10Percent10Minutes and two CloudWatch alarms. The deployment fails with an error, and the function resource has no other properties related to versions or aliases. What is missing?

  1. A Hooks property with pre-traffic and post-traffic functions, as gradual deployments need validation functions to start
  2. A Role property in DeploymentPreference that names the IAM role for CodeDeploy, as SAM does not create one for traffic shifting
  3. An AutoPublishAlias property on the function, which gives the preference an alias to shift traffic on
  4. An Enabled property set to true in DeploymentPreference, as the preference stays off until it is turned on
Show the answer and explanation

Answer: C

Why this is correct
DeploymentPreference turns on gradual Lambda deployments in SAM, with a Type that is either Linear or Canary. The page says you must specify an AutoPublishAlias in the AWS::Serverless::Function to use a DeploymentPreference, otherwise an error results. Enabled, Role and Hooks are not required, and Enabled defaults to True.

Why the other options are wrong
"A Role property in DeploymentPreference that names the IAM role for CodeDeploy, as SAM does not create one for traffic shifting" … Role is optional. When it is left out, SAM creates the role that CodeDeploy uses for traffic shifting. The page says that no role is created when you provide one.
"An Enabled property set to true in DeploymentPreference, as the preference stays off until it is turned on" … Enabled defaults to True, so the preference is already on when the property is left out.
"A Hooks property with pre-traffic and post-traffic functions, as gradual deployments need validation functions to start" … Hooks is optional. It names Lambda functions that run validation before and after traffic shifting, and a deployment can run without them.

Key points
Gradual deployments in SAM need an alias: set AutoPublishAlias on the function before adding DeploymentPreference.

Go to the AWS Certified DevOps Engineer - Professional practice app (10 free questions; purchase unlocks all questions)

See the full practice set