
AWS Certified Solutions Architect - Professional
Get started today
Ultimate access to all questions.
Amazon EC2 instances are used by a business to execute applications. The organization intends to use an Auto Scaling group to manage the instances. A solutions architect must ensure that Amazon CloudWatch Logs gathers logs from all new instances as part of this transition. The new Auto Scaling group will begin with an Amazon Linux 2 AMI and no key pair. Which solution satisfies these criteria?
Amazon EC2 instances are used by a business to execute applications. The organization intends to use an Auto Scaling group to manage the instances. A solutions architect must ensure that Amazon CloudWatch Logs gathers logs from all new instances as part of this transition. The new Auto Scaling group will begin with an Amazon Linux 2 AMI and no key pair. Which solution satisfies these criteria?
Explanation:
- Explanation for the answer A:
Option A is correct because it effectively addresses the requirement to have the CloudWatch Logs agent installed and configured on all new EC2 instances launched by the Auto Scaling group. Here's a detailed breakdown:
-
Amazon CloudWatch Agent Configuration: Setting up a specific configuration for monitoring and logging with the CloudWatch agent ensures that the needed logs are collected correctly according to the application requirements.
-
Storing in Amazon S3: Storing the CloudWatch agent configuration in an Amazon S3 bucket allows easy and centralized access to the configuration file, making it readily accessible to any new instance created by the Auto Scaling group.
-
EC2 User Data Script: Using EC2 user data scripts is a common method to run commands during the boot process of an instance. In this case, the script will fetch the CloudWatch agent configuration file from Amazon S3 and then configure and start the CloudWatch agent on the instance.
-
Initial Bootstrap Configuration: This ensures all new instances get the CloudWatch configuration during their initial boot without manual intervention, making the setup consistent and automated.
By leveraging these approaches, you ensure that as new instances get created by the Auto Scaling group, they automatically start sending logs to CloudWatch Logs, fulfilling the requirement seamlessly.