Script icon
Docker icon
If icon
SlackIncomingWebhook icon
Log icon
Return icon
Schedule icon

AWS EFS Burst Credit Balance Depletion Monitor

Audits AWS EFS file systems for burst credit depletion and I/O throughput throttling, delivering proactive scaling alerts to platform teams via Slack.

Categories
CloudInfrastructure

Modern cloud architectures rely on Amazon Elastic File System (EFS) to provide shared, POSIX-compliant persistent storage across Kubernetes pods, Amazon ECS containers, and auto-scaled EC2 instances. Under the standard Bursting Throughput mode, an EFS file system accumulates burst credits during quiet periods and expends them when read and write throughput surges. However, when high-throughput batch ETL pipelines, distributed software builds, or unindexed database backups read and write to the shared volume continuously, burst credits deplete rapidly. Once the burst balance reaches zero, AWS clamps throughput down to baseline rates (as low as 50 KiB/s per GiB of storage). This causes disk I/O bottlenecks, application request timeouts, and cascading container pod evictions. This sentinel monitors the CloudWatch BurstCreditBalance and PermittedThroughput metrics hourly, identifies depleted file systems, and notifies platform teams on Slack with remediation commands to upgrade to Elastic Throughput before production services fail.

How it works

  1. Scheduled triggering: Executes hourly via automated cron trigger (0 * * * *) or runs on-demand via manual execution.
  2. EFS configuration discovery: Interrogates the AWS EFS API using Boto3 to inspect the file system configuration and current throughput mode.
  3. CloudWatch metrics retrieval: Queries the CloudWatch API across a 30-minute window for BurstCreditBalance and PermittedThroughput metrics.
  4. Credit balance evaluation: Converts credit balances from bytes to gigabytes and compares against min_burst_credit_bytes_threshold.
  5. Conditional alerting: An io.kestra.plugin.core.flow.If flowable checks if credits are depleted and dispatches an incident card to #cloud-storage-alerts.
  6. Manifest export: Logs operational telemetry and returns a structured JSON manifest detailing credit balances and CLI remediation commands.

Architecture diagram

flowchart TD
  A[hourly_efs_credit_audit Schedule Trigger] --> B[scan_efs_credits Python Script]
  B --> C[check_burst_credit_depletion Flowable If]
  C -- Credit Balance Depleted --> D[notify_slack_credit_exhaustion Webhook]
  C -- Credits Nominal --> E[log_storage_health_state Log]
  D --> E
  E --> F[export_efs_manifest Return]

What you get

  • Proactive warning before EFS burst credit starvation causes baseline I/O throttling.
  • Automated detection of unmanaged bursting throughput configurations on write-heavy volumes.
  • Contextual Slack alerts with exact remaining gigabytes and AWS CLI migration commands.
  • Structured JSON audit manifests for storage capacity planning and FinOps optimization.

Who it's for

  • Cloud Platform Engineers maintaining persistent volumes for Kubernetes (EKS) and ECS clusters.
  • Site Reliability Engineers troubleshooting mysterious I/O hangs and slow container responses.
  • DevOps Teams operating shared storage backends for Jenkins, GitLab CI, or data analytics pipelines.

Why orchestrate this with Kestra

While AWS CloudWatch monitors metrics, translating credit dips into automated operational decisions across engineering teams requires workflow orchestration. Kestra connects directly to AWS APIs, parses real-time CloudWatch metrics, formats actionable incident alerts, and can trigger automated throughput mode transitions. With Kestra's containerized Python runner and native secret management, teams bridge the gap between cloud metrics and automated reliability workflows.

Use cases

  • EKS StatefulSet Volume Protection: Guard against EFS persistent volume slowdowns that stall PostgreSQL or WordPress replicas.
  • CI/CD Shared Workspace Monitoring: Detect when shared compilation cache volumes exhaust credits during multi-branch build waves.
  • Throughput Mode Optimization: Identify bursting file systems that should be switched to AWS Elastic Throughput mode.

Inputs

Name Type Default Description
aws_region STRING us-east-1 Target AWS region where the EFS file systems and CloudWatch metrics reside.
file_system_id STRING fs-0123456789abcdef0 Unique identifier of the target AWS EFS file system to monitor.
min_burst_credit_bytes_threshold FLOAT 107374182400.0 Minimum acceptable BurstCreditBalance in bytes (default 100 GiB) before triggering depletion alerts.
alert_on_depletion BOOL true Whether to dispatch automated Slack incident notifications when burst credits are exhausted.

Expected outputs

  • {{ outputs.scan_efs_credits.vars.file_system_name }}: Name or tag of the evaluated EFS file system.
  • {{ outputs.scan_efs_credits.vars.burst_credits_gib }}: Remaining burst credit balance expressed in gigabytes.
  • {{ outputs.scan_efs_credits.vars.is_depleted }}: Boolean flag indicating whether the burst credit balance breached safety limits.
  • {{ outputs.export_efs_manifest.value }}: Structured dictionary containing the consolidated EFS storage diagnostic manifest.

Prerequisites

  • Outbound HTTPS network access from Kestra execution workers to AWS CloudWatch and EFS endpoints.
  • AWS IAM credentials configured with elasticfilesystem:DescribeFileSystems and cloudwatch:GetMetricData permissions.
  • A Slack Incoming Webhook URL configured in Kestra secrets.

Secrets

  • AWS_ACCESS_KEY_ID: AWS IAM access key with permissions to read EFS metadata and CloudWatch metrics.
  • AWS_SECRET_ACCESS_KEY: AWS IAM secret key corresponding to the access key.
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook URL used to dispatch storage alerts.

Quick start

  1. Register AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and SLACK_WEBHOOK_URL in your Kestra secret storage.
  2. Import this blueprint into your Kestra instance under the company.cloud namespace.
  3. Configure file_system_id with your EFS volume ID (e.g., fs-0123456789abcdef0).
  4. Run a manual execution to test CloudWatch connectivity and verify diagnostic output.

Common pitfalls and troubleshooting

  • Elastic Throughput Mode: If an EFS volume is configured with Elastic Throughput, BurstCreditBalance is not tracked and is reported as 0; the script detects this mode and avoids false alerts.
  • IAM Policy Scopes: Ensure the IAM policy includes cloudwatch:GetMetricData for the AWS/EFS namespace; missing permissions yield empty metric arrays.
  • Credit Accumulation Rate: Small EFS volumes accumulate credits slowly; sizing storage adequately or migrating to Elastic Throughput prevents recurrent credit starvation.

How to extend

  • Automated Elastic Throughput Migration: Add a downstream AWS CLI or SDK task to automatically switch the EFS volume to Elastic Throughput when credits hit zero.
  • Multi-Volume Regional Loop: Wrap the file system evaluation in an io.kestra.plugin.core.flow.ForEach loop to monitor all regional EFS volumes.
  • PagerDuty Escalation: Route critical credit exhaustion warnings directly to on-call storage engineers via PagerDuty.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.