New to Kestra?
Use blueprints to kickstart your first workflows.
Monitor an Amazon MQ broker's own state and alert Slack before a CRITICAL_ACTION_REQUIRED incident goes unnoticed.
An Amazon MQ broker (managed ActiveMQ or RabbitMQ) that enters
CRITICAL_ACTION_REQUIRED - Amazon MQ's own documented state for a
problem like a full disk that needs operator attention - has no
built-in way to say "notify this Slack channel right now" without
wiring a CloudWatch alarm and SNS target per broker. This blueprint
reads the broker's own state directly and alerts Slack the moment it
stops being healthy.
periodic_broker_check (io.kestra.plugin.core.trigger.Schedule) runs every 10 minutes, explicitly passing aws_region and broker_id through its own inputs: block so the flow is self-contained when the trigger fires. Shipped disabled so a manual run can be verified first.probe_broker_state (io.kestra.plugin.aws.cli.AwsCLI) runs aws mq describe-broker, capturing BrokerState, EngineType, and every other field the API returns as named task outputs.evaluate_broker_state (io.kestra.plugin.core.flow.If) branches on whether BrokerState is CRITICAL_ACTION_REQUIRED or CREATION_FAILED.then (CRITICAL): alert_broker_critical reports the broker ID, engine type, and exact state to Slack.else (HEALTHY): log_broker_healthy records the current state, whether that is RUNNING or an expected in-progress transition.log_audit_complete always runs last, printing the broker state regardless of which branch fired.errors block alerts Slack separately if the flow itself fails outright - a broker ID that does not exist, or bad credentials, must not read as HEALTHY.describe-broker is a pure control-plane read, unlike any approach built on consuming from the broker's own queues to check activity.BrokerState is a property of the Amazon MQ control plane, not the underlying message broker engine.io.kestra.plugin.aws.cli.AwsCLI driving a read-only Amazon MQ control-plane audit, reusing the same corrected output-capture convention (newlines only, not spaces, stripped before the marker) as this repository's other AWS CLI-based sentinel blueprints.AwsCLI reading a messaging service's own control-plane health, distinct from reading queue-level metrics or consuming messages.Amazon MQ itself has no cross-broker "notify me the moment this broker needs attention" primitive beyond what you wire up separately in CloudWatch and SNS, configuration that then has to be kept in sync as brokers are created and retired. Kestra supplies the schedule, the HEALTHY/CRITICAL classification as a first-class branch, and an execution history that shows exactly when a broker's state changed.
aws_region, broker_id).mq:DescribeBroker permission - entirely read-only, cannot modify, reboot, or delete the broker.Local testing: describe-broker is one of the Amazon MQ operations LocalStack does implement (12 of 25 MQ operations, per LocalStack's own documentation), so this specific call is testable there in principle. However, LocalStack now requires its own account and auth token as of March 2026 regardless of which operations it implements, and LocalStack's own documentation notes it pins a single ActiveMQ version and does not support the RabbitMQ engine type at all - a real AWS account remains the most complete way to exercise this blueprint.
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY: credentials for io.kestra.plugin.aws.cli.AwsCLI.SLACK_WEBHOOK_URL: Slack incoming webhook used by alert_broker_critical and the errors block.SECRET_, base64-encoded - for example SECRET_AWS_SECRET_ACCESS_KEY=$(echo -n '<your-secret-key>' | base64) - and read back in flows with {{ secret('NAME') }}.aws_region (STRING, default us-east-1): region whose broker is audited.broker_id (STRING, default <your-mq-broker-id>, must be replaced): broker to audit.outputs.probe_broker_state.vars.BrokerState: the state this blueprint classifies on (verified enum from the AWS CLI's own command reference).outputs.probe_broker_state.vars.EngineType, EngineVersion, PendingEngineVersion, PendingSecurityGroups, PendingStorageSize, and more: also captured by this one call, available for further extension even though this blueprint only branches on BrokerState.AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and SLACK_WEBHOOK_URL secrets.log_broker_healthy fires.CRITICAL_ACTION_REQUIRED on a real broker for testing purposes - validate the alert branch by temporarily editing the condition to match the broker's actual current state instead, then revert it.periodic_broker_check once you trust the check against your real broker.broker_id values with io.kestra.plugin.core.flow.Loop to audit every broker in an account in one run.PendingEngineVersion or PendingSecurityGroups is set, surfacing a pending change that will take effect on the next broker reboot before it is forgotten.aws mq reboot-broker once a human has confirmed the CRITICAL_ACTION_REQUIRED cause is one that a reboot resolves, behind an explicit approval gate - deliberately kept out of this sentinel so the monitoring path never reboots anything on its own.CRITICAL_ACTION_REQUIRED is Amazon MQ's own catch-all critical state - its exact cause (for example, a full disk) is not broken out as a separate field in describe-broker's own response, so this blueprint's alert reports the state itself, not a root cause; the Amazon MQ console or broker logs are still the next step for diagnosis.DELETION_IN_PROGRESS is treated as healthy by this blueprint, not alarming - a broker being deliberately deleted is an intentional, expected transition, not an incident.tr -d '\n' | xargs -0 -I {} echo '::{"outputs":{}}::') deliberately does not strip spaces, the same corrected pattern used throughout this repository's AWS CLI-based sentinel blueprints.BrokerState / EngineType output fields are taken verbatim from AWS's own CLI reference documentation - but no Kestra engine was run to execute this flow end to end.