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_
The cost is the aws_
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_.
| Dimension | Unit | What's being charged |
|---|---|---|
| DB subnet group | free | The subnet group is placement metadata with no charge. $0 |
| RDS instance | per instance-hour | The database instance the subnet group places, billed by class. db.r6g.large: ~$0.24/hour |
| Multi-AZ standby | per instance-hour | A 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_ cost without changing the workload.
Only enable Multi-AZ where you need it
Half the instance cost on non-critical databasesThe 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
More AWS 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_.