DevOps AgentがEventBridgeに発行するイベントのペイロードを確認してみた

DevOps AgentがEventBridgeに発行するイベントのペイロードを確認してみた

2026.04.24

リテールアプリ共創部@大阪の岩田です。

先日GAされたDevOps Agentですが、GA時にパワーアップした点としてEventBridgeとの統合が挙げられます。
これによってDevOps Agentの各種イベントをトリガーに様々なワークフローが構築できるようになっています。

ちょうどDevOps Agent関連のワークフローを組んで試してみたいことがあったので、まずはどんなイベントが取得できるのか検証してみました。

サポートされているイベント種別

サポートされているイベント種別は公式ドキュメントに記載されており、大きくinvestigationとmitigationの2種類のイベントに分類されます。

investigationについては以下のdetail-typeがサポートされています。

detail-type Description
Investigation Created An investigation was created in the agent space.
Investigation Priority Updated The priority of an investigation was changed.
Investigation In Progress An investigation started active analysis.
Investigation Completed An investigation finished successfully with findings.
Investigation Failed An investigation encountered an error and could not complete.
Investigation Timed Out An investigation exceeded the maximum allowed duration.
Investigation Cancelled An investigation was canceled before completion.
Investigation Pending Triage An investigation is awaiting triage before active analysis begins.
Investigation Linked An investigation was linked to a related incident or ticket.

mitigationについては以下のdetail-typeがサポートされています。

detail-type Description
Mitigation In Progress A mitigation action started.
Mitigation Completed A mitigation action finished successfully.
Mitigation Failed A mitigation action encountered an error and could not complete.
Mitigation Timed Out A mitigation action exceeded the maximum allowed duration.
Mitigation Cancelled A mitigation action was canceled before completion.

やってみる

実際にDevOps AgentのWeb Appから「調査を開始」し、EventBridgeにどのようなイベントが発行されるか確認してみました。
前述したイベント以外にもdetail-typeが AWS API Call via CloudTrailのイベントも発行されていたので、そのイベントも含めて実際のペイロードをご紹介します。

CloudTrail経由で発行されたイベント

CloudTrail経由で発行されたイベントには以下のようなパターンがありました。これらはマネコン操作の裏側で自動的に発行されているAPI呼び出しと思われます。

{
  version: '0',
  id: '493e06bb-1d0e-ff9d-4c65-7bcc09ba9e2c',
  'detail-type': 'AWS API Call via CloudTrail',
  source: 'aws.aidevops',
  account: '<AWSアカウントID>',
  time: '2026-04-23T00:41:51Z',
  region: 'us-east-1',
  resources: [],
  detail: {
    eventVersion: '1.09',
    userIdentity: {
      type: 'AssumedRole',
      principalId: '<プリンシパルID>:<Assume元のIAMユーザー名>',
      arn: 'arn:aws:sts::<AWSアカウントID>:assumed-role/<IRMロール名>/<Assume元のIAMユーザー名>',
      accountId: '<AWSアカウントID>',
      accessKeyId: '<アクセスキーID>',
      sessionContext: [Object]
    },
    eventTime: '2026-04-23T00:41:51Z',
    eventSource: 'aidevops.amazonaws.com',
    eventName: 'SearchServiceAccessibleResource',
    awsRegion: 'us-east-1',
    sourceIPAddress: '2a09:bac6:4305:1e1e::300:33',
    userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36',
    errorCode: 'ValidationException',
    requestParameters: { serviceId: '0ab489aa-b996-416d-9050-53b15252a746' },
    responseElements: null,
    requestID: 'd16b1faa-625c-4fc1-81d8-cd50f97bfc27',
    eventID: '1a473921-e32b-4587-8a93-09f7cfcd21da',
    readOnly: true,
    eventType: 'AwsApiCall',
    managementEvent: true,
    recipientAccountId: '<AWSアカウントID>',
    eventCategory: 'Management',
    sessionCredentialFromConsole: 'true'
  }
}

eventNameCreateOneTimeLoginSessionとなっているので、マネコンからウェブアプリリンクの「オペレータアクセス」をクリックしてエージェントスペースのコンソールを開く時に裏側で実行されてそうですね。

別のパターンでこんなイベントもありました。

{
  version: '0',
  id: 'a2c3974e-9944-7b06-11b6-ff7e78c7c5fb',
  'detail-type': 'AWS API Call via CloudTrail',
  source: 'aws.aidevops',
  account: '<AWSアカウントID>',
  time: '2026-04-23T00:43:58Z',
  region: 'us-east-1',
  resources: [],
  detail: {
    eventVersion: '1.11',
    userIdentity: {
      type: 'AssumedRole',
      principalId: '<プリンシパルID>:<プリンシパルID>-<Assume元のIAMユーザー名>',
      arn: 'arn:aws:sts::<AWSアカウントID>:assumed-role/<DevOps AgentのWeb App用IAMロール名>/<プリンシパルID>-<Assume元のIAMユーザー名>',
      accountId: '<AWSアカウントID>',
      accessKeyId: '<プリンシパルID>:<プリンシパルID>-<Assume元のIAMユーザー名>',
      sessionContext: [Object],
      invokedBy: 'aidevops.amazonaws.com'
    },
    eventTime: '2026-04-23T00:43:58Z',
    eventSource: 'aidevops.amazonaws.com',
    eventName: 'CreateBacklogTask',
    awsRegion: 'us-east-1',
    sourceIPAddress: 'aidevops.amazonaws.com',
    userAgent: 'aidevops.amazonaws.com',
    requestParameters: {
      taskType: 'INVESTIGATION',
      priority: 'MEDIUM',
      clientToken: 'a8e4bc6a-8955-4364-bf1e-3432afd76f09'
    },
    responseElements: { task: [Object] },
    requestID: '989e6281-1c72-4cdc-8ca9-9593fc44a75b',
    eventID: 'f208f0a8-0b12-449c-8d8c-7a0b7e1d36a3',
    readOnly: false,
    resources: [ [Object] ],
    eventType: 'AwsApiCall',
    apiVersion: '2024-01-01',
    managementEvent: true,
    recipientAccountId: '<AWSアカウントID>',
    eventCategory: 'Management'
  }
}

こちらはeventNameCreateBacklogTaskで、requestParametersを見るとtaskTypeINVESTIGATIONとなっているのでマネコンから「調査を開始」をクリックした時の裏側で実行されていそうです。

investigation関連のイベント

CloudTrailを経由せずにDevOps Agentから直接発行されたイベントは以下の通りでした。
今回はWeb Appから「調査」を実行したので以下3つのイベントが確認できました。

  • Investigation Created
  • Investigation In Progress
  • Investigation Completed

まずはInvestigation Createdイベントです。

{
  version: '0',
  id: '9cf02c61-6434-e6bd-d3fd-e69ca8bac1ab',
  'detail-type': 'Investigation Created',
  source: 'aws.aidevops',
  account: '<AWSアカウントID>',
  time: '2026-04-23T00:43:58Z',
  region: 'us-east-1',
  resources: [
    'arn:aws:aidevops:us-east-1:<AWSアカウントID>:agentspace/bf844293-9d10-4261-9b5d-764cadf81e24'
  ],
  detail: {
    version: '1.0.0',
    metadata: {
      agent_space_id: 'bf844293-9d10-4261-9b5d-764cadf81e24',
      task_id: '20aeb06d-2fe7-4e02-b55b-dc148c8ae0e9',
      execution_id: 'exe-ops1-9822c9af-8f48-43e5-a6b8-049706741681'
    },
    data: {
      task_type: 'INVESTIGATION',
      priority: 'MEDIUM',
      status: 'PENDING_START',
      created_at: '2026-04-23T00:43:58.02Z',
      updated_at: '2026-04-23T00:43:58.02Z'
    }
  }
}

metadataからtask_idやexecution_idが取得できるので、これらを利用すれば調査の開始をトリガーに独自処理を実装しやすそうですね。

続いてInvestigation In Progressのイベントです。

{
  version: '0',
  id: '11cc741f-0437-d498-ea3d-a813fd9ee4ca',
  'detail-type': 'Investigation In Progress',
  source: 'aws.aidevops',
  account: '<AWSアカウントID>',
  time: '2026-04-23T00:44:10Z',
  region: 'us-east-1',
  resources: [
    'arn:aws:aidevops:us-east-1:<AWSアカウントID>:agentspace/bf844293-9d10-4261-9b5d-764cadf81e24'
  ],
  detail: {
    version: '1.0.0',
    metadata: {
      agent_space_id: 'bf844293-9d10-4261-9b5d-764cadf81e24',
      task_id: '20aeb06d-2fe7-4e02-b55b-dc148c8ae0e9',
      execution_id: 'exe-ops1-9822c9af-8f48-43e5-a6b8-049706741681'
    },
    data: {
      task_type: 'INVESTIGATION',
      priority: 'MEDIUM',
      status: 'IN_PROGRESS',
      created_at: '2026-04-23T00:43:58.02Z',
      updated_at: '2026-04-23T00:44:10.4Z'
    }
  }
}

Investigation Createdのイベントと比較するとstatusIN_PROGRESSに変わっており、それに合わせてupdated_atの時刻も更新されています。

最後にInvestigation Completedのイベントです。

{
  version: '0',
  id: '8b7ce0ac-933a-c2a1-1142-eddc3cd43497',
  'detail-type': 'Investigation Completed',
  source: 'aws.aidevops',
  account: '<AWSアカウントID>',
  time: '2026-04-23T00:47:36Z',
  region: 'us-east-1',
  resources: [
    'arn:aws:aidevops:us-east-1:<AWSアカウントID>:agentspace/bf844293-9d10-4261-9b5d-764cadf81e24'
  ],
  detail: {
    version: '1.0.0',
    metadata: {
      agent_space_id: 'bf844293-9d10-4261-9b5d-764cadf81e24',
      task_id: '20aeb06d-2fe7-4e02-b55b-dc148c8ae0e9',
      execution_id: 'exe-ops1-9822c9af-8f48-43e5-a6b8-049706741681'
    },
    data: {
      task_type: 'INVESTIGATION',
      priority: 'MEDIUM',
      status: 'COMPLETED',
      created_at: '2026-04-23T00:43:58.02Z',
      updated_at: '2026-04-23T00:47:36.9Z',
      summary_record_id: 'fdef2c82-70ba-442f-9bd6-e6d258087b77'
    }
  }
}

こちらはdatasummary_record_idから調査結果サマリーのIDが特定できます。本日時点ではAWS CLIを使って該当レコードを取得する公式な方法は存在しませんが、以下のブログで紹介しているように自前でサービス定義のJSONファイルを作成すればAWS CLIを利用してエージェントとのチャット履歴から調査結果のサマリーが取得できます。

※本ブログでは自作JSONファイルの定義については割愛します。次回EventBridge連携を活用したブログを書く予定なので、その際にまとめて紹介します。

https://dev.classmethod.jp/articles/try-hack-to-list-of-devops-agent-runbooks-from-aws-cli/

AWS CLIの実行イメージは以下のようになります。

aws aidevops list-journal-records --agent-space-id <イベントデータから取得したagent_space_id> \
    --execution-id <イベントデータから取得したexecution_id>  \
    --order DESC  \
    | jq -r '.records[] | select(.recordId == <イベントデータから取得したsummary_record_id>) |.content'

DevOps AgentはSlackとの連携をサポートしていますが、Slack以外のチャットツールに調査結果のサマリーを通知したいといった要件で使えそうですね。

まとめ

DevOps AgentのEventBridge連携について簡単に紹介しました。

EventBridge経由でDevOps AgentとLambda等を組み合わせれば、DevOps Agentをより強力なツールとして利用できる可能性が広がります。今回はinvestigation関連のイベントのみ実際に確認してみましたが、mitigation関連のイベントもEventBridge経由で取得可能なので、色々とアイデアが広がりますね。

次回のブログではEventBridgeも活用しつつDevOps Agent利用の発展的なユースケースを考えてみたいと思います。

参考

この記事をシェアする

関連記事