kl quota

kl quota exists to answer a specific question before apply:

Will this state still fit within the backend’s soft and hard limits?

OSS / self-hosted default: quotas are typically not enforced in the default self-hosted OSS setup. They become relevant when you explicitly configure entitlement limits through klc or when you run KiloLock in a managed / cloud environment where quota policy is part of the service model.

Subcommands

  • kl quota remaining
  • kl quota check

kl quota remaining

Shows current quota headroom for the backend state.

Example

kl quota remaining

Use it when you want the current shape of the state and environment before doing any planning work.

kl quota check

Evaluates a Terraform plan against quota.

Example with a binary plan file

terraform plan -out=plan.tfplan
kl quota check --tf-plan plan.tfplan

Example with JSON

terraform show -json plan.tfplan > plan.json
kl quota check --tf-plan-json plan.json

Use it when:

  • you want CI to fail before the final state write
  • you need a plain quota gate independent of kl apply
  • you want to inspect soft-limit warnings explicitly

Relationship to kl plan and kl apply

  • kl quota check is the focused quota command.
  • kl plan performs a similar preflight when it can discover backend context.
  • kl apply enforces quota preflight before mutation.

Good CI pattern

terraform plan -out=plan.tfplan
kl quota check --tf-plan plan.tfplan
kl plan -o kl-plan.json
kl apply --plan-spec kl-plan.json --wait-timeout 0

Exit behavior

  • hard-limit overages fail
  • soft-limit overages warn

That means kl quota is useful both as a hard gate and as an early-warning signal.