LoginSignup
0

More than 3 years have passed since last update.

【terraform】 slack の auth_token が設定できない時

Last updated at Posted at 2021-03-06

概要

google_monitoring_notification_channelauth_token の設定方法が分からなかったので、2021/03/06 現在で、設定ができた方法を残す。

手順

  1. 新しく追加 をクリックする

image.png

  1. Slackワークスペース にアクセスする権限を 許可する

image.png

  1. ネットワークログを確認し、slack.com/api/auth.test でフィルタリングする
Request URL: https://slack.com/api/auth.test?token=XXX
  1. 上記のクエリパラメータ の token に対するバリューを auth_token として、terraform で設定する
resource "google_monitoring_notification_channel" "default" {
  display_name = "インシデント通知"
  type         = "slack"
  labels = {
    "channel_name" = "#gcp-incident"
  }
  sensitive_labels {
    auth_token = "XXX"
  }
}

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0