Atlassian Operations Terraform プロバイダーを設定する
Atlassian Operations Terraform プロバイダーを使用すると、ユーザー、チーム、エスカレーションなどを含む Jira Service Management のリソースを操作できます。宣言型構成ファイルでリソースを定義することで、IT 運用の構成を簡単にコーディング、編集、レビュー、バージョン管理できます。
GitHub の Atlassian Operations Terraform プロバイダーのリポジトリをご覧ください。
サポートされているリソースとデータソース
このプロバイダーは、Terraform を介して次のリソースとデータソースの作成および管理をサポートします。
データソース (読み取り専用)
ユーザー (ユーザー連絡先 API を除く)
チーム
スケジュール
リソース (読み取り/書き込み - CRUD)
チーム (メンバーの有無にかかわらず)
Terraform はチーム管理者を更新できない
チームを作成するユーザーは自動的にその管理者になり、このプロバイダーでサポートできるのは、現時点で Jira Service Management Operations の REST API を介して利用可能なアクションのみとなるため、Terraform でチーム管理者を更新することはできません。
Terraform プロバイダーを設定する
Atlassian Operations Terraform プロバイダーを設定するには、Terraform 設定の required_providers ブロックに atlassian-operations を含めます。プロバイダーを使用する前に、有効な認証情報を使用してプロバイダーを設定してください。
必須の設定パラメーター
プロバイダーには次のパラメーターが必要です。
cloud_id: サイトのクラウド ID を確認する最も簡単な方法はhttps://<your-site-name>.atlassian.net/_edge/tenant_infoを使うことです。domain_name- サイトの URL (例:my-site-name.atlassian.net)email_addresstoken- 既存の Atlassian API トークンを一覧表示したり、Atlassian アカウントの API トークンを管理して新しいトークンを作成したりできます。
設定例
以下は Terraform の設定例です。
terraform {
required_providers {
atlassian-operations = {
source = "registry.terraform.io/atlassian/atlassian-operations"
}
}
}
provider "atlassian-operations" {
cloud_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
domain_name = "xxxx.atlassian.net"
email_address = "email@example.com"
token = "<YOUR_TOKEN_HERE>"
}詳細については、Atlassian Operations プロバイダーのページにアクセスし、ドキュメントを参照して利用可能なリソースをご確認ください。リソースは、ドキュメント ページの左側のメニューにまとめられています。現在、プロバイダーは 6 つのリソースと 3 つのデータソースをサポートしています。
このプロバイダーを使用して Terraform を使い始めるには、Terraform のチュートリアルを参照してください。
データソースの使用
ユーザー データソース
ユーザーを取得するには、email address を指定する必要があります。
# Get Atlassian User by email address
data "atlassian-operations_user" "example" {
email_address = "email@example.com"
}チーム データソース
チームを取得するには、team id と organization id の両方が必要です。
組織 ID を確認するには、組織 ID の概要と確認方法を参照してください。
# Get Atlassian Operations Teams by organization ID and team ID
data "atlassian-operations_team" "example" {
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}スケジュール データソース
スケジュールを取得するには、その name を指定する必要があります。
# Get Atlassian Operations Schedule by name
data "atlassian-operations_schedule" "example" {
name = "Test schedule"
}リソースの使用
チーム リソース
必須のリソース:
description(文字列) チームの説明display_name(文字列) チームの表示名member(属性セット) チームのメンバーaccount_id(文字列) ユーザーのアカウント ID
organization_id(文字列) チームの組織 IDteam_type(文字列) チームのタイプ
オプションのリソース:
site_id(文字列) チームのサイト ID
読み取り専用のリソース:
id (String)チームの IDuser_permissions(属性) チームのユーザー権限add_members(ブール値) チームにメンバーを追加する権限delete_team(ブール値) チームを削除する権限remove_members(ブール値) チームからメンバーを削除する権限update_team(ブール値) チームを更新する権限
組織 ID を確認するには、組織 ID の概要と確認方法を参照してください。
設定例
resource "atlassian-operations_team" "example" {
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
description = "This is a team created by Terraform"
display_name = "Terraform Team"
team_type = "MEMBER_INVITE"
member = [
{
account_id = "XXXXXX:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
]
}スケジュール リソース
必須のリソース:
name(文字列) スケジュールの名前team_id(文字列) スケジュールを所有するチームの ID
オプションのリソース:
description(文字列) スケジュールの説明enabled(ブール値) スケジュールが有効かどうかtimezone(文字列) スケジュールのタイム ゾーン
読み取り専用のリソース:
id(文字列) スケジュールの ID
設定例
resource "atlassian-operations_schedule" "example" {
name = "scheduleName"
team_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
description = "schedule description"
timezone = "Europe/Istanbul"
enabled = true
}スケジュール ローテーション リソース
必須のリソース:
schedule_id(文字列) スケジュールの IDstart_date(文字列) ローテーションの開始日type(文字列) ローテーションのタイプ
オプションのリソース:
end_date(文字列) ローテーションの終了日length(数値) ローテーションの長さname(文字列) ローテーションの名前participants(属性リスト) ローテーションの参加者type(文字列) 参加者のタイプid(文字列) (タイプが「noone」の場合はオプション) 参加者の ID
time_restriction(属性)type(文字列) 時間制限のタイプrestriction(タイプが「time-of-day」の場合は必須) (属性)end_hour(数値) 制限の終了時間 (時)end_min(数値) 制限の終了時間 (分)start_hour(数値) 制限の開始時間 (時)start_min(数値) 制限の開始時間 (分)
restrictions(タイプが「weekday-and-time-of-day」の場合は必須) (属性リスト)end_day(文字列) 制限の終了日end_hour(数値) 制限の終了時間 (時)end_min(数値) 制限の終了時間 (分)start_day(文字列) 制限の開始日start_hour(数値) 制限の開始時間 (時)start_min(数値) 制限の開始時間 (分)
読み取り専用のリソース:
id(文字列) ローテーションの ID
設定例
resource "atlassian-operations_schedule_rotation" "example" {
schedule_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "rotationName"
start_date = "2023-11-10T05:00:00Z"
end_date = "2023-11-11T05:00:00Z"
type = "weekly"
length = 2
participants = [
{
id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
type = "user"
}
]
time_restriction = {
type = "time-of-day"
restriction = {
start_hour = 9
end_hour = 17
start_min = 0
end_min = 0
}
}
}エスカレーション リソース
必須のリソース:
name(文字列) エスカレーションの名前rules(属性セット) エスカレーション ルールのリストcondition(文字列) アラートの状態に基づきエスカレーション ルールについて受信者に通知するための条件delay(数値) エスカレーション・ルールの遅延時間 (分)notify_type(文字列) エスカレーションの受信者計算ロジックrecipient(属性) エスカレーション時に通知されるスケジュール、チーム、ユーザーのオブジェクトtype(文字列) 受信者のタイプid(文字列) 受信者の ID
team_id(文字列) エスカレーションを所有するチームの ID
オプションのリソース:
description(文字列) エスカレーションの説明enabled(ブール値) エスカレーションが有効かどうかrepeat(属性) エスカレーションの繰り返しに関する設定 (繰り返し間隔、回数、確認済みおよび表示済み状態を元に戻す、繰り返しが完了した時点でアラートを自動的に閉じる、など)close_alert_after_all(ブール値) エスカレーションの繰り返しが完了したら自動的にアラートを閉じるcount(数値) 繰り返しのアクションを実行する回数を示す繰り返し時間reset_recipient_states(ブール値) アラートが閉じられていない場合、繰り返しのたびに確認済みおよび表示済みの状態を元に戻すwait_interval(数値) 最後のエスカレーション ルールの処理後にエスカレーション ルールを繰り返す時間 (分)。繰り返しオプションを追加または削除する場合は必須。繰り返しオプションを無効にするには、値として 0 を指定する。
読み取り専用のリソース:
id(文字列) エスカレーションの ID
設定例
resource "atlassian-operations_escalation" "example" {
name = "escalationName"
team_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
description = "escalation description"
rules = [{
condition = "if-not-acked"
notify_type = "default"
delay = 5
recipient = {
id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
type = "user"
}
},
{
condition = "if-not-closed"
notify_type = "all"
delay = 1
recipient = {
id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
type = "team"
}
}]
enabled = true
repeat = {
wait_interval = 5
count = 10
reset_recipient_states = true
close_alert_after_all = true
}
}API 統合リソース
必須のリソース:
name(文字列)type(文字列)
オプションのリソース:
enabled(ブール値)team_id(文字列)type_specific_properties(JSON 文字列) このオブジェクトには、統合固有のプロパティを指定可能jsonencodeを使ってオブジェクトを文字列に変換します。
読み取り専用のリソース:
advanced(ブール値)directions(文字列のリスト)domains(文字列のリスト)id(文字列) エスカレーションの IDmaintenance_sources(属性リスト)enabled(ブール値) メンテナンスが有効かどうかinterval(属性)end_time_millis(数値) メンテナンスの終了時間start_time_millis(数値) メンテナンスの開始時間
maintenance_id(文字列) メンテナンスの ID
一部の統合タイプ向けのデフォルト構成
一部の API ベースの統合では、Terraform 構成で type_specific_properties フィールドを明示的に定義する必要があります。省略されたり部分的に定義されたりした場合、Terraform は API レスポンスとの不一致を検出し、terraform apply 中に競合エラーをスローする可能性があります。
これを回避するには、値が既定値と一致する場合でも、type_specific_properties ブロック全体を指定することをおすすめします。これにより、構成が実際の統合状態と確実に同期されます。
API 統合 (Incoming-API)
type_specific_properties = jsonencode({
deleteAccessGranted: true,
writeAccessGranted: true,
restrictConfigAccess: true,
readAccessGranted: true,
isDefaultIntegration: false,
suppressNotifications: false
})Prometheus (Incoming-API)
type_specific_properties = jsonencode({
deleteAccessGranted: true,
writeAccessGranted: true,
restrictConfigAccess: true,
readAccessGranted: true,
suppressNotifications: false
})Webhook (Incoming-API)
type_specific_properties = jsonencode({
addAlertDetails: true,
headers: {
"TestHeader": "TestHeaderValue"
},
addAlertDescription: true,
outgoingSettingsEnabled: true,
forwardingActionGroupEnabled: true,
url: "https://test.webhook.com"
})Splunk (Incoming-API)
type_specific_properties = jsonencode({
sendViaJEC: true,
writeAccessGranted: true,
restrictConfigAccess: true,
updatingActionGroupEnabled: false,
outgoingSettingsEnabled: true,
suppressNotifications: false,
deleteAccessGranted: true,
forwardingActionGroupEnabled: true,
readAccessGranted: true,
url: "test.splunk.url",
token: "test.splunk.token"
})
設定例
resource "atlassian-operations_api_integration" "example" {
name = "apiIntegrationName"
team_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
type = "API"
enabled = true
type_specific_properties = jsonencode({
suppressNotifications: false
})
}メール統合リソース
必須のリソース:
name(文字列)type_specific_properties(属性) このオブジェクトには、統合固有のプロパティを指定可能email_username(文字列)suppress_notifications(任意、デフォルトはfalse) (ブール値)
オプションのリソース:
enabled(ブール値)team_id(文字列)
読み取り専用のリソース:
advanced(ブール値)directions(文字列のリスト) アクションの方向 (着信または発信)domains(文字列のリスト) アクションのドメイン (アラート)id(文字列) エスカレーションの IDmaintenance_sources(属性リスト)enabled(ブール値)interval(属性)end_time_millis(数値)start_time_millis(数値)
maintenance_id(文字列)
一部のメール統合タイプ向けのデフォルト構成
Terraform の計画または適用のエラーを回避するには、type_specific_properties フィールドを明示的に定義する必要がある場合があります。それがないと、Terraform が設定と API レスポンス間の不一致を検出し、状態の競合につながる可能性があります。
既知のメール統合タイプについては、type_specific_properties ブロック全体を含めることをおすすめします。これにより、構成を安定させ、予期しない相違の発生を防ぐことがます。
メール統合 (受信)
type_specific_properties = jsonencode({
emailAddress: "<your-generated-email-address>",
emailUsername: "<your-email-username>",
isEmailDomainSyncRequired: false,
suppressNotifications: false
})ConnectWiseAutomate (メール - 受信)
type_specific_properties = jsonencode({
emailAddress: "<your-generated-email-address>",
emailUsername: "<your-email-username>",
isEmailDomainSyncRequired: false,
suppressNotifications: false
})
設定例
resource "atlassian-operations_email_integration" "example" {
name = "emailIntegrationUpdateName"
team_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
enabled = true
type_specific_properties = {
email_username = "randomEmailUsername"
suppress_notifications = false
}
}
通知ルール
必須のリソース:
name(文字列) – 通知ルールの名前。チーム内で一意である必要があります。action_type(文字列) – ルールをトリガーするアクションのタイプです。有効な値は以下のとおりです。create-alertacknowledged-alertclosed-alertassigned-alertadd-noteschedule-startschedule-endincoming-call-routing
オプションのリソース:
criteria(オブジェクト) – 通知ルールがトリガーされるタイミングを定義します。次が含まれます。type(文字列) – 必須。条件の一致ロジックを定義します。有効な値は以下のとおりです。match-all: すべてのインシデントに一致します。conditionsは不要です。match-all-conditions: すべての条件に一致する必要があります。match-any-condition: いずれかの条件が一致します。
conditions(オブジェクトのリスト) –typeがmatch-all-conditionsまたはmatch-any-conditionの場合に必須。各オブジェクトには以下が含まれる場合があります。field(文字列) – 必須。評価するインシデント フィールド (例:message、priority、tags)。operation(文字列) – 必須。比較演算子 (例:equals、contains)。expected_value(文字列) – 任意。比較対象となる値です。key(文字列) – 任意。extra-propertiesフィールドで使用されます。not(ブール値) – 任意。条件を否定します。order(整数) – 任意。評価の順序を決定します。
notification_time(文字列のリスト) – イベントを基準として通知を送信するタイミングを指定します。有効な値:just-before、15-minutes-ago、1-hour-ago、1-day-ago。time_restriction(属性)type(文字列) 時間制限のタイプrestriction(type = “time-of-day” の場合は必須) (属性)end_hour(数値) - 制限の終了時間 (時間)end_min(数値) - 制限の終了時間 (分)start_hour(数値) - 制限の開始時間 (時間)start_min(数値) - 制限の開始時間 (分)
restrictions(type = “weekday-and-time-of-day” の場合は必須) (属性リスト)end_day(文字列) - 制限の終了日end_hour(数値) - 制限の終了時間 (時間)end_min(数値) - 制限の終了時間 (分)start_day(文字列) - 制限の開始日start_hour(数値) - 制限の開始時間 (時間)start_min(数値) - 制限の開始時間 (分)
schedules(文字列のリスト) – ルールが適用される予定 ID。order(整数) – ルールの処理順序 (数字の小さい順に実行されます)
steps (オブジェクトのリスト) – 通知ステップを定義します。各ステップには以下が含まれる場合があります。
send_after(整数) – 任意。ルール トリガー後の遅延 (分)contact(オブジェクト) – 必須。次のように通知先を定義します。method(文字列) – 必須。通知方法 (email、sms、voice、mobile)to(文字列) – 必須。宛先 (メール アドレスまたは電話番号)
repeat(オブジェクト) – 繰り返し通知の設定:loop_after(整数) – 必須。繰り返すまでの遅延 (分)enabled(ブール値) – 任意。繰り返しが有効かどうか (既定値は true)
enabled(ブール値) – ルールがアクティブかどうか。既定値:true。
読み取り専用のリソース:
id (文字列) – 通知ルールの一意の ID。
設定例
この例:
create-alertイベントでトリガーします。優先度とトピックの両方に一致させるために
match-all-conditionsを使用します。SMS では即時に、メールでは 5 分後に通知します。
アラートが承認またはクローズされない場合、10 分ごとに繰り返されます。
営業時間内 (午前 9 時~午後 6 時) にのみ適用されます。
resource "atlassian-operations_notification_rule" "example" {
name = "High Priority Alert Notification"
action_type = "create-alert"
enabled = true
order = 1
criteria = {
type = "match-all-conditions"
conditions = [
{
field = "priority"
operation = "equals"
expected_value = "P1"
},
{
field = "tags"
operation = "contains"
expected_value = "infrastructure"
}
]
}
notification_time = [
"just-before",
"15-minutes-ago"
]
time_restriction = {
type = "time-of-day"
restriction = {
start_hour = 9
start_min = 0
end_hour = 18
end_min = 0
}
}
schedules = [
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
]
steps = [
{
send_after = 0
contact = {
method = "sms"
to = "+15551234567"
}
},
{
send_after = 5
contact = {
method = "email"
to = "oncall@example.com"
}
}
]
repeat = {
loop_after = 10
enabled = true
}
}
ルーティングルール
必須のリソース:
team_id(文字列) – このルーティング ルールを所有するチームの ID。この値は作成後に変更できません。notify(オブジェクト) – このルールに一致するインシデントのルーティング方法を定義します。次が含まれます。type(文字列) – 必須。通知方法:none– ルーティングなしescalation– エスカレーション ポリシーの使用schedule– スケジュールの使用
id(文字列) – タイプがエスカレーションまたは予定の場合に必須です。対象のエスカレーションまたは予定の ID です。
オプションのリソース:
name(文字列) – ルーティング ルールの説明的な名前。既定値は空の文字列です。order(整数) – すべてのチーム ルーティング ルールにおけるこのルールのインデックス。0 から 100 の間である必要があります。is_default(ブール値) – これが既定のルーティング ルールかどうか。有効になっている場合、他のルールが一致しないときにこのルールが使用されます。timezone(文字列) – 時間に基づく決定のタイムゾーン (例: ヨーロッパ/ロンドン)。有効な IANA タイム ゾーンである必要があります。criteria(オブジェクト) – ルールがトリガーされるタイミングを定義します。
指定されている場合、以下が含まれます。type(文字列) – 条件内で必須です。有効な値は以下のとおりです。match-all: 必要な条件はありませんmatch-all-conditions: すべての条件に一致する必要がありますmatch-any-condition: 少なくとも 1 つの条件が一致する必要があります。
conditions(オブジェクトのリスト) – type が match-all-conditions または match-any-condition の場合にのみ必須です。
各オブジェクトには以下が含まれる場合があります。field(文字列) – 必須。評価するインシデント フィールド (例: メッセージ、優先度)operation(文字列) – 必須。比較演算子 (例: 等しい、含む)expected_value(文字列) – 任意。比較対象となる値key(文字列) – 任意。フィールドが extra-properties の場合のキーと値のマッチングに使用されますnot(ブール値) – 任意。条件を否定します。order(整数) – 任意。リスト内の条件の順序
time_restriction(属性)type(文字列) 時間制限のタイプrestriction(type = “time-of-day” の場合は必須) (属性)end_hour(数値) 制限の終了時間 (時間)end_min(数値) 制限の終了時間 (分)start_hour(数値) 制限の開始時間 (時間)start_min(数値) 制限の開始時間 (分)
restrictions(type = “weekday-and-time-of-day” の場合は必須) (属性リスト)end_day(文字列) 制限の終了日end_hour(数値) 制限の終了時間 (時間)end_min(数値) 制限の終了時間 (分)start_day(文字列) 制限の開始日start_hour(数値) 制限の開始時間 (時間)start_min(数値) 制限の開始時間 (分)
読み取り専用のリソース:
id(文字列) – 自動的に生成される、ルーティング ルールの一意の識別子です。
設定例
この例:
customer-impactでタグ付けされた優先度の高いインシデントをルーティングします8:30 から 17:45 (ロンドン時間) の間のみ適用されます
エスカレーション ポリシーを通じて通知します
既定のルーティング ルールではなく、最初に処理されるように設定されています (
order = 0)
resource "atlassian-operations_routing_rule" "high_priority_routing" {
team_id = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
name = "High Priority Incidents"
order = 0
timezone = "Europe/London"
is_default = false
criteria = {
type = "match-all-conditions"
conditions = [
{
field = "priority"
operation = "equals"
expected_value = "P1"
},
{
field = "tags"
operation = "contains"
expected_value = "customer-impact"
}
]
}
time_restriction = {
type = "time-of-day"
restriction = {
start_hour = 8
start_min = 30
end_hour = 17
end_min = 45
}
}
notify = {
type = "escalation"
id = "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"
}
}
アラート ポリシー リソース
必須のリソース
enabled(ブール値) – アラート ポリシーがアクティブかどうか。message(文字列) – アラート メッセージのテンプレート。name(文字列) – アラート ポリシーの名前。type(文字列) –alertに設定する必要があります。
任意のリソース
actions(文字列のリスト) – アラートに関連付けるアクションのリスト。alert_description(文字列) – アラートの説明のテンプレート。alias(文字列) – アラート エイリアスのテンプレート。continue(ブール値) – このポリシーの後に他のポリシーの処理を続行するかどうか。description(文字列) – アラート ポリシーの説明。details(文字列のマップ) – アラートに含めるその他の詳細キー-値ペア。entity(文字列) – アラート エンティティのテンプレート。filter(オブジェクト) – このポリシーが適用されるタイミングを制御する条件です。次が含まれます。type(文字列) – 必須。フィルターのタイプ。conditions(オブジェクトのリスト) – 必須。各条件には以下が含まれます。expected_value(文字列) – 必須。比較対象となる値。field(文字列) – 必須。評価するアラート フィールド。operation(文字列) – 必須。比較演算子。key(文字列) – 任意。キーと値のフィールドを使用する際にフィルターするためのキーです。not(ブール値) – 任意。条件を否定するかどうか。order(数値) – 任意。条件の処理順序。
keep_original_actions(ブール値) – 既存のアラート アクションを保持するかどうか。keep_original_details(ブール値) – 既存のアラートの詳細を保持するかどうか。keep_original_responders(ブール値) – 既存のアラート対応者を保持するかどうか。keep_original_tags(ブール値) – 既存のアラート タグを保持するかどうか。order(数値) – ポリシーが評価される順序。priority_value(文字列) –update_priorityが有効な場合に割り当てる優先度の値です。responders(オブジェクトのリスト) – 誰に通知するかを指定します。各対応者には以下が含まれます。type(文字列) – 必須。対応者のタイプ。id(文字列) – 任意。対応者の ID (ユーザー、チーム、または予定)。
source(文字列) – アラート ソースのテンプレート。tags(文字列のリスト) – アラートに関連付けるタグ。team_id(文字列) – アラート ポリシーを所有するチームの ID。time_restriction(オブジェクト) – このポリシーがアクティブになるタイミングを定義します。次が含まれます。enabled(ブール値) – 必須。時間に基づく制限が有効かどうか。time_restrictions(オブジェクトのリスト) – 必須。各期間には以下が含まれます。start_hour(数値) – 必須。開始時間 (時間)。start_minute(数値) – 必須。開始時間 (分)。end_hour(数値) – 必須。終了時間 (時間)。end_minute(数値) – 必須。終了時間 (分)。
update_priority(ブール値) – このポリシーが適用されるときにアラートの優先度を変更するかどうか。
読み取り専用のリソース
id(文字列) – 自動的に割り当てられる、アラート ポリシーの一意の識別子です。
設定例
resource "atlassian-operations_alert_policy" "example" {
name = "High CPU Alert Policy"
type = "alert"
enabled = true
message = "High CPU usage detected on ${host}"
alert_description = "CPU usage exceeded 90% on ${host}"
source = "monitoring-system"
priority_value = "P1"
update_priority = true
continue = true
team_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
order = 1
actions = ["Restart Service", "Notify Ops Team"]
tags = ["infrastructure", "cpu"]
alias = "cpu-alert-${host}"
responders = [
{
type = "team"
id = "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"
}
]
details = {
metric = "cpu.utilization"
threshold = "90"
}
filter = {
type = "match-all-conditions"
conditions = [
{
field = "message"
operation = "contains"
expected_value = "CPU usage"
},
{
field = "priority"
operation = "equals"
expected_value = "P1"
}
]
}
time_restriction = {
enabled = true
time_restrictions = [
{
start_hour = 9
start_minute = 0
end_hour = 18
end_minute = 0
}
]
}
}
カスタム ロール リソース
必須のリソース
name(文字列) – カスタム ロールの名前。
任意のリソース
disallowed_rights(文字列のセット) – カスタム ロールに明示的に拒否された権限。リストはアルファベット順にソートする必要があります。granted_rights(文字列のセット) – カスタム ロールに明示的に付与された権限。リストはアルファベット順にソートする必要があります。
読み取り専用のリソース
id(文字列) – 自動的に割り当てられる、カスタム ロールの一意の識別子です。
設定例
resource "atlassian-operations_custom_role" "incident_responder" {
name = "Incident Responder"
granted_rights = [
"acknowledge-alert",
"close-alert",
"view-alert"
]
disallowed_rights = [
"delete-team",
"manage-schedule"
]
}ユーザー連絡先リソース
必須のリソース
method(文字列) – 連絡先の配信方法。有効な値には通常、email、sms、voice、またはmobileが含まれます。to(文字列) – 連絡先の宛先 (例: メール アドレスまたは電話番号)。
任意のリソース
enabled(ブール値) – この連絡方法がアクティブかどうか。既定値はtrueです。
読み取り専用のリソース
id(文字列) – 自動的に割り当てられる、ユーザー連絡先リソースの一意の識別子です。
設定例
resource "atlassian-operations_user_contact" "sms_contact" {
method = "sms"
to = "+15551234567"
enabled = true
}通知ポリシー リソース
通知ポリシー リソースを使用して、抑制、遅延、自動クローズ、重複排除など、アラート通知の高度な制御を定義します。通知ポリシーはチーム レベルで適用され、フィルタリングと時間制限に基づいて実行されます。
必須のリソース
enabled(ブール値) – 通知ポリシーがアクティブかどうか。name(文字列) – 通知ポリシーの名前。team_id(文字列) – この通知ポリシーが属するチームの ID です。type(文字列) –notificationに設定する必要があります。
任意のリソース
description(文字列) – ポリシーの短い説明。order(数値) - ポリシーの評価順序。suppress(ブール値) – このポリシーに一致するアラートの通知を抑制するかどうか。
auto_close_action (オブジェクト) – 指定した遅延時間の経過後にアラートを自動的にクローズします。
duration_format(文字列) – 待機時間の単位。有効な値:nanos、micros、millis、seconds、minutes、hours、days。wait_duration(数値) – アラートをクローズするまでの待機時間。
auto_restart_action (オブジェクト) – アラートを自動的に再起動します。
max_repeat_count(数値、必須) – 繰り返す回数 (1 から 20)。duration_format(文字列) – 待機時間の単位。有効な値: nanos、micros、millis、seconds、minutes、hours、days。wait_duration(数値) – 繰り返し前の遅延。
deduplication_action (オブジェクト) – ノイズを回避するために、類似するアラートの重複を排除します。
deduplication_action_type(文字列、必須) – 重複排除戦略。count_value_limit(数値) – 重複排除がトリガーされる前のアラート数。frequency(数値) – 重複排除期間 (秒)。duration_format(文字列) – 待機時間の単位。wait_duration(数値) – 重複排除を適用するまでの遅延時間。
delay_action (オブジェクト) – アラート通知を遅延させます。
delay_option(文字列、必須) – アラートを遅延させるための戦略。delay_time(オブジェクト、必須) – 遅延時間:hours(数値) – 遅延時間 (時間)minutes(数値) – 遅延時間 (分)
duration_format(文字列) – 遅延の単位wait_duration(数値) – 通知送信までの合計遅延時間
filter (オブジェクト) – ポリシーを適用するタイミングを定義します。
type(文字列、必須) – フィルターのタイプconditions(オブジェクトのリスト、必須) – フィルターロジック:field(文字列) – 必須operation(文字列) – 必須expected_value(文字列) – 必須key(文字列) – 任意not(ブール値) – 任意 (既定値はFalse)order(数値) – 任意
time_restriction (オブジェクト) – ポリシーが有効になるタイミングを制限します。
enabled(ブール値、必須) – 時間制限が有効かどうかtime_restrictions(オブジェクトのリスト、必須) – 各オブジェクトには以下が含まれます。start_hour(数値) – 必須start_minute(数値) – 必須end_hour(数値) – 必須end_minute(数値) – 必須
読み取り専用のリソース
id(文字列) – 通知ポリシーの一意の ID
設定例
この例では以下を定義します。
business_hours_suppressorという名前の通知ポリシー優先度の低い (
P4) アラートを抑制します営業時間 (9:00 ~ 17:00) にのみ適用されます。
`
priority` フィールドに `match-all-conditions` を指定したフィルターを使用します。
resource "atlassian-operations_notification_policy" "business_hours_suppressor" {
name = "Suppress low-priority alerts during business hours"
type = "notification"
enabled = true
team_id = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
order = 0
suppress = true
description = "Suppress low-priority alerts during working hours"
filter = {
type = "match-all-conditions"
conditions = [
{
field = "priority"
not = false
operation = "equals"
expected_value = "P4"
order = 1
}
]
}
time_restriction = {
enabled = true
time_restrictions = [
{
start_hour = 9
start_minute = 0
end_hour = 17
end_minute = 0
}
]
}
}
Heartbeats リソース
ハートビート リソースを使用して、外部システムからの時間ベースのシグナルを監視します。定義された間隔内にハートビートが受信されない場合、アラートが自動的にトリガーされます。
必須のリソース
name(文字列) – ハートビートの一意の名前。作成後は変更できません。interval(数値) – 想定されるハートビート シグナル間の間隔。interval_unit(文字列) – 間隔の時間単位です。有効な値:minutes、hours、days。team_id(String) – ハードビートを所有するチームの ID。
任意のリソース
description(文字列) – ハートビートの目的の説明。alert_message(文字列) – ハートビートが失われたときに表示されるメッセージです。alert_priority(文字列) – トリガーされたアラートの優先度 (P1、P2など)。alert_tags(文字列のセット) – トリガーされたアラートに含めるタグ。enabled(ブール値) – ハートビートが有効かどうか。既定値:true。
読み取り専用のリソース
status(文字列) – ハートビートの現在のステータス。
設定例
この構成:
15 分間隔のハートビートを作成します。
シグナルが欠落した場合のアラート
アラートにタグを付け、優先度を
P2に設定します。対応者に役立つメッセージを提供します
resource "atlassian-operations_heartbeat" "external_cron_check" {
name = "External Cron Job Monitor"
interval = 15
interval_unit = "minutes"
team_id = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
description = "Checks whether the external cron job is still running"
enabled = true
alert_message = "Cron job missed its scheduled run"
alert_priority = "P2"
alert_tags = [
"monitoring",
"cron",
"external-system"
]
}
統合アクション リソース
必須のリソース
direction(文字列) – 統合アクションの方向です。incomingまたはoutgoingのいずれかである必要があります。domain(文字列) – 統合アクションが動作するドメインです。integration_id(文字列) – このアクションが属する統合の ID。name(文字列) – 統合アクションの名前です。type(文字列) – 統合アクションのタイプです。
任意のリソース
enabled(ブール値) – 統合アクションが有効かどうか。group_type(文字列) – 統合アクションを整理するためのグループ タイプです。グループ タイプはforwarding、updating、checkboxのいずれかである必要があります。field_mappings(文字列) – 統合アクションで使用されるフィールド マッピングです。type_specific_properties(文字列) – 生の文字列としてのタイプ固有の構成。
action_mapping (オブジェクト) – このアクションが別のアクションにどのようにマッピングされるかを定義します。
type(文字列) – 必須。アクションマッピングのタイプ。parameter(文字列) – 任意。アクション マッピングの追加パラメーター。
filter (オブジェクト) – この統合アクションがトリガーされるタイミングを制御します。
condition_match_type(文字列) – 必須。適用する条件の一致ロジック (例:match-all、match-any-condition、match-all-conditions。conditions_empty(ブール値) – 必須。条件リストが空かどうか。conditions(オブジェクトのリスト) – 任意。イベントを評価するために使用する条件です。各条件には以下が含まれることがあります。field(文字列) – 必須。評価するインシデント フィールド (例:message、priority、tags)。operation(文字列) – 必須。適用する比較演算子 (例:equals、contains、starts-with)。expected_value(文字列) – 任意。比較対象となる値。key(文字列) – 任意。extra-propertiesを持つキーと値のペアに使用されます。not(ブール値) – 任意。条件を否定します。order(数値) – 任意条件の評価順序。system_condition(ブール値) – 任意。条件がシステム定義かどうか。
読み取り専用のリソース
id(文字列) – 統合アクションの一意の ID です。
一部の統合アクション向けのデフォルト構成
一部の統合アクションでは、Terraform 構成で type_specific_propertiesフィールドおよび field_mappings フィールドを明示的に定義する必要があります。これらの値が欠落しているか不完全な場合、Terraform が構成と API レスポンスの間の差分を検出し、terraform apply 中に競合エラーが発生する可能性があります。
これを回避するため、既定の動作を反映している場合でも、 type_specific_properties と field_mappings の両方に完全な値を含めることをおすすめします。これにより、構成が実際の統合アクション状態と確実に同期されます。
API 統合 (受信 API)
type_specific_properties = jsonencode({
keepRespondersFromPayload: false,
appendAttachments: true,
keepTagsFromPayload: true,
keepActionsFromPayload: true,
keepExtraPropertiesFromPayload: true
})
field_mappings = jsonencode({
note: "{{note}}",
description: "{{description}}",
source: "{{source}}",
message: "{{message}}",
priority: "{{priority}}",
responders: [
{
"type": "team",
"id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
}
],
tags: [],
alias: "{{alias}}",
details: {},
user: "{{user}}",
actions: [],
entity: "{{entity}}"
})Prometheus 統合 (Incoming-API)
type_specific_properties = jsonencode({
keepRespondersFromPayload: false,
appendAttachments: true,
keepTagsFromPayload: true,
keepActionsFromPayload: true,
keepExtraPropertiesFromPayload: true
})
field_mappings = jsonencode({
note: "{{note}}",
description: "{{description}}",
source: "{{source}}",
message: "[Prometheus]: {{message}}",
priority: "{{priority}}",
responders: [
{
"type": "team",
"id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
}
],
tags: [],
alias: "{{alias}}",
details: {},
user: "{{user}}",
actions: [],
entity: "{{entity}}"
})Webhook 統合 (送信)
direction = "outgoing"
action_mapping = {
type= "acknowledge"
}
group_type = "forwarding",Splunk 統合 (双方向 - API および Jira Edge Connector)
アクションタイプ:
createtype_specific_properties = jsonencode({ keepRespondersFromPayload: false, appendAttachments: true, keepTagsFromPayload: false, keepActionsFromPayload: false, keepExtraPropertiesFromPayload: false }) field_mappings = jsonencode({ note: "", description: "Sid:{{sid}}\nSource Type:{{source_type}}\nSplunk Server:{{splunk_server}}\nServer Host:{{server_host}}\nIndex:{{index}}", source: "Splunk", message: "[Splunk] {{search_name}} has {{linecount}} lines.", priority: "{{priority}}", responders: [ { "type": "team", "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" } ], tags: [], alias: "", details: { "Raw": "{{raw}}", "Results Link": "{{results_link}}" }, user: "Splunk", actions: [], entity: "" })アクションタイプ:
createEventdirection = "outgoing" action_mapping = { type= "create" } group_type = "forwarding",
メール統合 (受信)
type_specific_properties = jsonencode({
keepRespondersFromPayload: false,
appendAttachments: true,
keepTagsFromPayload: false,
keepActionsFromPayload: false,
keepExtraPropertiesFromPayload: false
})ConnectWiseAutomate (受信 - メール)
type_specific_properties = jsonencode({
"keepRespondersFromPayload": false,
"appendAttachments": true,
"keepTagsFromPayload": false,
"keepActionsFromPayload": false,
"keepExtraPropertiesFromPayload": false
}
field_mappings = jsonencode({
note: "",
description: "Client Name : {{clientName}}\nComputer Name : {{computerName}}\nLocation Name : {{locationName}}\nField Name : {{fieldName}}\nResult : {{result}}\nFail Count : {{failCount}}\nWhen : {{when}}\nContact Name : {{contactName}}",
source: "ConnectWise Automate",
message: "[CW Automate] {{monitorName}} is {{monitorStatus}}",
priority: "{{priority}}",
responders: [
{
"type": "team",
"id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
}
],
tags: [],
alias: "{{monitorName}}{{computerName}}",
details: {
"From": "{{from_address}}"
},
user: "",
actions: [],
entity: ""
})設定例
この例:
クリティカルなアラートによってトリガーされる受信アクションを設定します
match-all-conditionsの条件ロジックを使用して、priorityとmessageにフィルターを適用します。一致するアラートを自動的に承認します
フィールド マッピングと静的なアクション マッピングを適用します。
resource "atlassian-operations_integration_action" "auto_acknowledge_critical" {
name = "Auto-acknowledge Critical Alerts"
type = "acknowledge-alert"
direction = "incoming"
domain = "alert"
integration_id = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
enabled = true
group_type = "default"
field_mappings = jsonencode({
"priority": "{{alert.priority}}"
})
type_specific_properties = jsonencode({
"customSetting": true
})
action_mapping = {
type = "static"
parameter = "auto"
}
filter = {
condition_match_type = "match-all-conditions"
conditions_empty = false
conditions = [
{
field = "priority"
operation = "equals"
expected_value = "P1"
order = 0
},
{
field = "message"
operation = "contains"
expected_value = "CRITICAL"
not = false
system_condition = false
order = 1
}
]
}
}
保守リソース
必須のリソース
start_date(文字列) – ISO 8601 形式の保守ウィンドウの開始 (例:2023-06-15T10:00:00Z)。end_date(文字列) – ISO 8601 形式の保守ウィンドウの終了 (例:2023-06-15T14:00:00Z)。rules(オブジェクトのリスト) – 保守ウィンドウの影響を受けるエンティティ。各ルールには以下を含める必要があります。entity(オブジェクト):id(文字列) – エンティティの一意の ID (例: 統合 ID またはポリシー ID)。type(文字列) – エンティティのタイプです。有効な値にはintegration、policy、またはsyncが含まれます。
state(文字列) – 保守中に適用する状態。有効な値:disabled、enabled、noMaintenance。
任意のリソース
description(文字列) – 保守ウィンドウの説明。team_id(文字列) – この保守ウィンドウに関連付けられたチームの ID です。
読み取り専用のリソース
id(文字列) – 保守ウィンドウの一意の識別子です。status(文字列) – 保守ウィンドウの現在のステータス。有効な値:scheduled、in_progress、completed、cancelled。
設定例
この例:
6 時間の保守ウィンドウを設定します
1 つの統合を無効にし、ポリシーに
noMaintenanceモードを適用します。ウィンドウをチームに関連付け、説明を含めます
resource "atlassian-operations_maintenance" "api_upgrade_window" {
start_date = "2025-07-01T22:00:00Z"
end_date = "2025-07-02T04:00:00Z"
description = "Planned API gateway upgrade and re-deploy"
team_id = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
rules = [
{
entity = {
id = "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"
type = "integration"
}
state = "disabled"
},
{
entity = {
id = "cccccccc-cccc-cccc-cccc-cccccccccccc"
type = "policy"
}
state = "noMaintenance"
}
]
}
services リソース
Jira Service Management サービスを管理します。サービスは、ビジネスやカスタマーに価値を提供するシステム、プラットフォーム、またはインフラストラクチャを表します。
必須のリソース
description(文字列) – JSM サービスの説明。name(文字列) – JSM サービスの名前。owner(文字列) – JSM サービスを所有するチーム ID です。所有者を削除するには、空の文字列に設定します。tier(数値) – JSM サービスの階層レベルです。type(文字列) – JSM サービスのタイプ。
任意のリソース
change_approvers(属性) – 変更承認者の構成。groups(文字列のリスト) – 変更承認者のグループ ID。すべてのグループ変更承認者を削除するには、空のリストに設定します。REST API を使用してグループ ID を取得します。
projects(属性) – 関連プロジェクト。ids(文字列のリスト) – プロジェクト ID。すべてのプロジェクトを削除するには、空のリストに設定します。
responders(属性) – サービスの対応者。teams(文字列のリスト) – 対応者のチーム ID。すべてのチーム対応者を削除するには、空のリストに設定します。users(文字列のリスト) – 対応者のユーザー ID。すべてのユーザー対応者を削除するには、空のリストに設定します。
stakeholders(属性) – サービスの関係者。users(文字列のリスト) – 関係者のユーザー ID。すべてのユーザー関係者を削除するには、空のリストに設定します。
読み取り専用のリソース
id(文字列) – JSM サービスの一意の ID です。
設定例
resource "atlassian-operations_service" "example" {
name = "Example Service"
description = "Service for handling customer-facing API requests"
owner = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
tier = 1
type = “SOFTWARE_SERVICES"
change_approvers {
groups = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
}
projects {
ids = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
}
responders {
teams = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
users = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
}
stakeholders {
users = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
}
}この内容はお役に立ちましたか?