aws_elasticache_subnet_group cost estimation
An ElastiCache subnet group is free. It tells ElastiCache which subnets a cache cluster can run in, and the cost is entirely the cache nodes it enables.
An aws_elasticache_subnet_group is a named set of subnets that ElastiCache uses to place the nodes of a Redis or Memcached cluster. The subnet group carries no charge. Like its RDS counterpart, it is placement metadata: it decides where nodes can live across Availability Zones but runs nothing itself.
The cost is the aws_elasticache_cluster it enables. ElastiCache bills each cache node per hour by node type (about $0.068/hour for a cache.r6g.large, before any replicas), and a replication group multiplies that by the number of primary and replica nodes. So a Redis cluster with one primary and two replicas is three billed nodes running continuously. The subnet group only makes multi-AZ placement possible; the decision to run replicas across AZs, and the node type, are set on the cluster.
Placement affects data transfer too. Nodes and the application in the same AZ transfer data for free, while cross-AZ replication and client traffic incur transfer charges. Which subnets the group spans therefore influences transfer cost. c3x prices the ElastiCache nodes, their type, and the replica count, 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_elasticache_subnet_group" "main" {
name = "main"
subnet_ids = aws_subnet.private[*].id
}Pricing dimensions
What you actually pay for when you provision aws_elasticache_subnet_group.
| Dimension | Unit | What's being charged |
|---|---|---|
| Cache subnet group | free | The subnet group is placement metadata with no charge. $0 |
| Cache nodes | per node-hour | Each node in the cluster the subnet group places, billed by node type. cache.r6g.large: ~$0.068/hour |
| Replica nodes | per node-hour | A replication group multiplies node cost by the number of primary and replica nodes. 3 nodes = ~3x the single-node rate |
Optimization tips
Common ways to reduce aws_elasticache_subnet_group cost without changing the workload.
Match replica count to real availability needs
The subnet group enables multi-AZ; the cluster sets how many replicas run. Each replica is a fully billed node, so add replicas only where failover and read scaling justify the cost.
Co-locate the cache with its clients
Include subnets in the same AZs as the application so cache traffic stays intra-AZ and avoids cross-AZ data transfer charges.
Right-size the node type
All the cost is the cache nodes. Pick the smallest node type that fits your working set in memory; the subnet group adds nothing to optimize.
FAQ
Does an ElastiCache subnet group cost money?
No. The subnet group is free. It only tells ElastiCache which subnets a cluster may use. The cost is the cache nodes it enables, billed per hour by node type and multiplied by the number of nodes.
Does the subnet group affect ElastiCache cost?
Indirectly. By spanning multiple AZs it makes multi-AZ replication possible, and each replica is a billed node. It also influences cross-AZ data transfer depending on which subnets it offers.
How do I estimate the cost behind a cache subnet group?
Price the ElastiCache cluster it enables: node type per hour times the number of primary and replica nodes, plus any cross-AZ transfer. 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_elasticache_subnet_group.