
Answer-first summary for fast verification
Answer: Create a new AMI that has the CodeDeploy agent installed Configure the Auto Scaling group's launch template to use the new AM1 Associate the CodeDeploy deployment group with the Auto Scaling group instead of the EC2 instances.
The correct answer is D because it provides an efficient and scalable solution with the least operational overhead for automating the application deployment process. Here is the explanation: 1. **Create a new AMI with the CodeDeploy agent installed**: By creating an Amazon Machine Image (AMI) that already has the AWS CodeDeploy agent pre-installed, you eliminate the need to manually install the agent on new instances. This reduces deployment complexity and operational overhead. 2. **Configure the Auto Scaling group's launch template to use the new AMI**: Updating the launch template to use this new AMI ensures that all new instances launched by the Auto Scaling group automatically have the CodeDeploy agent installed. This setup ensures that any instance scaling up in the group is deployment-ready. 3. **Associate the CodeDeploy deployment group with the Auto Scaling group**: Instead of manually associating newly launched instances with the CodeDeploy deployment group, associating the deployment group directly with the Auto Scaling group ensures automatic inclusion of all instances in that group. This means any new instance launched into the Auto Scaling group is automatically part of the deployment group, streamlining the deployment process. Overall, this approach leverages built-in AWS features to minimize manual intervention and ensures that the deployment process is automated and consistent, even as the environment scales.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company has an application that runs on Amazon EC2instances in an Amazon EC2 Auto Scaling group. The company uses AWS CodePipeline to deploy the application. The instances that run in the Auto Scaling group are constantly changing because of scaling events. When the company deploys new application code versions, the company installs the AWS CodeDeploy agent on any new target EC2 instances and associates the instances with the CodeDeploy deployment group. The application is set to go live within the next 24 hours. What should a solutions architect recommend to automate the application deployment process with the LEAST amount of operational overhead?
A
Configure Amazon EventBridge (Amazon CloudWatch Events) to invoke an AWS Lambda function when anew EC2 instance is launched into the Auto Scaling group. Code the Lambda function to associate the EC2 instances with the CodeDeploy deployment group.
B
Write a script to suspend Amazon EC2 Auto Scaling operations before the deployment of new code When the deployment is complete. create a new AMI and configure the Auto Scaling group's launch template to use the new AMI for new launches. Resume Amazon EC2 Auto Scaling operations.
C
Create a new AWS CodeBuild project that creates a new AMI that contains the new code. Configure CodeBuild to update the Auto Scaling group's launch template to the new AMl. Run an Amazon EC2 Auto Scaling instance refresh operation.
D
Create a new AMI that has the CodeDeploy agent installed Configure the Auto Scaling group's launch template to use the new AM1 Associate the CodeDeploy deployment group with the Auto Scaling group instead of the EC2 instances.