RunR v0.6.0

Documentation

runr_cost_limit (Resource)

The monthly cost limit of a pay-as-you-go project (monthly cost limit): one amount in the billing currency, and what happens when the month's cost reaches it — notify the owner, or stop the project as an administrator would. At 80 % the owner is warned. A limit is checked when it is saved, so a stop limit at or below this month so far stops the project at once. A fixed-price project has no limit (the API refuses it with cost_limit_not_available); without the Billing module there are no limits.

Destroying the resource removes the limit; a project the limit stopped stays stopped until it is resumed (Resume on the project's Billing tab, POST /api/projects/{project}/billing/cost-limit/resume, or runr projects resume) — or RunR resumes it when the next month begins. The month's figures are in the runr_cost_limit data source. Needs the project's owner, projects.billing on the project or billing.manage. Import with the project's name or id.

Example Usage#

# 150.00 a month in the billing currency; the project is stopped when this month reaches it
# (the owner is warned at 80 %).
resource "runr_cost_limit" "api" {
  project_id = runr_project.api.id
  amount     = 150
  action     = "stop"
}

Schema#

Required#

  • action (String) At 100 %: notify (the project keeps running) or stop (the project is stopped).
  • amount (Number) The limit per calendar month in the billing currency: greater than 0, at most three decimals.
  • project_id (String) Project id. Changing it moves the limit to another project.

Optional#

  • currency (String) The billing currency of the installation (computed). Set it to make the apply fail when the installation bills in another currency.

Read-Only#

  • id (String) The project id.

Import#

Import is supported using the following syntax:

The terraform import command can be used, for example:

# <project name or id>
terraform import runr_cost_limit.api orders-api

RunR v0.6.0 · MIT License