exam questions

Exam AWS Certified DevOps Engineer - Professional DOP-C02 All Questions

View all questions & answers for the AWS Certified DevOps Engineer - Professional DOP-C02 exam

Exam AWS Certified DevOps Engineer - Professional DOP-C02 topic 1 question 34 discussion

A company is using AWS CodePipeline to automate its release pipeline. AWS CodeDeploy is being used in the pipeline to deploy an application to Amazon Elastic Container Service (Amazon ECS) using the blue/green deployment model. The company wants to implement scripts to test the green version of the application before shifting traffic. These scripts will complete in 5 minutes or less. If errors are discovered during these tests, the application must be rolled back.
Which strategy will meet these requirements?

  • A. Add a stage to the CodePipeline pipeline between the source and deploy stages. Use AWS CodeBuild to create a runtime environment and build commands in the buildspec file to invoke test scripts. If errors are found, use the aws deploy stop-deployment command to stop the deployment.
  • B. Add a stage to the CodePipeline pipeline between the source and deploy stages. Use this stage to invoke an AWS Lambda function that will run the test scripts. If errors are found, use the aws deploy stop-deployment command to stop the deployment.
  • C. Add a hooks section to the CodeDeploy AppSpec file. Use the AfterAllowTestTraffic lifecycle event to invoke an AWS Lambda function to run the test scripts. If errors are found, exit the Lambda function with an error to initiate rollback.
  • D. Add a hooks section to the CodeDeploy AppSpec file. Use the AfterAllowTraffic lifecycle event to invoke the test scripts. If errors are found, use the aws deploy stop-deployment CLI command to stop the deployment.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
haazybanj
Highly Voted 1 year, 6 months ago
Add a hooks section to the CodeDeploy AppSpec file. The AppSpec file is a YAML file that describes how to deploy an application to Amazon ECS using CodeDeploy. We can use the AfterAllowTestTraffic lifecycle event to run the test scripts. This event is triggered after the new version of the application is deployed, and before traffic is shifted to the new version. In the AfterAllowTestTraffic lifecycle event, invoke an AWS Lambda function to run the test scripts. The Lambda function can be written in any programming language supported by Lambda, such as Python, Node.js, or Java. If the test scripts detect any errors, exit the Lambda function with an error code. This will cause the deployment to fail, and CodeDeploy will initiate a rollback.
upvoted 10 times
...
zijo
Most Recent 8 months, 1 week ago
AfterAllowTestTraffic lifecycle event in the hooks section will not shift the whole traffic to the green application but only a small percentage of traffic to the newly deployed version. C is the answer
upvoted 1 times
...
dzn
8 months, 3 weeks ago
Selected Answer: C
CodeDeploy Blue/Green deployments, the AfterAllowTestTraffic hook is triggered after the test traffic redirection to the new version (Green) is set. Additional verification, testing, or other custom actions can be automated by executing Lambda functions at this time.
upvoted 2 times
...
thanhnv142
9 months, 2 weeks ago
C is correct: we can initiate the script using lambda for advanced features A and B are wrong: Both trigger the test script befor deploy stages D is wrong: It only stops the deployment, not rollback it
upvoted 4 times
...
ixdb
1 year, 3 months ago
C is right.
upvoted 1 times
...
madperro
1 year, 5 months ago
Selected Answer: C
C is the right answer. https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#appspec-hooks-ecs
upvoted 4 times
...
haazybanj
1 year, 6 months ago
Selected Answer: C
The correct solution to meet these requirements is option C. Explanation: In this scenario, the requirement is to add scripts to test the green version of the application before shifting traffic. These scripts should be executed quickly and, in case of errors, the application must be rolled back. To achieve this, we can use the following steps:
upvoted 1 times
...
ele
1 year, 7 months ago
Selected Answer: C
Lifecycle event hooks for an Amazon ECS deployment: AfterAllowTraffic – Use to run tasks after the second target group serves traffic to the replacement task set. The results of a hook function at this lifecycle event can trigger a rollback.
upvoted 1 times
ele
1 year, 7 months ago
Correction: AfterAllowTestTraffic – Use to run tasks after the test listener serves traffic to the replacement task set. The results of a hook function at this point can trigger a rollback.
upvoted 1 times
...
...
alce2020
1 year, 7 months ago
Selected Answer: C
C is the correct answer
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago