SAA-C03 Question 195
Single answerYour company is using an immutable infrastructure approach to manage its web application environments. The application is deployed using Amazon EC2 instances managed by an Auto Scaling group. A new version of the application needs to be released. Which strategy aligns with the principles of immutable infrastructure?
- A
Update the application on the existing EC2 instances in the Auto Scaling group using a rolling update.
- B
Create a new Auto Scaling group with the updated application version and gradually redirect traffic using an Elastic Load Balancer.
- C
Log in to the existing EC2 instances via SSH and manually update the application code and dependencies.
- D
Stop the current Auto Scaling group, update the application, and restart the same group with the new version.
Show answer and explanation
Correct answer: B
Explanation
The principle of immutable infrastructure involves replacing infrastructure components (e.g., EC2 instances) with new ones rather than modifying existing instances. By creating a new Auto Scaling group with the updated version of the application and gradually redirecting traffic, you ensure consistency, minimize deployment risks, and align with the immutable infrastructure approach.
- A. Incorrect.
This option violates the principles of immutable infrastructure because it updates the application in-place on existing EC2 instances rather than creating new instances with the updated version.
- B. Correct.
This option adheres to immutable infrastructure principles as it involves creating a new set of EC2 instances with the updated application version and shifting traffic to them, avoiding in-place updates.
- C. Incorrect.
This option does not align with immutable infrastructure principles, as manually logging into instances and updating them introduces inconsistencies and risks.
- D. Incorrect.
This option violates immutable infrastructure principles by reusing and modifying the same Auto Scaling group and instances, rather than replacing them with new ones.