A large IT company has used AWS ECS to deploy dozens of Microservices.
There is a new requirement from management to report any state change of either ECS container instances or ECS tasks to a group channel in Microsoft Teams.
The notification messages should be nicely readable and sent immediately whenever a status change happens.
Which two methods in combinations can achieve this requirement? (Select TWO)
Click on the arrows to vote for the correct answer
A. B. C. D. E.Correct Answer - B, E.
In this case, notifications are expected to be sent immediately when there is a state change for ECS.
CloudWatch Events should be considered as it integrates with ECS and can trigger a CloudWatch Event for its target.
About the examples of Amazon ECS CloudWatch events, please refer to.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html.Option A is incorrect: Because there is no other option that helps to trigger the EC2 instance to process the notifications.
Option B is CORRECT: Because CloudWatch Events can trace the status change of both ECS container instance and ECS task as below:
Option C is incorrect: Option B already states that the target is Lambda.
Therefore this option cannot work with Option.
B.Option D is incorrect: Because it is not straightforward to use CloudWatch Metrics to track the state change.
There are no proper metrics to indicate that a status change has happened clearly.
Check.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cloudwatch-metrics.htmlfor the supported ECS Metrics in CloudWatch.
Option E is CORRECT: Because Lambda provides the computer function to generate messages.
Together with Option B, the required features can be achieved.
To achieve the requirement of reporting any state change of either ECS container instances or ECS tasks to a group channel in Microsoft Teams with nicely readable notification messages sent immediately, we can use a combination of two methods out of the given options.
Option A: Create a T2 micro instance to handle the customized notifications. Integrate with Microsoft Teams via its Incoming Webhook.
This option involves creating a T2 micro instance to handle the customized notifications and integrating it with Microsoft Teams via its Incoming Webhook. An incoming webhook is a simple way to post messages from external sources into a Microsoft Teams channel. The T2 micro instance can be used to generate the notification message in the required format and then send it to the Microsoft Teams channel using the Incoming Webhook integration. This option provides a flexible and customizable solution for sending notifications in the required format and to the desired channel.
Option B: Add a new CloudWatch Events rule for status change of ECS. Add a Lambda function as the target when an event is triggered.
This option involves adding a new CloudWatch Events rule for the status change of ECS and adding a Lambda function as the target when an event is triggered. CloudWatch Events is a service that enables you to respond to state changes in AWS resources. A CloudWatch Events rule can be created to trigger a Lambda function when a state change occurs in the ECS container instances or tasks. The Lambda function can then generate the notification message in the required format and send it to the Microsoft Teams channel. This option provides an automated solution for sending notifications whenever a state change occurs, without requiring any manual intervention.
Option C: Configure a new SNS topic called ECS_Status_Change. Register the SNS as the trigger of a Lambda function to generate custom readable alarms.
This option involves configuring a new SNS topic called ECS_Status_Change and registering it as the trigger of a Lambda function to generate custom readable alarms. Amazon SNS (Simple Notification Service) is a fully managed messaging service that enables you to send messages from one service to another or to a set of subscribers. A Lambda function can be created to analyze the state change event in ECS and generate a custom readable alarm message, which can then be sent to the Microsoft Teams channel via the SNS topic. This option provides a scalable solution for sending notifications to multiple subscribers or channels, with customizable alarm messages.
Option D: Set up alarms in ECS CloudWatch Metrics. When the state of either ECS instance or ECS task changes, generate an alarm to trigger an SNS topic.
This option involves setting up alarms in ECS CloudWatch Metrics and generating an alarm to trigger an SNS topic when the state of either ECS instance or ECS task changes. CloudWatch Metrics is a service that enables you to collect and monitor metrics from various AWS resources, including ECS. An alarm can be set up to trigger an SNS topic when a state change occurs in the ECS container instances or tasks. The SNS topic can then be configured to send the notification message to the Microsoft Teams channel. This option provides an automated solution for sending notifications whenever a state change occurs, with the added benefit of monitoring and analyzing the metrics.
Option E: Create a Lambda function to analyze the state change event in ECS and then provide an appropriate message to the channel in Microsoft Teams.
This option involves creating a Lambda function to analyze the state change event in ECS and provide an appropriate message to the channel in Microsoft Teams. The Lambda function can be used to analyze the state change event in ECS and generate a notification message in the required format. The message can then be sent to the Microsoft Teams channel using the Microsoft Teams API. This option provides a customizable solution for sending notifications in the required format and to the desired channel, with the added benefit of analyzing the state change event in ECS.
In conclusion, the two methods in combination that can