cloud block
The block inside the terraform block that connects a configuration to HCP Terraform or Terraform Enterprise.
In more detail
It names the organization and selects workspaces by name or by tags, and can name a project. The hostname defaults to app.terraform.io, so it is only set for Terraform Enterprise. A configuration cannot have both a cloud block and a backend block; terraform init then offers to migrate existing state.
Example
terraform {
cloud {
organization = "harbourline"
workspaces { name = "booking-prod" }
}
}Related terms
- HCP Terraform — HashiCorp's hosted service for running Terraform, which keeps state, runs plans and applies on its own machines, and controls who may change what.
- terraform login — The command that obtains an HCP Terraform API token and saves it in the CLI credentials file.
- HCP Terraform workspace — The HCP Terraform container for one collection of infrastructure: its configuration source, variables, state, run history and team access.
Taught in
- Runs In HCP Terraform: The cloud Block And Remote Execution — HashiCorp Terraform Associate (004) Exam Prep
- HCP Workspaces, Projects And Variable Sets: Which Value Wins? — HashiCorp Terraform Associate (004) Exam Prep
- VCS, CLI And API Workflows: Speculative Plans And Run Triggers — HashiCorp Terraform Associate (004) Exam Prep
- The Full Mock: Sixty Minutes, Eight Areas, One Plan For The Last Week — HashiCorp Terraform Associate (004) Exam Prep