‘What should a SysOps administrator do to meet this requirement?
Create a user data script that sends an email message through a smart host connector. Include the architecture team’s email address in the user data script as the recipient. Ensure that all new EC2 instances include the user data script as part of a standardized build process.
Create an Amazon Simple Notification Service (Amazon SNS) topic and a subscription that uses the email protocol. Enter the architecture team’s email address as the subscriber. Create an Amazon EventBridge rule that reacts when EC2 instances are launched. Specify the SNS topic as the rule’s target.
Create an Amazon Simple Queue Service (Amazon SQS) queue and a subscription that uses the email protocol. Enter the architecture team’s email address as the subscriber. Create an Amazon EventBridge rule that reacts when EC2 instances are launched. Specify the SQS queue as the rule’s target.
Create an Amazon Simple Notification Service (Amazon SNS) topic. Configure AWS Systems Manager to publish EC2 events to the SNS topic. Create an AWS Lambda function to poll the SNS topic. Configure the Lambda function to send any messages to the architecture team’s email address.
Explanations:
A user data script cannot trigger email notifications for EC2 launches; it is designed to execute commands when instances start, not for notifying external parties about events like instance creation.
Using Amazon SNS with EventBridge is the correct solution. EventBridge can capture EC2 launch events, and SNS can send immediate email notifications to the architecture team.
While SQS could be used to capture events, it is designed for queueing messages for later processing, not for immediate email notifications, making it less suitable for this requirement.
Although SNS and Lambda could be used, the architecture is unnecessarily complicated and indirect. EventBridge directly integrates with SNS, providing a simpler solution without the need for Lambda.