• Products
  • Get started
  • Documentation
  • Resources

Integrate Opsgenie with Amazon EC2 Auto Scaling

Overview

What does the integration offer?

Amazon EC2 Auto Scaling sends notifications of scale-changing events through SNS. Opsgenieacts as a dispatcher for these notifications, determines the right people to notify based on on-call schedules– notifies them via email, text messages (SMS), phone calls, and iPhone & Android push notifications, and escalates alerts until they are acknowledged or closed.

How does the integration work?

When an alert is created in Amazon EC2 Auto Scaling, an alert is automatically created in Opsgenie through the integration.

Set up the integration

Amazon EC2 Auto Scaling is an API-based integration. Setting it up involves the following steps:

  • Add an Amazon EC2 Auto Scaling integration in Opsgenie

  • Set up a subscription in Amazon EC2 Auto Scaling

Add an Amazon EC2 Auto Scaling integration

If you're using Opsgenie's Free or Essentials plan or if you’re using Opsgenie with Jira Service Management's Standard plan, you can add this integration from your team dashboard only. The Integrations page under Settings is not available in your plan.

  1. Go to Teams and select your team.

  2. Select Integrations on the left navigation and then select Add integration.

Adding the integration from your team dashboard will make your team the owner of the integration. This means Opsgenie will assign the alerts received through this integration to your team only. Follow the rest of the steps in this section to set up the integration.

To add an Amazon EC2 Auto Scaling integration in Opsgenie:

  1. Go to Settings > Integrations.

  2. Select Add integration.

  3. Run a search and select “Amazon EC2 Auto Scaling”.

  4. On the next screen, enter a name for the integration.

  5. Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration.

  6. Select Continue.
    The integration is saved at this point.

  7. Expand the Steps to configure the integration section and copy the integration URL, which includes Opsgenie endpoint and the API key.
    You will use this URL while configuring the integration in Amazon EC2 Auto Scaling later.

  8. Select Turn on integration.
    The rules you create for the integration will work only if you turn on the integration.

Set up a subscription in Amazon EC2 Auto Scaling

1. Create an SNS topic.
For details, see Getting started with Amazon SNS.

2. Add an HTTPS subscription to your topic with the URL you copied while adding the integration in Opsgenie as the endpoint.

EC2 Auto Scaling create subscription

If the configuration is successful, a confirmation alert is created in Opsgenie. For details on how to add an HTTPS subscription, see What is an Amazon SNS?

3. Configure your Auto Scaling group to send notifications to the SNS you created.
For details, see What is EC2 Auto Scaling?

After the notifications configuration is saved, Auto Scaling sends a test notification to Opsgenie that creates an alert.

Sample payload sent from Amazon EC2 Auto Scaling

Create alert payload (in JSON format)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 { "Type": "Notification", "MessageId": "1cf7a0eb-4179-4181-b15b-ea22c5aa0280", "TopicArn": "arn:aws:sns:us-east-1:3779xxxxxx:otoSkeyl", "Subject": "Auto Scaling: test notification for group \"otoskeylGroup\"", "Message": { "StatusCode": "InProgress", "Service": "AWS Auto Scaling", "AutoScalingGroupName": "otoskeylGroup", "Description": "Launching a new EC2 instance: i-257654cf", "ActivityId": "a1920e24-523b-4d71-8abb-c93704c4a01c", "Event": "autoscaling:EC2_INSTANCE_LAUNCH", "Details": { "Availability Zone": "us-east-1d" }, "AutoScalingGroupARN": "arn:aws:autoscaling:us-east-1:37797zxxxxx:autoScalingGroup:59016df3-65d4-4d06-95ba-xxxxxx0:autoScalingGroupName/otoskeylGroup", "Progress": 50, "Time": "2014-12-01T12:30:12.513Z", "AccountId": "377976xxxxx", "RequestId": "a1920e24-523b-4d71-8abb-c93704c4a01c", "StatusMessage": "statusmesic", "EndTime": "2014-12-01T12:30:12.513Z", "EC2InstanceId": "i-257654cf", "StartTime": "2014-12-01T12:29:38.644Z", "Cause": "At 2014-12-01T12:29:29Z a user request update of AutoScalingGroup constraints to min: 1, max: 2, desired: 2 changing the desired capacity from 1 to 2. At 2014-12-01T12:29:37Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 1 to 2." }, "Timestamp": "2014-12-01T09:48:46.429Z", "SignatureVersion": "1", "Signature": "XrsO2wtE0b+xxxxxx1fMuv07uRttlimTUg+rV4U9RmNSSBEdlmyWvtGgpjebsmNv1wkjUsBQOJZjZnpZp5FBn6quAn3twNdRMmMLf15lv6ESbYF8xxxxxxxxxjj/ZLwiH9Pr/cxVYOR0aPQBPDwTYn8w6g=", "SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-f3ecfxxxxxxxxxx", "UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:089311xxxxx:CloudWatchHTTPAlarms:1841c5ca-ddda-450e-bbfb-xxxxxxx" }

Payload parsed by Opsgenie (in JSON format)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "AutoScalingGroupName": "otoskeylGroup", "Service": "AWS Auto Scaling", "Time": "2014-12-01T12:30:12.513Z", "AccountId": "37797xxxxxx", "Event": "autoscaling:EC2_INSTANCE_LAUNCH", "RequestId": "a1920e24-523b-4d71-8abb-c93704c4a01c", "AutoScalingGroupARN": "arn:aws:autoscaling:us-east-1:377976xxxxxxx:autoScalingGroup:xxxxxx-65d4-4d06-95ba-93403737f3d0:autoScalingGroupName/otoskeylGroup", "StatusCode": "InProgress", "Description": "Launching a new EC2 instance: i-257654cf", "ActivityId": "a1920e24-523b-4d71-8abb-c93704c4a01c", "Progress": 50, "StatusMessage": "statusmesic", "EndTime": "2014-12-01T12:30:12.513Z", "EC2InstanceId": "i-257654cf", "StartTime": "2014-12-01T12:29:38.644Z", "Details": { "Availability Zone": "us-east-1d" } }



Additional Help