aws-cost-anomaly-slack-reactor

command module
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: MIT Imports: 15 Imported by: 0

README

aws-cost-anomaly-slack-reactor

これは、AWSのコスト異常検知に反応するSlack Botです。

Usage

_examplesにサンプルのTerraformコードがあります。 基本的にはSQSを1つ作成して、LambdaをDeployするのが1st Stepです。

その後、AWSコスト異常検知の通知先に設定しているSNSトピックのサブスクリプションとSlackの設定を行います。

Slackの設定。

以下のようなマニュフェストのSlackAppを用意し、Slackにインストールします。

display_information:
  name: aws-cost-anomaly-slack-reactor
  description: AWS Cost Anomaly Detection BOT
  background_color: "#346947"
features:
  app_home:
    home_tab_enabled: true
    messages_tab_enabled: false
    messages_tab_read_only_enabled: false
  bot_user:
    display_name: AWS Cost Anomaly Detection
    always_online: true
oauth_config:
  scopes:
    bot:
      - app_mentions:read
      - chat:write
      - files:write
settings:
  event_subscriptions:
    request_url: https://<deployしたLambdaのLambda Function URL>/slack/events
    bot_events:
      - app_mention
  interactivity:
    is_enabled: true
    request_url: https://<deployしたLambdaのLambda Function URL>/slack/events
  org_deploy_enabled: false
  socket_mode_enabled: false
  token_rotation_enabled: false

その後、SlackのBOT_TOKENや、SINGING_SECRETを設定してLambdaを再デプロイします。 再デプロイ後に、EventSubscriptionのVerificationを実行してください。

SNSの設定。

SNSは https://<deployしたLambdaのLambda Function URL>/amazon-sns にHTTPSの配信設定をしてください。

Documentation

Overview

Command aws-cost-anomaly-slack-reactor is the entry point that runs the reactor handler either as a local HTTP server or as an AWS Lambda function.

Directories

Path Synopsis
internal
costexplorerx
Package costexplorerx provides paginators for AWS Cost Explorer API calls that are not covered by the official aws-sdk-go-v2 paginator helpers.
Package costexplorerx provides paginators for AWS Cost Explorer API calls that are not covered by the official aws-sdk-go-v2 paginator helpers.
Package reactor implements the HTTP handler that reacts to AWS Cost Anomaly SNS notifications by posting anomaly summaries and root-cause cost graphs to Slack, and forwards Slack action responses back as Cost Anomaly feedback.
Package reactor implements the HTTP handler that reacts to AWS Cost Anomaly SNS notifications by posting anomaly summaries and root-cause cost graphs to Slack, and forwards Slack action responses back as Cost Anomaly feedback.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL