AWSAmazon RDSDatabase

aws_db_subnet_group cost estimation

A DB subnet group is free. It tells RDS which subnets a database can live in, and the cost is entirely the RDS instance it enables.

An aws_db_subnet_group is a named collection of subnets, spanning at least two Availability Zones, that RDS uses to decide where to place a database instance and its standby. The subnet group has no charge. It is pure placement metadata: it does not run anything, store anything, or move traffic on its own.

The cost is the aws_db_instance the subnet group enables. RDS bills the instance per hour by class (about $0.24/hour for a db.r6g.large, before storage and I/O), plus provisioned storage per GB-month, plus backups beyond the free allowance. The subnet group only influences one cost lever indirectly: by including subnets in multiple AZs, it makes Multi-AZ deployment possible, and Multi-AZ roughly doubles the instance cost by running a standby. That choice is made on the instance, not the subnet group, but the subnet group has to span AZs for it to be an option.

Placement can also affect data transfer. A database and the application that queries it in the same AZ transfer data for free; across AZs it incurs cross-AZ transfer. Which subnets the group offers can therefore nudge transfer cost. c3x prices the RDS instance, its storage, and its Multi-AZ setting, and treats the subnet group as the free placement construct it is.

Terraform example

A minimal but realistic configuration that C3X can estimate.

resource "aws_db_subnet_group" "main" {
  name       = "main"
  subnet_ids = aws_subnet.private[*].id

  tags = {
    Name = "main-db-subnet-group"
  }
}

Pricing dimensions

What you actually pay for when you provision aws_db_subnet_group.

DimensionUnitWhat's being charged
DB subnet groupfreeThe subnet group is placement metadata with no charge.
$0
RDS instanceper instance-hourThe database instance the subnet group places, billed by class.
db.r6g.large: ~$0.24/hour
Multi-AZ standbyper instance-hourA subnet group spanning AZs enables Multi-AZ, whose standby roughly doubles instance cost.
~2x the single-instance rate

Optimization tips

Common ways to reduce aws_db_subnet_group cost without changing the workload.

Only enable Multi-AZ where you need it

Half the instance cost on non-critical databases

The subnet group makes Multi-AZ possible; the instance setting turns it on. Multi-AZ roughly doubles instance cost, so reserve it for production databases that need automatic failover.

Co-locate the database with its clients

Include subnets in the same AZs as the application so queries stay intra-AZ and avoid cross-AZ data transfer charges.

Right-size the instance, not the subnet group

All the cost is the RDS instance. Choose the smallest instance class and storage that meets demand; the subnet group adds nothing to optimize.

FAQ

Does a DB subnet group cost money?

No. A DB subnet group is free. It only tells RDS which subnets a database may use. The cost is the RDS instance it places, billed per hour along with its storage and backups.

Does a DB subnet group affect RDS cost at all?

Indirectly. By spanning multiple AZs it makes Multi-AZ deployment possible, and Multi-AZ roughly doubles instance cost. It can also influence cross-AZ data transfer depending on which subnets it offers.

How do I estimate the cost behind a DB subnet group?

Price the RDS instance it enables: instance class per hour, storage per GB-month, backups, and whether Multi-AZ is on. c3x does this and treats the subnet group as free.

Related resources

Estimate this resource in your own Terraform

Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_db_subnet_group.