AWSAmazon API GatewayNetworking & Content Delivery

aws_apigatewayv2_stage cost estimation

A deployment stage (like prod or dev) for an HTTP or WebSocket API. Stages are free. They are where access logging and detailed metrics are enabled, and both of those feed billed CloudWatch Logs and metrics.

The aws_apigatewayv2_stage resource represents a named deployment (prod, staging, dev) of an HTTP or WebSocket API, along with its settings: throttling, auto-deploy, access logging, and default route settings. The stage itself is free. AWS does not charge for having one stage or ten.

Where the stage becomes cost-relevant is the logging and metrics it turns on. Access logging writes a log line per request to a CloudWatch Logs group. CloudWatch Logs bills about $0.50 per GB ingested and $0.03 per GB-month stored. On a high-traffic HTTP API, per-request access logs add up quickly: a busy API doing 100 million requests a month with a ~1 KB log line each is roughly 100 GB of ingestion, about $50/month in log ingestion alone, before storage. That is often more than the request charges for a cheap HTTP API. Detailed (per-route) CloudWatch metrics, enabled via default_route_settings, publish additional custom metrics that bill at CloudWatch metric rates.

The stage also carries throttling settings, which are a cost-safety mechanism rather than a cost themselves. The default account limit is 10,000 requests per second with a 5,000 burst. Because HTTP API requests bill at $1.00 per million, an un-throttled API under a traffic spike or abuse can generate a large request bill fast. Setting a sensible per-route throttle on the stage caps the blast radius of a runaway client or a denial-of-wallet attack.

A gotcha specific to stages: enabling full access logging with a verbose format ($context.integrationErrorMessage, request/response bodies, and so on) multiplies log volume and cost. Log the fields you actually query. Also, auto-deploy stages redeploy on every route change, which is free but can surprise teams expecting an explicit deployment step. WebSocket stages additionally accrue the parent API's connection-minute charges, which the stage settings (like route selection) influence.

c3x flags aws_apigatewayv2_stage as free and attributes access-log ingestion, metrics, and request cost to CloudWatch and the parent API.

Terraform example

A minimal but realistic configuration that C3X can estimate.

resource "aws_cloudwatch_log_group" "api_access" {
  name              = "/aws/apigateway/items-api/prod"
  retention_in_days = 14
}

resource "aws_apigatewayv2_stage" "prod" {
  api_id      = aws_apigatewayv2_api.http.id
  name        = "prod"
  auto_deploy = true

  access_log_settings {
    destination_arn = aws_cloudwatch_log_group.api_access.arn
    format = jsonencode({
      requestId      = "$context.requestId"
      httpMethod     = "$context.httpMethod"
      routeKey       = "$context.routeKey"
      status         = "$context.status"
      responseLength = "$context.responseLength"
    })
  }

  default_route_settings {
    throttling_burst_limit = 500
    throttling_rate_limit  = 1000
  }
}

Pricing dimensions

What you actually pay for when you provision aws_apigatewayv2_stage.

DimensionUnitWhat's being charged
StagefreeA deployment stage and its throttling, auto-deploy, and route settings carry no AWS charge.
$0 (free)
Access log ingestionper GBPer-request access logs are written to CloudWatch Logs and billed on ingestion volume.
$0.50/GB ingested in us-east-1
Access log storageper GB-monthStored access logs bill monthly until they expire under the log group retention policy.
$0.03/GB-month
Requests through the stageper million requestsRequests served by the stage bill at the parent HTTP or WebSocket API rate.
$1.00 per million (HTTP API, first 300M)

Optimization tips

Common ways to reduce aws_apigatewayv2_stage cost without changing the workload.

Log only the fields you query

Cuts access-log ingestion by 50 percent or more

A verbose access-log format multiplies CloudWatch ingestion cost. Log a compact JSON of request id, route, status, and latency rather than full request and response bodies.

Set a short retention on the access-log group

Access logs are rarely queried after a few weeks. A 14 or 30 day retention on the CloudWatch Logs group stops storage cost from accumulating indefinitely.

Throttle per-route to cap runaway request cost

The default limit is 10,000 requests per second. Setting a realistic per-route throttle on the stage limits the bill impact of a traffic spike, a retry storm, or a denial-of-wallet attack.

Enable detailed metrics only where you need per-route visibility

Detailed per-route metrics publish additional billed CloudWatch metrics. Turn them on for the handful of routes you actively monitor, not blanket across every route.

FAQ

Does an API Gateway v2 stage cost anything?

No. The stage and its settings are free. Cost comes from what the stage enables: access logging (CloudWatch Logs ingestion and storage), detailed metrics, and the per-request charges of the parent API for traffic served through the stage.

Why does access logging cost more than my requests?

HTTP API requests are only $1.00 per million, but each access-log line is billed at $0.50 per GB ingested. A 1 KB log line per request on a 100 million request month is about 100 GB, roughly $50, which can exceed the request charges. Trim the log format and retention to control it.

How does the stage help prevent cost spikes?

Through throttling. The stage's default and per-route throttle settings cap requests per second, which bounds how large a request bill a traffic surge or misbehaving client can generate. It is a cheap insurance policy against denial-of-wallet scenarios.

Do WebSocket stages add extra charges?

The stage is still free, but WebSocket APIs bill per message and per connection-minute at the parent API level, and stage route settings influence how connections and messages are handled. Idle connections held open through the stage accrue connection-minute charges regardless of message volume.

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_apigatewayv2_stage.