exam questions

Exam AWS DevOps Engineer Professional All Questions

View all questions & answers for the AWS DevOps Engineer Professional exam

Exam AWS DevOps Engineer Professional topic 1 question 17 discussion

Exam question from Amazon's AWS DevOps Engineer Professional
Question #: 17
Topic #: 1
[All AWS DevOps Engineer Professional Questions]

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 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 an execution 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 execute 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 trigger 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
WhyIronMan
Highly Voted 3 years, 7 months ago
C looks correct, reference: https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#reference-appspec-file-structure-hooks-section-structure-ecs-sample-function
upvoted 23 times
...
scottytoohotty
Most Recent 2 years, 1 month ago
Selected Answer: C
C is the one
upvoted 1 times
...
Piccaso
2 years, 3 months ago
Selected Answer: A
C and D were excluded because AfterAllowTraffic should be BeforeAllowTraffic. B is excluded because Lambda function is not needed. CodeBuild has managed test environment.
upvoted 1 times
Piccaso
2 years, 3 months ago
Sorry, I was wrong. A does not involve rollback action. In C, AfterAllowTestTraffic is the hook we need. And C is the only option involves rollback action.
upvoted 3 times
...
...
Bulti
2 years, 4 months ago
C is the correct answer.
upvoted 1 times
...
ceros399
2 years, 4 months ago
Selected Answer: C
C is correct, you need to run the script, the best option is using lambda
upvoted 1 times
...
developer_404
2 years, 6 months ago
Selected Answer: C
Other answers are just stopping the deployment. Rollback is one of the requirement fulfilled by this answer C
upvoted 4 times
...
ebratz
2 years, 7 months ago
Selected Answer: C
https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html 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 2 times
...
colinquek
2 years, 7 months ago
Selected Answer: C
C A, B - u need to deploy first else there is nth to test. And rem CodeBuild is exactly tt, do code building. D - AfterAllowTraffic means the Green env is alr "live", if there is no "AfterAllowTestTraffic" option (C), then D is the correct one. Since there AfterAllowTestTraffic, its better to chose tt. https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html << take a look at the diagram in this.
upvoted 3 times
apcloud
2 years, 5 months ago
do you really need to abbreviate? it makes it way harder to read your explanation. please stop.
upvoted 5 times
...
...
MikeyJ
2 years, 7 months ago
Selected Answer: C
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. https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html
upvoted 1 times
...
colinquek
2 years, 8 months ago
Selected Answer: B
B - is testing the new deployment, the green env.
upvoted 1 times
...
shiptyeyes
2 years, 8 months ago
Q - "implement scripts to test the green version of the application before shifting traffic" Ans C - "Use the AfterAllowTestTraffic lifecycle event to invoke an AWS Lambda function" Why is everyone picking the answer that tests the code "AfterAllowTestTraffic"?
upvoted 2 times
aws_arn_name
2 years, 7 months ago
Becaus it is "Test" traffic , not real traffic
upvoted 2 times
satz_17
2 years, 6 months ago
yeah, It's ECS deployment and the question says "test the green version of the application before shifting traffic". In codedeploy ECS deployment has a hook "AfterallowTestTraffic" where we can invoke lambda. So the correct answer is C.
upvoted 1 times
...
...
...
arpana_03
3 years, 6 months ago
C is correct answer
upvoted 2 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