AWS Certified Solutions Architect Professional SAP-C02 Practice Question
A company is migrating a legacy Java web application, currently running on-premises on Apache Tomcat servers, to AWS Elastic Beanstalk. The development team wants to minimize operational overhead and continue using their existing WAR file-based deployment process. The application requires specific third-party monitoring agents to be installed and several configuration files to be modified on the underlying EC2 instances during every application deployment. A solutions architect needs to design a solution that automates these instance customizations as part of the Elastic Beanstalk deployment process in the most efficient and repeatable way.
Which approach should the solutions architect recommend?
Create a custom launch template with a user data script that installs the agents and configures the files. Associate the launch template with the Elastic Beanstalk environment.
Include configuration files within a .ebextensions directory in the application source bundle to install the agents and apply the required configurations.
After each deployment, use AWS Systems Manager (SSM) Run Command to execute a script on the environment's instances to install the agents and apply configurations.
Create a custom Amazon Machine Image (AMI) with the monitoring agents and configurations pre-baked. Specify this custom AMI in the Elastic Beanstalk environment configuration.
The correct answer is to use .ebextensions configuration files. AWS Elastic Beanstalk uses .ebextensions to allow for deep customization of the environment, including the underlying EC2 instances. By placing YAML or JSON formatted .config files in a .ebextensions directory within the application source bundle, a developer can run commands, install packages, create files, and configure services automatically every time a new version of the application is deployed. This is the most integrated, repeatable, and operationally efficient method for handling customizations that are tied to the application deployment lifecycle.
Creating and maintaining a custom Amazon Machine Image (AMI) is incorrect because it introduces significant operational overhead. While it can be used for pre-installing software, any changes to the required agents or configurations would necessitate creating, testing, and managing a new AMI, which contradicts the goal of minimizing operational overhead. .ebextensions are more flexible for changes tied to application versions.
Using EC2 user data scripts via a custom launch template is incorrect. While user data can customize instances at launch, .ebextensions are the idiomatic and recommended way to perform these actions within the Elastic Beanstalk service. Relying on user data scripts bypasses the integrated configuration management that Elastic Beanstalk provides and can be harder to manage and version with the application code.
Using AWS Systems Manager (SSM) Run Command is incorrect for this use case. SSM Run Command is primarily for ad-hoc administrative tasks, patch management, or state management on a fleet of instances after they are running. It is not designed to be the primary mechanism for bootstrapping instance configurations during an initial Elastic Beanstalk application deployment.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the `.ebextensions` directory in AWS Elastic Beanstalk?
Open an interactive chat with Bash
Why is creating a custom Amazon Machine Image (AMI) less efficient than using `.ebextensions`?
Open an interactive chat with Bash
How do `.ebextensions` compare to EC2 user data scripts for instance customization?
Open an interactive chat with Bash
AWS Certified Solutions Architect Professional SAP-C02
Accelerate Workload Migration and Modernization
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access