AWS Certified Developer – Associate / Question #685 of 557

Question #685

A company operates a front-end application hosted on five Amazon EC2 instances behind an Application Load Balancer (ALB) within an AWS Elastic Beanstalk production environment. A developer must deploy updated application code and simultaneously upgrade the Elastic Beanstalk platform from its current version to a newer version of PHP. The deployment must ensure zero downtime for the application during the process. Which solution satisfies these requirements?

A

Create a duplicate environment with the updated platform version. Deploy the new application code, validate functionality, and perform a CNAME swap once testing is successful.

B

Deploy the new application code using an in-place deployment strategy across all EC2 instances. Test the deployment and roll back to the prior version if issues arise.

C

Execute an immutable deployment to launch new EC2 instances with the updated platform and application code. Redirect traffic to the new instances after they successfully pass health checks.

D

Utilize a rolling deployment to incrementally update the EC2 instances. Deploy the code to a portion of instances, validate, and continue until all are updated. Roll back if tests fail.

Explanation

Answer C is correct because an immutable deployment strategy launches new EC2 instances with the updated PHP platform version and application code. These instances are validated through health checks before traffic is redirected, ensuring zero downtime. This approach is ideal for platform upgrades, as it avoids conflicts between old and new platform versions.

Option A involves creating a duplicate environment and performing a CNAME swap, which is valid for code updates but requires manual environment duplication and is less streamlined for platform upgrades. Option B (in-place deployment) risks downtime and platform version conflicts. Option D (rolling deployment) is unsuitable because rolling updates cannot handle platform version changes, as mixed instances with different platforms would cause instability. Immutable deployment (C) is the only method that safely combines platform and code updates with zero downtime.

Answer

The correct answer is: C