Upgrade to Pro — share decks privately, control downloads, hide ads and more …

これがLambdaレス時代のChatOpsだ!実例で学ぶAmazon Q Developerカ...

Avatar for iwamot iwamot PRO
October 11, 2025

これがLambdaレス時代のChatOpsだ!実例で学ぶAmazon Q Developerカスタムアクション活用法

2025-10-11
JAWS FESTA 2025 in 金沢
https://jawsfesta2025.jaws-ug.jp/

Avatar for iwamot

iwamot PRO

October 11, 2025
Tweet

More Decks by iwamot

Other Decks in Technology

Transcript

  1. 岩本隆史 / Takashi Iwamoto ENECHANGE株式会社 VPoT AWS Community Builder (Cloud

    Operations) 前職:AWS Japan 技術サポート @iwamot
  2. 2. カスタムアクションの作成 aws chatbot create-custom-action --action-name SwitchTasks --cli-input-json file://input.json --region

    us-east-2 アクションボタンのテキスト・表示条件・CLIコマンドを定義 2024年11月リリースのCreateCustomAction APIを利用 サービスエンドポイントのあるリージョンをどれでもよいので指定 us-east-2 , us-west-2 , eu-west-1 , ap-southeast-1
  3. 参考:input.json の例 { "Definition": { "CommandText": "codedeploy continue-deployment --deployment-id $DeploymentId

    --region $Region --deployment-wait-type READY_WAIT" }, "Attachments": [ { "NotificationType": "Custom", "ButtonText": " タスク入れ替え", "Criteria": [ { "Operator": "EQUALS", "VariableName": "ActionGroup", "Value": "blue-green-deployment-test" } ], "Variables": { "ActionGroup": "event.metadata.additionalContext.ActionGroup", "DeploymentId": "event.metadata.additionalContext.DeploymentId", "Region": "event.metadata.additionalContext.Region" } } ] }
  4. 3. カスタムアクションとチャンネル設定の紐づけ aws chatbot associate-to-configuration --resource $CustomActionArn --chat-configuration $ChannelConfigurationArn --region

    us-east-2 例: 「タスク入れ替え」ボタンをデプロイ用チャンネルに紐づけ 2024年11月リリースのAssociateToConfiguration APIを利用
  5. 4. EventBridgeルールの作成 例:CodeDeployデプロイグループの状態が READY になったら実行 { "detail": { "deploymentGroup": ["my-deployment-group"],

    "state": ["READY"] }, "detail-type": ["CodeDeploy Deployment State-change Notification"], "source": ["aws.codedeploy"] }
  6. 参考:入力テンプレートの例 { "version": "1.0", "source": "custom", "content": { "textType": "client-markdown",

    "title": ":large_blue_circle::large_green_circle: デプロイの動作確認が可能になりました", "description": "*Deployment group:* <deploymentGroup>\n*Deployment ID:* <deploymentId>\n*Account:* <account>\n*Region:* <region>\n*Time:* <time>", "nextSteps": [ "https://example.com:8080/ で動作を確認します", "問題なければタスク入れ替えを、問題があればロールバックを実行します", "必要に応じて、元のタスクセットを終了します" ] }, "metadata": { "enableCustomActions": true, "additionalContext": { "ActionGroup": "blue-green-deployment", "DeploymentId": "<deploymentId>", "Region": "<region>" } } }
  7. 参考資料 Amazon Q Developerカスタムアクション https://docs.aws.amazon.com/chatbot/latest/adminguide/custom-actions.html Amazon Q Developerカスタム通知 https://docs.aws.amazon.com/chatbot/latest/adminguide/custom-notifs.html CreateCustomAction

    API https://docs.aws.amazon.com/chatbot/latest/APIReference/API_CreateCustomAction.html AssociateToConfiguration API https://docs.aws.amazon.com/chatbot/latest/APIReference/API_AssociateToConfiguration.html EventBridgeルールの作成 https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule.html EventBridge入力トランスフォーマー https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-transform-target-input.html