SAA-C03 Question 196
Single answerYour company operates a web application hosted on Amazon EC2 instances behind an Application Load Balancer. To improve reliability and consistency during deployments, you are considering adopting an immutable infrastructure approach. Which of the following strategies aligns with the principles of immutable infrastructure?
- A
Deploy updates by replacing existing EC2 instances with new instances built using a pre-configured AMI.
- B
Log in to the EC2 instances via SSH to apply updates and configuration changes directly.
- C
Use AWS Elastic Beanstalk to deploy updates using the 'Rolling updates with additional batch' deployment policy.
- D
Modify the running EC2 instances in place by applying changes to the configuration files and restarting services.
Show answer and explanation
Correct answer: A
Explanation
Immutable infrastructure emphasizes the replacement of resources (e.g., EC2 instances) with entirely new versions rather than modifying resources in place. This approach ensures consistency, reduces errors, and simplifies rollback. Building new instances using pre-configured AMIs and replacing old instances aligns with this principle.
- A. Correct.
This approach involves replacing old resources with new ones rather than modifying them in place, which adheres to the principles of immutable infrastructure.
- B. Incorrect.
Manually logging into instances to make changes violates the principles of immutable infrastructure, as it introduces inconsistencies and is prone to human error.
- C. Incorrect.
While AWS Elastic Beanstalk's 'Rolling updates with additional batch' deployment policy can reduce downtime during updates, it does not inherently follow immutable infrastructure principles, as it involves modifying existing resources.
- D. Incorrect.
Modifying EC2 instances in place contradicts the immutable infrastructure approach, as it introduces inconsistencies and potential errors.