AWS Auto Scaling Group: Troubleshooting Instance Termination Notifications

Configure AWS Services for Instance Termination Notifications

Prev Question Next Question

Question

A financial company has an application deployed in an AWS Auto Scaling Group.

In most cases, the application's traffic is very stable, and the ASG does not scale in or out.

However, since the latest release last week, EC2 instances may fail the health check in Elastic Load Balancer and then be terminated by ASG.

The development team has created an ASG lifecycle hook to access the instance and troubleshoot the issue.

After the instance goes to the state of “Terminating:Wait”, which AWS service can be configured to receive a notification automatically? (Select TWO.)

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

Correct Answer - C, D.

Auto Scaling lifecycle hook has provided users a chance to suspend the scaling process.

The lifecycle hook state is illustrated as below:

When the instance goes to the Wait status, several AWS services can receive a notification.

Check details in.

https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html#preparing-for-notification.

Option C is CORRECT: Because CloudWatch Event is the recommended service to receive notifications when an event happens:

By registering a target such as Lambda, it is very convenient to customize an alert to notify the team for this event.

Option Dis CORRECT: Because SNS can be added as a notification target in AWS CLI command put-lifecycle-hook with the option of --notification-target-arn.

The ARN of the notification target in --notification-target-arn can be either an SQS queue or an SNS topic, according to.

https://docs.aws.amazon.com/cli/latest/reference/autoscaling/put-lifecycle-hook.html.

Option A, B, Eare incorrect: Because these services are unsupported to receive notifications for ASG lifecycle hooks.

EC2_INSTANCE_LAUNCHING
lifecycle hook

EC2_INSTANCE_TERMINATING
lifecycle hook

In this scenario, the application's instances may fail the health check and be terminated by the Auto Scaling Group (ASG). The development team has created an ASG lifecycle hook to troubleshoot the issue when the instance enters the "Terminating:Wait" state. The question is asking which AWS services can be configured to receive notifications automatically when the instance enters this state.

Two services that can be used to receive notifications in this situation are AWS CloudWatch Events and AWS SNS.

AWS CloudWatch Events is a service that allows you to monitor events and respond to them with automated actions. You can configure a CloudWatch Event to trigger an AWS Lambda function that sends a notification when the instance enters the "Terminating:Wait" state.

AWS SNS (Simple Notification Service) is a messaging service that can be used to send notifications to subscribers or endpoints. You can configure an SNS topic to receive notifications from an ASG lifecycle hook, which can then send a message to a subscriber (e.g., email, SMS, etc.).

AWS CloudTrail is a service that records AWS API calls and provides audit logs. CloudTrail is not designed to receive notifications when instances enter a specific state.

AWS Config is a service that provides a detailed inventory of your AWS resources and their configurations. AWS Config is not designed to receive notifications when instances enter a specific state.

AWS Step Functions is a serverless workflow service that allows you to coordinate multiple AWS services. Step Functions is not designed to receive notifications when instances enter a specific state.

Therefore, the correct answers are C. AWS CloudWatch Event and D. AWS SNS.