id: aws-ebs-burst-balance-exhaustion-sentinel
namespace: company.cloud
inputs:
- id: aws_region
type: STRING
defaults: "us-east-1"
description: Target AWS region.
- id: volume_id
type: STRING
description: Amazon EBS gp2 Volume ID (e.g., vol-0123456789abcdef0).
- id: min_burst_balance_pct
type: FLOAT
defaults: 25.0
description: Minimum acceptable BurstBalance percentage before triggering I/O
bottleneck alert.
tasks:
- id: query_ebs_burst_balance
type: io.kestra.plugin.aws.cli.AwsCLI
region: "{{ inputs.aws_region }}"
accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID') }}"
secretKeyId: "{{ secret('AWS_SECRET_ACCESS_KEY') }}"
commands:
- |
START_TIME=$(date -u -v-30M +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -u -d "30 minutes ago" +%Y-%m-%dT%H:%M:%SZ)
END_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ)
aws cloudwatch get-metric-data --metric-data-queries '[{"Id":"bbal","MetricStat":{"Metric":{"Namespace":"AWS/EBS","MetricName":"BurstBalance","Dimensions":[{"Name":"VolumeId","Value":"{{ inputs.volume_id }}"}]},"Period":300,"Stat":"Minimum"}}]' --start-time "$START_TIME" --end-time "$END_TIME" --output json > /tmp/ebs_burst.json
BURST_BALANCE=$(jq '.MetricDataResults[0].Values[0] // 100' /tmp/ebs_burst.json)
echo "::set-output name=burst_balance::$BURST_BALANCE::"
- id: evaluate_burst_balance
type: io.kestra.plugin.core.flow.If
condition: "{{ outputs.query_ebs_burst_balance.vars.burst_balance | float <
inputs.min_burst_balance_pct }}"
then:
- id: notify_storage_team
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK') }}"
payload: |
{
"channel": "#infrastructure-alerts",
"attachments": [
{
"color": "danger",
"title": "🚨 AWS EBS Volume IOPS Burst Balance Exhaustion Alert",
"text": "EBS Volume `{{ inputs.volume_id }}` BurstBalance has dropped to *{{ outputs.query_ebs_burst_balance.vars.burst_balance }}%* (warning threshold: {{ inputs.min_burst_balance_pct }}%). Impact: gp2 volume I/O throughput is collapsing to baseline (3 IOPS/GiB), causing disk write stalls, frozen databases, and unresponsive EC2 instances.",
"footer": "Kestra Cloud Sentinel • AWS EBS"
}
]
}
errors:
- id: alert_pipeline_failure
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK') }}"
payload: |
{
"channel": "#infrastructure-alerts",
"attachments": [
{
"color": "danger",
"title": "⚠️ EBS Burst Balance Sentinel Execution Failed",
"text": "The EBS BurstBalance CloudWatch query workflow failed. Please verify AWS credentials and Volume ID.",
"footer": "Kestra Workflow Failure Sentinel"
}
]
}
triggers:
- id: periodic_schedule
type: io.kestra.plugin.core.trigger.Schedule
cron: "*/15 * * * *"
disabled: true
inputs:
volume_id: replace-with-your-volume-id