Skip to main content

dtcloud_projects (Data Source)

Lists the projects on the account, and reports which one the provider is currently scoped to.

Example Usage​

data "dtcloud_projects" "all" {}

output "active_project" {
value = data.dtcloud_projects.all.active_project_name
}

Schema​

Read-Only​

  • active_project_id (String) The project the caller's session is currently pointed at. Everything this provider creates lands in it.
  • active_project_name (String) Name of that project.
  • active_region_id (Number) The region the caller's session is currently pointed at.
  • id (String) The ID of this resource.
  • projects (List of Object) The projects visible to the caller. (see below for nested schema)

Nested Schema for projects​

Read-Only:

  • domain_id (String)
  • id (String)
  • name (String)

Behaviour worth knowing​

warning

active_project_id is where everything lands. Every resource this provider creates goes into that project. Outputting it in a configuration that manages more than a handful of resources makes a misconfigured credential obvious rather than surprising.

  • Changing the active project is not exposed. The API has an endpoint for it, but it switches the caller's session rather than any infrastructure, so driving it from Terraform would silently move where every other call lands.