All posts

The AWS line items a small startup can remove, and what each one gives up

NAT gateways, RDS Extended Support, idle desktops, always-on CI runners and public IPv4: what each costs on AWS, what you give up, and when to keep it.

Type
Guide
Published
Reading time
10 min
Author
Rajesh Govada
Topics
aws · cost-optimization · terraform · rds

A small startup on AWS can often remove five line items without hurting production: NAT gateways (use an S3 gateway endpoint), RDS Extended Support (upgrade the engine), production-grade settings on dev, CI runners that sit idle, and desktops that run all night. Each has a real trade-off, and one paid security product is often not worth buying yet.

These are the decisions I made on a recent project for a small product team running a US photo and video app. Everything ran in one US East region, built with Terraform. Prices below are AWS’s current US East figures, linked to the page they come from. Check them for your own Region before you act on them.

NAT gateways off, S3 gateway endpoint on

What it costs. A NAT gateway is $0.045 per hour plus $0.045 per GB it processes, on top of normal data transfer (VPC pricing). That is about $33 a month for one gateway before a single byte moves, and many templates create one per Availability Zone.

What I did. Both the dev and prod VPCs, and the CI runner VPC, have no NAT gateway. The app server sits in a public subnet behind a CDN, with its security group open only to the CDN’s IP ranges. The database subnets have no route to the internet at all. Anything private that needs S3 goes through a gateway endpoint, which has no hourly or data processing charge.

module "network" {
  source = "./modules/network"

  enable_nat_gateway = false
  enable_s3_endpoint = true
}

resource "aws_vpc_endpoint" "s3" {
  vpc_id            = aws_vpc.app.id
  service_name      = "com.amazonaws.us-east-1.s3"
  vpc_endpoint_type = "Gateway"
  route_table_ids   = [aws_route_table.private.id]
}

What you give up. Private subnets can’t reach the internet. No package installs, no third-party API calls, no outbound webhooks from anything in them.

When not to do it. If your workloads live in private subnets and call out to the internet, you need egress. I kept exactly one NAT gateway on this project: in the network for developer desktops, which have no public IP and need a single, predictable egress address that the AWS access rules are tied to. A NAT gateway you chose for a reason is fine. The ones to remove are the extra gateways a template created by default.

The public IPv4 charge

What it costs. Every public IPv4 address is $0.005 per hour, whether it’s attached to something or sitting idle. AWS’s own example puts that at $3.60 per address for a 30-day month (VPC pricing). Billing is per second with a 60-second minimum.

What I did. The app server has an Elastic IP, so its address survives an instance rebuild. That matters when clients point at the address directly: a changed IP breaks them until they are updated. Since the charge is the same for an Elastic IP and an auto-assigned one, the Elastic IP costs nothing extra. CI runners get a public IP only for the minutes they exist, which is why their VPC doesn’t need a NAT gateway.

What you give up. Nothing, as long as you count addresses. The waste is in idle Elastic IPs left behind after a teardown, and in load balancers or test boxes nobody remembers.

When not to bother. If you have two or three addresses, this is a few dollars. Look at it when the count grows. Public IP Insights in IPAM lists every public address in the account.

RDS Extended Support: upgrade MySQL 8.0 to 8.4

What it costs. RDS for MySQL 8.0 reached the end of standard support on 31 July 2026. From 1 August 2026, any 8.0 instance enrolled in Extended Support pays an extra fee per vCPU per hour (MySQL versions on RDS). In US East that is $0.100 per vCPU-hour in years one and two, and $0.200 from year three (RDS for MySQL pricing). A db.t4g.micro has 2 vCPUs, so the fee alone is $0.20 an hour per instance, and it applies to Multi-AZ standbys too (Extended Support charges).

What I did. Both databases are set to MySQL 8.4, which is in standard support until 31 July 2029. The RDS module also opts out of Extended Support by default, so a future version that ages out gets upgraded instead of quietly billed:

resource "aws_db_instance" "app" {
  engine                      = "mysql"
  engine_version              = "8.4"
  allow_major_version_upgrade = true
  engine_lifecycle_support    = "open-source-rds-extended-support-disabled"
  # ...
}

What you give up. A major version upgrade, with a short outage in a maintenance window. I tested it on dev first by building the whole environment from nothing on 8.4, then upgraded prod as a separate, scheduled change.

When not to do it. If your app hasn’t been tested on 8.4, Extended Support is a paid way to buy time, and that can be the right call. Be careful with the opt-out on a database that is already past its date: AWS says disabling enrollment then triggers an automatic upgrade to the next major version.

A cheap dev database, a protected prod one

What it costs. Backup storage is free up to your total provisioned database storage in the Region (RDS FAQs). Above that you pay, and retained backups and manual snapshots keep billing until you delete them (deleting a DB instance).

What I did. The two databases use the same module with different settings:

Setting Dev Prod
Backup retention 1 day 14 days
Final snapshot on delete skipped taken
Deletion protection on on
AWS Backup plan off not yet (RDS automated backups only)

Dev started with deletion protection off so it could be torn down freely. I turned it on later. It costs nothing, and you disable it with one command before a planned teardown.

What you give up. Dev can only roll back one day, and destroying it leaves no snapshot. Prod also runs in a single Availability Zone for now, which is the biggest risk this team chose to accept for cost. Flipping on Multi-AZ is one line when the budget allows.

When not to do it. If dev holds data you can’t recreate, such as seeded test accounts a client demo depends on, give it real backups.

CI runners that exist only for one job

What it costs. A runner box that is always on bills every hour of the month, used or not. On-demand Linux EC2 bills per second, with a 60-second minimum (EC2 on-demand pricing), so a runner that lives for one job costs only those minutes.

What I did. There is no long-lived runner. Each deploy starts with a small job on a GitHub-hosted runner that launches a fresh t3.micro from a launch template. The box registers as a single-use runner, runs that one job, and is terminated by a final job that always runs. As a backstop, the launch template terminates the instance if it shuts itself down:

resource "aws_launch_template" "runner" {
  instance_type                        = "t3.micro"
  instance_initiated_shutdown_behavior = "terminate"
  # ...
}

Deploy credentials come from the job’s short-lived OIDC role, not from the box. Nothing persists between jobs.

What you give up. Boot time on every job, and a runner image to maintain. GitHub refuses jobs from outdated runner agents, so the image needs a rebuild when the agent version moves.

When not to do it. If you run dozens of builds an hour, waiting for a box to boot each time hurts. A warm pool or GitHub-hosted runners may suit you better.

Developer desktops that stop after 60 idle minutes

What it costs. WorkSpaces in AutoStop mode bill a low monthly base fee plus an hourly fee only while the desktop runs (WorkSpaces pricing). AlwaysOn is a flat monthly rate.

What I did. Each developer desktop is AutoStop with a 60-minute timeout. The timeout is set in 60-minute steps, so this is the shortest option (WorkspaceProperties). Users can’t switch their own running mode.

workspace_properties {
  running_mode                              = "AUTO_STOP"
  running_mode_auto_stop_timeout_in_minutes = 60
}

What you give up. A short wait at first login. AWS says a stopped desktop typically resumes in under 90 seconds, with apps and data saved (running modes).

The catch. AutoStop counts from disconnect, not from idle keyboard. A laptop with its lid closed can keep the client connected and the meter running. Ask people to quit the client at the end of the day.

When not to do it. For someone who works in the desktop full time, AlwaysOn can come out cheaper. Compare both in the pricing calculator.

What I deliberately didn’t buy

The developer desktops are locked down so code can’t leave easily. One gap remained: someone bringing personal AWS keys could upload to a bucket in a different Region. Closing that fully needs a network firewall or a proxy that inspects traffic.

What it costs. AWS Network Firewall is $0.395 per endpoint per hour per Availability Zone, plus $0.065 per GB processed (Network Firewall pricing). One endpoint running all month is close to $290 before any traffic.

What I did instead, for a team of three developers:

  • A service control policy that denies S3 actions on any bucket outside the organization, in every Region. Organizations has no extra charge.
  • An S3 gateway endpoint policy that blocks other accounts’ credentials and buckets in the main Region. Free.
  • A Route 53 Resolver DNS Firewall allow list for AWS, GitHub and npm, with everything else blocked. It is billed per domain stored and per million queries (Route 53 pricing), which is small at this size. I tried a transparent proxy first and it was unreliable.
  • For the remaining cross-Region case, the plan is to watch for it rather than block it.

What you give up. That one path is not blocked. It has to be caught by monitoring, which is the next thing to build.

When to buy the firewall. When a customer contract or regulator requires egress inspection, or the team grows to a size where monitoring alone isn’t credible. Write that trigger down so the decision gets revisited.

Questions

Is it safe to run without a NAT gateway?

Yes, if nothing in your private subnets needs the internet. Use gateway endpoints for S3 and DynamoDB, which are free, and put internet-facing servers in public subnets with tight security groups.

Will I be charged for RDS Extended Support automatically?

Usually, yes. If an instance is enrolled, RDS moves it into Extended Support after the end of standard support and starts billing the next day. Upgrade first, or set engine_lifecycle_support to open-source-rds-extended-support-disabled when you create it.

How do I find these line items on my own bill?

Group Cost Explorer by usage type and look for NAT gateway hours, public IPv4 hours and Extended Support. The free tools in Compute Optimizer and Cost Optimization Hub catch idle resources too.

None of these changes is hard. Most of the work is going through the bill line by line and deciding whether each item is still needed. If you’d like someone to do that for your account, it’s the first part of the cloud cost and production audit.