AwsCLI icon
If icon
SlackIncomingWebhook icon
Schedule icon

AWS NAT Gateway Source Port Allocation SNAT Exhaustion Sentinel

Audits AWS CloudWatch NAT Gateway metrics to detect ErrorPortAllocation events and outbound internet connectivity drops.

Categories
CloudInfrastructure

How it works

This workflow connects to Amazon CloudWatch via the AWS CLI plugin to sample the ErrorPortAllocation metric across AWS NAT Gateways in the target region. When workloads in private subnets open thousands of concurrent outbound connections to the same destination IP and port, the NAT Gateway exhausts its 55,000 available ephemeral source ports. When errors exceed zero, an urgent Slack alert is dispatched with error totals and mitigation instructions.

What you get

  • Instant alerting upon outbound SNAT port exhaustion.
  • Prevents mysterious connection dropouts in backend microservices making external API requests.
  • Actionable recommendations to attach secondary Elastic IPs or implement connection pooling.

Who it's for

  • Cloud Infrastructure Engineers and Network SREs managing AWS VPC architectures.
  • Backend engineers operating scraping, indexing, or external webhook dispatch clusters.

Why orchestrate this with Kestra

  • Native AWS Integration: Execute authenticated CloudWatch queries using io.kestra.plugin.aws.cli.AwsCLI.
  • Proactive Cadence: Catch network degradation before external partner APIs begin failing.
  • Unified Notification: Send contextual alerts to engineering incident channels with zero friction.

Prerequisites

  • AWS IAM credentials with cloudwatch:GetMetricData permissions.
  • Secrets AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and SLACK_WEBHOOK configured in Kestra.

Quick start

  1. Import this blueprint into Kestra.
  2. Configure AWS credentials and Slack webhook.
  3. Run the workflow to inspect NAT Gateway port health.

How to extend

  • Iterate across multiple AWS regions dynamically.
  • Add an automated task to describe NAT Gateways (aws ec2 describe-nat-gateways) to include specific gateway IDs in the alert.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.