
Answer-first summary for fast verification
Answer: Create an Amazon CloudWatch agent configuration for the workload in AWS Systems Manager Parameter Store Create a Systems Manager document that installs and configures the CloudWatch agent by using the configuration. Create an Amazon EventBridge (Amazon CloudWatch Events)rule on the default event bus with a Systems Manager Run Command target that runs the document whenever an instance enters the running state.
1. Explanation for Answer B: The correct solution for automatically collecting logs from all new instances in an Auto Scaling group is to use AWS Systems Manager and Amazon EventBridge (Amazon CloudWatch Events). Here's why: - First, create an Amazon CloudWatch agent configuration for the workload in AWS Systems Manager Parameter Store. This configuration will define how the CloudWatch agent should collect and send logs. - Next, create a Systems Manager document that installs and configures the CloudWatch agent using the configuration stored in the Parameter Store. This document acts as a set of instructions for the instances to follow during the setup process. - Finally, create an Amazon EventBridge rule on the default event bus with a Systems Manager Run Command target. This rule will trigger whenever an instance enters the running state, causing the Systems Manager Run Command to execute the document you created. As a result, the CloudWatch agent will be installed and configured on the instance automatically. This approach ensures that all new instances launched by the Auto Scaling group will have the CloudWatch agent set up and ready to collect logs, meeting the company's requirements.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company runs applications on Amazon EC2 instances. The company plans to begin using an Auto Scaling group for the instances As part of this transition, a solutions architect must ensure that Amazon CloudWatch Logs automatically collects logs from all new instances. The new Auto Scaling group will use a launch template that includes the Amazon Linux2 AMI and no key pair. Which solution meets these requirements?
A
Create an Amazon CloudWatch agent configuration for the workload Store the CloudWatch agent configuration in an Amazon S3 bucket. Write an EC2 user data script to fetch the configuration file from Amazon S3 Configure the CloudWatch agent on the instance during initial boot
B
Create an Amazon CloudWatch agent configuration for the workload in AWS Systems Manager Parameter Store Create a Systems Manager document that installs and configures the CloudWatch agent by using the configuration. Create an Amazon EventBridge (Amazon CloudWatch Events)rule on the default event bus with a Systems Manager Run Command target that runs the document whenever an instance enters the running state.
C
Create an Amazon CloudWatch agent configuration for the workload Create an AWS Lambda function to install and configure the CloudWatch agent by using AWS Systems Manager Session Manager. Include the agent configuration inside the Lambda package. Create an AWS Config custom rule to identify changes to the EC2 instances and invoke the Lambda function.
D
Create an Amazon CloudWatch agent configuration for the workload Save the CloudWatch agent configuration as part of an AWS Lambda deployment package Use AWS CloudTrail to capture EC2 tagging events and initiate agent installation. Use AWS CodeBuild to configure the CloudWatch agent on the instances that run the workload