How-to Guide: Slack integrations for Cost Anomaly Detection using AWS Chatbot

Introduction

AWS Cost Anomaly Detection uses advanced Machine Learning technology to identify anomalous spend and root causes, so you can quickly take action. It allows you to configure cost monitors that define spend segments you want to evaluate (e.g., individual AWS services, member accounts, cost allocation tags, cost categories), and lets you set when, where, and how you receive your alert notifications. For each monitor, you can attach multiple alert subscriptions, and with each subscription include a name, a cost impact threshold, and alerting frequency (individual alerts, daily summary, weekly summary).

To make it even easier for you and your teams to have real-time visibility and insights into anomalous spend, you can now receive Cost Anomaly Detection alert notifications in Slack using AWS Chatbot. Follow this tutorial to learn how.

What you will learn

  • How to set up your Cost Anomaly Detection monitors and alert subscriptions
  • How to configure your alert subscriptions using AWS Chatbot to receive alert notifications in Slack

 AWS Experience

Beginner

 Time to Complete

5 minutes

Implementation

You will need the following resources or permissions to proceed with this tutorial:

    • 1.3 — Add an Amazon SNS topic as alert recipient
      • Under Alerting frequency, choose your Individual Alerts.
      • Then choose Create Monitor.
    • 2.1 — Give AWS Chatbot access to Slack
      • After you have added a SNS topic to one or more of your Individual alert anomaly subscriptions, open the AWS Chatbot console.
      • Select Slack as the chat client.
    • 2.1 — Give AWS Chatbot access to Slack (continue) 
      • Grant permission to allow AWS Chatbot to access your Slack workspace.
    • 2.2— Configure your Slack channel 
      • Once you have completed your workspace configurations in the AWS Chatbot console, click on ‘Configure a New Channel’.
      • Provide a configuration name. Optionally, select if you need additional logging performed for your configuration.
      • Find the Slack channel workspace where you want your alerts published. Right-click on the channel and copy the link.
      • Paste the link in the Channel ID text box.
    • 2.3 — Select role settings
      • AWS Chatbot requires an IAM role to perform actions (run CLI commands and respond to interactive messages). Role settings determines what permissions channel members have. Select a Channel IAM role or a User role. You can either reuse an existing IAM role or create a new one from a template.
      • For this tutorial, we created a new IAM role and used the Notification permissions template to grant this IAM role the ability to send and receive notifications, and provided a descriptive name for this new IAM role.
      • Select an appropriate policy to provide channel guardrails. (Contact your administrator if you need additional information on the list of policies for your organization.)
    • 2.4 — Specify SNS topics to use 
      • Select the SNS topic created in your Cost Anomaly Detection Alert subscription (step 1.3). You can select multiple SNS topics from more than one region, granting them all the ability to notify the same Slack channel.
      • Choose Configure.
    • 3.1 — Check that you are receiving your notifications in Slack
      • After all configurations are complete, your Cost Anomaly subscription alerts should appear in your configured Slack channel. Below is an example of a Cost Anomaly alert notification on Slack. The header contains a link that navigates back to the anomaly page where you can find additional details.

Congratulations!

You have integrated Slack with AWS Cost Anomaly Detection using AWS Chatbot!