Skip to content

CustomAction

Source: src/AWS/Chatbot/CustomAction.ts

An AWS Chatbot (Amazon Q Developer in chat applications) custom action — a reusable CLI command that chat users invoke by alias or as a button on notifications.

Custom actions exist at the account level and do not require a chat workspace to be onboarded, though they only become usable once a Slack or Microsoft Teams channel configuration exists.

List Lambda functions from chat

import * as Chatbot from "alchemy/AWS/Chatbot";
const action = yield* Chatbot.CustomAction("ListFunctions", {
commandText: "aws lambda list-functions",
aliasName: "list-functions",
});

Button on CloudWatch alarm notifications

const action = yield* Chatbot.CustomAction("DescribeAlarm", {
commandText: "aws cloudwatch describe-alarms --alarm-names $AlarmName",
attachments: [
{
notificationType: "CloudWatch",
buttonText: "Describe alarm",
criteria: [
{ operator: "HAS_VALUE", variableName: "AlarmName" },
],
},
],
});