fbpx

Setting Up Elastigroup’s Notifications

Elastigroup’s Notifications allow you to receive notifications for different events in the Elastigroup based on SNS or other subscriptions such as Email or HTTP endpoints. This article covers getting started with Elastigroup’s Notifications and customizing the notifications content to meet your needs.

Prerequisites
  • A running Elastigroup
Step 1: Open the Notifications Modal 

In your Elastigroup click on the Actions button and select Add Notifications.

 

 

 

 

 

 

Click the Subscribe or Subscribe to a Notification button.

 

 

 

 

Note: Existing notifications can’t be modified. To make changes create a new notification and remove the old one.

 

Step 2: Configure Notification

For SNS select aws-sns as the Protocol Type and the SNS Topic ARN the notifications will be posted to. To post the notifications to an HTTP/HTTPS endpoints, select web as the Protocol Type and enter the endpoint.

 

Note: Setting up Notifications for additional Platforms such as “email” and “email-json” are currently only available via our API.
Step 3: Event Types

Group Deployment Completed: Triggers a notification when a deployment process has finished successfully (for more information please see: Deploy).

Group Deployment Failed: Triggers a notification when a deployment process has failed to finish with errors.

Group Update Completed: Triggers a notification when the Elastigroup updates successfully. Useful for monitoring Elastigroup updates by other users or provisioning tools.

Instance Launch: Triggers a notification when a new instance is launched in the Elastigroup.

Instance Launch Failed: Triggers a notification when an attempt to launch an instance in the Elastigroup fails.

Instance Terminate: Triggers a notification when an instance is marked for termination. This notification is issued prior to Instance Terminated.

Instance Terminated: Triggers a notification when one of the instances is terminated.

Scale Failed – Group Max Capacity: Triggers a notification when the group hits the max capacity defined in the Elastigroup, preventing additional scale up actions from taking place.

Signal Timeout – Instance Not Ready: Triggers a notification when a signal reaches its timeout. For more on configuring signals for Elastigroups click here.

Unhealthy Instance: Triggers a notification when one of the instances in the group is recognized as unhealthy based on the Health Check configured. The Unhealthy Instance event type also applies to HCS users. For more on configuring Health Checks see our documentation here.

 

Step 4: Format (optional)

In the “Format” field you can optionally change the default output of the notification.

The format of the notification content supports the following variables: instance-id, event, resource-idresource-name,resource-idsubnet-idavailability-zone

To use variables in custom formats, please wrap the variable name with a percentage sign. For example: %resource-id%

 

Default Notification Content:

{
     "event": "<event>",
     "instanceId": "<instance-id>",
     "resourceId": "<resource-id>",
     "resourceName": "<resource-name>"
}

Custom Content Format Example:

{
    "event": "%event%",
    "resourceId": "%resource-id%",
    "resourceName": "%resource-name%",
    "myCustomeKey": "My content is set here",

   "AWS_Account_ID": "1234567890"
}

Custom Content Format Example For Slack Endpoints:

{
  "text": 
    "event: %event%,\n
    instanceId: %instance-id%,\n
    resourceId: %resource-id%,\n
    resourceName: %resource-name%"
}

Instance Launch:

{

"default": "spotinst:notification:instance",

"event": "AWS_EC2_INSTANCE_LAUNCH",

"instanceId": "i-0d1c09565f353e90e",

"resourceId": "sig-675240da",

"resourceName": "ElasticSearch_Test"

}

Instance Terminated:

{
 "default": "spotinst:notification:instance",
 "event": "AWS_EC2_INSTANCE_TERMINATE",
 "instanceId": "i-0d1c09565f353e90e",
 "resourceId": "sig-675240da",
 "resourceName": "ElasticSearch_Test"
}

 

What’s Next