Skip to main content

dtcloud_project_limits (Data Source)

Reports every quota the platform tracks for a project.

This is the full quota table, covering compute, network, volume and VPN limits. It reports allowances only; dtcloud_project_quotas reports a few headline figures with current usage beside them.

Example Usage​

data "dtcloud_projects" "all" {}

# The full quota table. The platform can add keys without warning, so
# they arrive as a map: index it by name.
data "dtcloud_project_limits" "current" {
project_id = data.dtcloud_projects.all.active_project_id
}

output "core_limit" {
value = data.dtcloud_project_limits.current.quotas["cores"]
}

Schema​

Required​

  • project_id (String) ID of the project, from dtcloud_projects.

Read-Only​

  • id (String) The ID of this resource.
  • names (List of String) The quota names, sorted. Useful for discovering what the platform tracks.
  • quotas (Map of String) Every quota the platform reports, keyed by the name the platform uses. Values are numbers as text, or the word "Unlimited" where the platform reports no limit. Terraform maps hold one type, and the API mixes numbers with that word, so everything is rendered as text — use tonumber() when you need arithmetic.

Behaviour worth knowing​

warning

The values are text, including the numbers. A Terraform map holds one type, and the API mixes numbers with the word Unlimited, so every value is a string. Check for "Unlimited" before converting with tonumber():

locals {
instance_limit = data.dtcloud_project_limits.current.quotas["instances"]
can_build_more = local.instance_limit == "Unlimited" || tonumber(local.instance_limit) > 10
}
  • The keys are the platform's own, such as cores, instances and security_group_rules, and the platform can add more without warning. That is why this is a map rather than a fixed set of attributes: a new quota appears without a provider release. names lists what is there.