DOP-C02 exam dumps

DOP-C02 practice question 211 of 411

AWS Certified DevOps Engineer - Professional. Professional level, Amazon Web Services. Free question with the correct answer and a full explanation.

DOP-C02 Question 211

Select 2

Your organization is using a CI/CD pipeline on AWS to deploy a serverless application built with AWS Lambda. The pipeline uses AWS CodePipeline, AWS CodeBuild, and AWS CloudFormation. Recently, deployments have been failing because of inconsistent Lambda function versions being deployed to production. How can you ensure that only the expected version of the Lambda function is deployed, while allowing for rollback if necessary?

  1. A

    Use AWS CodeDeploy to deploy the Lambda function and enable traffic shifting with weighted aliases.

  2. B

    Manually validate the Lambda function version in the CodePipeline stages.

  3. C

    Enable versioning for the Lambda function and use aliases to refer to specific versions in the deployment process.

  4. D

    Configure the CodeBuild project to output the Lambda function version and use that as an input to the next stage in CodePipeline.

  5. E

    Use AWS CloudFormation to directly invoke the Lambda function during deployment for validation.

Show answer and explanation

Correct answers: A, C

Explanation

To ensure consistency and enable rollback during a Lambda function deployment, it is best to use AWS CodeDeploy with traffic shifting and weighted aliases, as this enables controlled deployment and rollback mechanisms. Additionally, enabling Lambda function versioning and using aliases ensures that specific versions are referenced in the deployment process, reducing the risk of deploying an incorrect version.

  • A. Correct.

    Correct. Using AWS CodeDeploy with traffic shifting and weighted aliases ensures deployment of the expected Lambda function version and supports rollback by controlling traffic between versions.

  • B. Incorrect.

    Incorrect. Manually validating versions is error-prone, inefficient, and not an automated solution suitable for a CI/CD pipeline.

  • C. Correct.

    Correct. Enabling versioning and using aliases allows you to specify and deploy exact versions of the Lambda function, mitigating the risk of deploying unintended versions.

  • D. Incorrect.

    Incorrect. While CodeBuild can output artifacts, managing Lambda function versions through CodeBuild alone does not solve the problem of inconsistent deployments or provide rollback capabilities.

  • E. Incorrect.

    Incorrect. Invoking the Lambda function for validation is unrelated to ensuring consistent versioning and does not address the issue of deploying the correct version.

Timed practice exam

Take a DOP-C02 practice test under exam conditions

75 questions in 180 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam