Skip to main content

AWS SNS

The AWS SNS integration receives and processes CloudWatch alarms forwarded to Moogsoft Onprem . The integration parses the alarms into Moogsoft Onprem events.

When you use the integrations UI, you can only configure the visible properties. If you want to implement a more complex AWS SNS LAM with custom settings, see Configure the AWS SNS LAM.

See the AWS SNS documentation for details on invoking Lambda functions using AWS SNS.

Before you begin

The AWS SNS integration has been validated with AWS SNS v2016-06-28. Before you start to set up your AWS SNS integration, ensure you have met the following requirements:

  • You have an active AWS account.

  • You have the necessary permissions to create Lambda functions and SNS topics within AWS.

  • You have configured AWS SNS topics for your CloudWatch alarms.

  • AWS SNS can make requests to external endpoints over port 443. This is the default.

Configure the AWS SNS integration

To configure the AWS SNS integration:

  1. Navigate to the Integrations tab.

  2. Click AWS SNS in the Monitoring section.

  3. Follow the instructions to create an integration name.

Configure AWS SNS

To create a Lambda function to trigger on an SNS topic, follow the steps below. For more help, see the AWS SNS Documentation.

  1. Create a role in AWS with the following properties:

    Field

    Value

    Type

    AWS service

    Service

    Lambda

    Policies

    These two policies are required as a minimum:

    AmazonEC2ReadOnlyAccess

    AWSLambdaExecute

  2. Create a Lambda function with the following properties:

    Field

    Value

    Name

    lambdaToMoog

    Runtime

    Node.js v10.x

    Role

    Select the role you created in step 1

  3. Add an SNS trigger to your Lambda function and select the topics to trigger the function.

  4. Download the SNS integration Lambda function.

  5. Upload the zip file in the function code section of the lambToMoog configuration.

    Note

    Unapproved changes to the code are unsupported. Submit any changes to Moogsoft for review.

  6. Configure the environment variables for the lambToMoog function as follows:

    Key

    Value

    MOOG_URL

    <your AWS SNS integration URL>

    For example: https://example.Moogsoft .com/events/sns_awssns1

    MOOG_USER

    Username generated in the Moogsoft Onprem UI.

    MOOG_PASS

    Password generated in the Moogsoft Onprem UI.

  7. Save the function.

Test AWS SNS

You can test the AWS SNS configuration using the following example test event.

Note

JSON is the only supported format for AWS SNS messages.

{
  "Records": [
    {
      "EventSource": "aws:sns",
      "EventVersion": "1.0",
      "EventSubscriptionArn": "arn:aws:sns:us-east-1:347584378564:test-notifications:fe1a2b3c-ab11-1234-a12b-108a1abc1234",
      "Sns": {
        "Type": "Notification",
        "MessageId": "1ab123a1-1a01-12ab-a1b2-12aa0a1abc1a",
        "TopicArn": "arn:aws:sns:us-east-1:347584378564:test-notifications",
        "Subject": "OK: \"Dynatrace EC2 Instance CPU\" in US East (N. Virginia)",
        "Message": "{\"AlarmName\":\"Dynatrace EC2 Instance CPU\",\"AlarmDescription\":\"Dynatrace EC2 Instance Monitoring\",\"AWSAccountId\":\"123412341234\",\"NewStateValue\":\"OK\",\"NewStateReason\":\"Sample SNS integration test event.\",\"StateChangeTime\":\"2018-02-27T16:19:41.353+0000\",\"Region\":\"US East (N. Virginia)\",\"OldStateValue\":\"INSUFFICIENT_DATA\",\"Trigger\":{\"MetricName\":\"CPUUtilization\",\"Namespace\":\"AWS/EC2\",\"StatisticType\":\"Statistic\",\"Statistic\":\"AVERAGE\",\"Unit\":null,\"Dimensions\":[{\"name\":\"InstanceId\",\"value\":\"i-123a1abcdef0a012a\"}],\"Period\":300,\"EvaluationPeriods\":1,\"ComparisonOperator\":\"GreaterThanOrEqualToThreshold\",\"Threshold\":10.0,\"TreatMissingData\":\"- TreatMissingData:                    Breaching\",\"EvaluateLowSampleCountPercentile\":\"\"}}",
        "Timestamp": "2018-02-27T16:19:41.392Z",
        "SignatureVersion": "1",
        "Signature": "signature",
        "SigningCertUrl": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-1234.pem",
        "UnsubscribeUrl": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:347584378564:test-notifications:fe1a2b3c-ab11-1234-a12b-108a1abc1234",
        "MessageAttributes": {}
      }
    }
  ]
}

After you configure the AWS SNS integraton it forwards CloudWatch alarms to Moogsoft Onprem .