Skip to content

NAT Gateways

NAT Gateways are the most cost-effective resource to schedule. A single NAT Gateway costs around $32/month in data processing and hourly charges. Stopping it overnight and on weekends can cut that cost by 70%+.

Unlike EC2 and RDS, NAT Gateways cannot be stopped — they must be deleted and recreated. Uptime Scheduler handles this transparently, preserving your Elastic IP, route table associations, and gateway name across every cycle.

How scheduling works

Stop (delete)

  1. Uptime Scheduler saves the gateway’s metadata to DynamoDB:
    • Subnet ID
    • Elastic IP allocation ID (public NATs)
    • All route table associations where this NAT is the default route target
    • Connectivity type (public or private)
    • Gateway name
  2. Deletes the NAT Gateway
  3. Waits for the gateway to reach deleted state

Your route tables will temporarily have a blackhole route for 0.0.0.0/0 while the gateway is deleted. Resources in the private subnet cannot reach the internet during this window.

Start (recreate)

  1. Reads the saved metadata from DynamoDB
  2. Creates a new NAT Gateway in the same subnet, reattaching the same Elastic IP (public NATs)
  3. Waits for the gateway to become available
  4. Restores all route table associations, replacing the blackhole routes with routes to the new gateway ID
  5. Updates DynamoDB with the new gateway ID

The recreation process typically completes in 60–90 seconds.

Tag example

uptime:schedule = 0800-1800 mon-fri
uptime:env = dev

Elastic IP preservation

For public NAT Gateways, the Elastic IP is retained across stop/start cycles. Your downstream IP allowlists will not need updating.

For private NAT Gateways, no Elastic IP is involved.

Route table restoration

Uptime Scheduler saves every route table entry that points to the NAT Gateway before deleting it. On recreation, all routes are restored to point to the new gateway ID. Private subnets regain internet access as soon as route restoration completes.

Connectivity types

TypeSupport
Public (with EIP)Fully supported
Private (no EIP)Fully supported

Limitations

  • If a route table is manually modified while the NAT Gateway is stopped, Uptime Scheduler will restore routes based on the saved configuration from when the gateway was last stopped. Review route tables after manual changes.
  • If the Elastic IP is manually disassociated while the gateway is stopped, recreation will fail. Do not release or reassign the EIP while the gateway is in a stopped state.
  • Highly available (cross-AZ) NAT Gateway configurations with multiple gateways per VPC are supported — each gateway is managed independently.