RunR v0.6.0

Documentation

runr_api_plan (Resource)

A plan of the API product: rate limits and quotas a consumer (runr_api_consumer) or an API key (runr_api_key) gets (plans). Every limit is optional; the region's gateway-auth enforces them and answers 429 when one is reached. A plan belongs to a gateway or to the organization (offered on every gateway; api_products.manage). A plan that a consumer or an active key uses cannot be deleted.

Import with the plan id: terraform import runr_api_plan.pro 01JP….

Example Usage#

# A plan of the gateway: 10 requests per second (bursts of 20) and 100 000 a month.
resource "runr_api_plan" "pro" {
  gateway_id      = runr_gateway.eu.id
  name            = "Pro"
  description     = "For production use"
  rate_per_second = 10
  burst           = 20
  quota_per_month = 100000
}

# A plan of the organization, offered on every gateway (api_products.manage).
resource "runr_api_plan" "trial" {
  name          = "Trial"
  quota_per_day = 1000
}

Schema#

Required#

  • name (String) Name, unique per gateway (or in the organization).

Optional#

  • burst (Number) Requests at once of the token bucket (at least rate_per_second, at most 1000000). Needs rate_per_second. Left out: the rate for a new plan or a changed rate, else the plan's burst stays.
  • description (String) What the plan offers.
  • gateway_id (String) Gateway id (runr_gateway) the plan belongs to. Left out: a plan of the organization, offered on every gateway. Changing it creates a new plan.
  • quota_per_day (Number) Requests per calendar day, UTC (1-1000000000000). Left out: no limit of this kind.
  • quota_per_month (Number) Requests per calendar month, UTC (1-10000000000000). Left out: no limit of this kind.
  • rate_per_minute (Number) Sliding window, requests per minute (1-10000000). Left out: no limit of this kind.
  • rate_per_second (Number) Token bucket rate, requests per second (1-100000). Left out: no limit of this kind.

Read-Only#

  • id (String) Plan id.

Import#

Import is supported using the following syntax:

The terraform import command can be used, for example:

# <plan id> (`runr gateway plans ls` lists them)
terraform import runr_api_plan.pro 01JPLAN0123456789ABCDEFGHJ

RunR v0.6.0 · MIT License