BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Amazon Exam DOP-C02 Topic 7 Question 38 Discussion

Actual exam question for Amazon's DOP-C02 exam
Question #: 38
Topic #: 7
[All DOP-C02 Questions]

A company is using AWS CodeDeploy to automate software deployment. The deployment must meet these requirements:

* A number of instances must be available to serve traffic during the deployment Traffic must be balanced across those instances, and the instances must automatically heal in the event of failure.

* A new fleet of instances must be launched for deploying a new revision automatically, with no manual provisioning.

* Traffic must be rerouted to the new environment to half of the new instances at a time. The deployment should succeed if traffic is rerouted to at least half of the instances; otherwise, it should fail.

* Before routing traffic to the new fleet of instances, the temporary files generated during the deployment process must be deleted.

* At the end of a successful deployment, the original instances in the deployment group must be deleted immediately to reduce costs.

How can a DevOps engineer meet these requirements?

Show Suggested Answer Hide Answer
Suggested Answer: C

Step 2: Use an Application Load Balancer and Auto Scaling Group The Application Load Balancer (ALB) is essential to balance traffic across multiple instances, and Auto Scaling ensures the deployment scales automatically to meet demand.

Action: Associate the Auto Scaling group and Application Load Balancer target group with the deployment group.

Why: This configuration ensures that traffic is evenly distributed and that instances automatically scale based on traffic load.

Step 3: Use Custom Deployment Configuration The company requires that traffic be rerouted to at least half of the instances to succeed. AWS CodeDeploy allows you to configure custom deployment settings with specific thresholds for healthy hosts.

Action: Create a custom deployment configuration where 50% of the instances must be healthy.

Why: This ensures that the deployment continues only if at least 50% of the new instances are healthy.

Step 4: Clean Temporary Files Using Hooks Before routing traffic to the new environment, the temporary files generated during the deployment must be deleted. This can be achieved using the BeforeAllowTraffic hook in the appspec.yml file.

Action: Use the BeforeAllowTraffic lifecycle event hook to clean up temporary files before routing traffic to the new environment.

Why: This ensures that the environment is clean before the new instances start serving traffic.

Step 5: Terminate Original Instances After Deployment After a successful deployment, AWS CodeDeploy can automatically terminate the original instances (blue environment) to save costs.

Action: Instruct AWS CodeDeploy to terminate the original instances after the new instances are healthy.

Why: This helps in cost reduction by removing unused instances after the deployment.

This corresponds to Option C: Use an Application Load Balancer and a blue/green deployment. Associate the Auto Scaling group and the Application Load Balancer target group with the deployment group. Use the Automatically copy Auto Scaling group option, and use CodeDeployDefault.HalfAtATime as the deployment configuration. Instruct AWS CodeDeploy to terminate the original instances in the deployment group, and use the BeforeAllowTraffic hook within appspec.yml to delete the temporary files.

Contribute your Thoughts:

Kati
15 days ago
I'm going with option B as well. The requirement to delete temporary files before shifting traffic is a nice touch.
upvoted 0 times
...
Billy
16 days ago
Haha, this question is like a DevOps engineer's dream come true. It's got everything but the kitchen sink!
upvoted 0 times
...
Louvenia
18 days ago
I think option B is the correct answer. It ticks all the boxes - load balancing, automatic instance management, and controlled traffic shifting.
upvoted 0 times
...
Ailene
20 days ago
The blue/green deployment approach seems like the way to go here. Handling traffic shifts and instance management automatically is crucial.
upvoted 0 times
Erin
6 days ago
A: I agree, the blue/green deployment strategy is definitely the way to go for this scenario.
upvoted 0 times
...
...
Corazon
28 days ago
Ah, this question is asking all the right questions! I like how it covers the key requirements for a robust deployment strategy on AWS.
upvoted 0 times
Bernardine
3 days ago
Step 1: Use a Blue/Green Deployment Strategy
upvoted 0 times
...
Lauran
6 days ago
Step 1: Use a Blue/Green Deployment Strategy
upvoted 0 times
...
Lauran
10 days ago
B
upvoted 0 times
...
Bernardine
12 days ago
B
upvoted 0 times
...
Bernardine
21 days ago
A
upvoted 0 times
...
...
Leonardo
1 months ago
I prefer option C, it also meets the requirements and uses blue/green deployment.
upvoted 0 times
...
Rosenda
2 months ago
I agree with Breana, using blue/green deployment seems like the best option.
upvoted 0 times
...
Breana
2 months ago
I think the answer is B.
upvoted 0 times
...

Save Cancel