Skill 8.4.2
Configuring the cloud block
Key Concepts
terraform { cloud { organization = "example-org" workspaces { name = "app-prod" } } } maps the working directory to one workspace. Instead of name, tags selects every workspace with the given tags, and terraform workspace select then switches between them; project limits or sets the project for new workspaces. hostname defaults to app.terraform.io and is set for Terraform Enterprise.
The cloud block replaces a backend block; a configuration cannot have both. Like backend blocks, it cannot use variables, but the organization and workspace can come from the TF_CLOUD_ORGANIZATION, TF_CLOUD_PROJECT and TF_WORKSPACE environment variables.