New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Amazon DOP-C02 Exam - 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:

0/2000 characters
Kimberely
3 months ago
Not sure about the traffic routing in C, feels off.
upvoted 0 times
...
Marti
3 months ago
Blue/green is definitely the way to go here.
upvoted 0 times
...
Meaghan
3 months ago
Surprised that D uses in-place deployment, seems risky!
upvoted 0 times
...
Ivette
4 months ago
I think A could work too, but not as well as B.
upvoted 0 times
...
Kaycee
4 months ago
B is the best choice for blue/green deployments!
upvoted 0 times
...
Tracey
4 months ago
I believe we need to ensure that at least half of the new instances are healthy before routing traffic, so maybe a custom deployment configuration is necessary?
upvoted 0 times
...
Rueben
4 months ago
I'm a bit confused about the difference between the in-place and blue/green deployments. I feel like blue/green is better for minimizing downtime, but I can't recall the specifics.
upvoted 0 times
...
Tiera
4 months ago
I remember practicing a question similar to this, and I think using the BeforeBlockTraffic hook makes sense for deleting temporary files.
upvoted 0 times
...
Lashandra
5 months ago
I think the blue/green deployment strategy is definitely the way to go here, but I'm not sure which deployment configuration to choose.
upvoted 0 times
...
Stephen
5 months ago
This is a lot to consider, but I think I can figure it out. The tricky part will be getting the traffic routing and instance termination right. I'll need to review the documentation closely.
upvoted 0 times
...
Kimbery
5 months ago
Okay, I've got a good handle on this. The blue/green approach with the Application Load Balancer and Auto Scaling group should work well. I just need to make sure I configure the deployment settings properly.
upvoted 0 times
...
Jarvis
5 months ago
Hmm, the requirements seem pretty detailed. I'll need to carefully review the options and make sure I understand how to set up the blue/green deployment correctly.
upvoted 0 times
...
Kirk
5 months ago
This looks like a complex deployment scenario, but I think I can tackle it. The key is using the right AWS CodeDeploy configuration and hooks to automate the process.
upvoted 0 times
...
Coletta
5 months ago
The phrase about no violations makes me lean towards the management representation letter, but we did a practice question that was similar to this and it was tricky.
upvoted 0 times
...
Kati
1 year 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
1 year 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
1 year 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
1 year 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
Mona
1 year ago
D: It's important to use the blue/green deployment configuration in AWS CodeDeploy for automatic instance management and traffic shifting.
upvoted 0 times
...
Sage
1 year ago
C: Using an Application Load Balancer and a blue/green deployment will help meet all the requirements efficiently.
upvoted 0 times
...
Felix
1 year ago
B: Yes, it ensures that traffic is only shifted to healthy instances and minimizes downtime.
upvoted 0 times
...
Erin
1 year ago
A: I agree, the blue/green deployment strategy is definitely the way to go for this scenario.
upvoted 0 times
...
...
Corazon
1 year 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
Lauran
1 year ago
Why: Blue/green deployment minimizes downtime and ensures that traffic is shifted only to healthy instances.
upvoted 0 times
...
Bernardine
1 year ago
Step 1: Use a Blue/Green Deployment Strategy
upvoted 0 times
...
Lauran
1 year ago
Step 1: Use a Blue/Green Deployment Strategy
upvoted 0 times
...
Lauran
1 year ago
B
upvoted 0 times
...
Bernardine
1 year ago
B
upvoted 0 times
...
Bernardine
1 year ago
A
upvoted 0 times
...
...
Leonardo
1 year ago
I prefer option C, it also meets the requirements and uses blue/green deployment.
upvoted 0 times
...
Rosenda
1 year ago
I agree with Breana, using blue/green deployment seems like the best option.
upvoted 0 times
...
Breana
1 year ago
I think the answer is B.
upvoted 0 times
...

Save Cancel