• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Terraform
  • Install
  • Tutorials
    • About the Docs
    • Configuration Language
    • Terraform CLI
    • Terraform Cloud
    • Terraform Enterprise
    • CDK for Terraform
    • Provider Use
    • Plugin Development
    • Registry Publishing
    • Integration Program
  • Registry(opens in new tab)
  • Try Cloud(opens in new tab)
  • Sign up
Terraform Home

Terraform Cloud

Skip to main content
  • Terraform Cloud
  • Plans and Features
  • Getting Started
    • Overview
    • Organizing Workspaces With Projects
    • Creating Workspaces
    • Terraform Configurations
    • Health
    • Terraform State
    • JSON Filtering
  • Migrating to Terraform Cloud

  • Terraform Cloud Agents

  • Resources

  • Tutorial Library
  • Certifications
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  • Terraform Registry
    (opens in new tab)
  1. Developer
  2. Terraform
  3. Terraform Cloud
  4. Workspaces
  5. Creating Workspaces

»Creating Workspaces

Hands-on: Try the Get Started - Terraform Cloud tutorials.

Workspaces organize infrastructure into meaningful groups. Create new workspaces when you need to manage a new collection of infrastructure resources. You can use the following methods to create workspaces:

  • Terraform Cloud UI: Create a Workspace
  • Workspaces API: Create a Workspace endpoint
  • Terraform Enterprise Provider: tfe_workspace resource
  • No-Code Provisioning: The no-code provisioning workflow creates a new workspace and deploys a no-code ready module's resources in it.

Permissions

You must be a member of a team with manage all projects & workspaces permissions, manage workspaces only permissions, or admin permissions for a project to create a workspace.

Workspace Naming

We recommend using consistent and informative names for new workspaces. One common approach is combining the workspace's important attributes in a consistent order. Attributes can be any defining characteristic of a workspace, such as the component, the component’s run environment, and the region where the workspace is provisioning infrastructure.

This strategy could produce the following example workspace names:

  • networking-prod-us-east
  • networking-staging-us-east
  • networking-prod-eu-central
  • networking-staging-eu-central
  • monitoring-prod-us-east
  • monitoring-staging-us-east
  • monitoring-prod-eu-central
  • monitoring-staging-eu-central

You can add additional attributes to your workspace names as needed. For example, you may add the infrastructure provider, datacenter, or line of business.

Create a Workspace

The workspace creation process varies depending on the workspace workflow you choose (VCS, API, or CLI-driven). To create a workspace in the Terraform Cloud UI:

  1. Click Projects & workspaces to view a list of the workspaces within your organization.

  2. Click New, then select Workspace from the dropdown menu.

  3. Choose a workflow type: Version control, CLI-driven, or API-driven.

  4. (Version control only) Choose an existing version control provider or configure a new one. Refer to Connecting VCS Providers for more details.

  5. (Version control only) Choose a repository from the filterable list. The Configure settings page appears.

    Note: Depending on your provider, you may need to change which account's repositories are shown. You can also scroll to the bottom of the list and enter the repository ID in the text field if it is not immediately visible.

  6. Enter a Workspace Name. This defaults to the repository name, if applicable. The name must be unique within the organization and can include letters, numbers, dashes (-), and underscores (_). Refer to the workspace naming recommendations.

  7. If you have access to multiple projects, choose a Project to add the workspace to. Only teams with permissions for the entire project or the specific workspace will be able to access the workspace. Refer to Organizing Workspaces with Projects for more details.

  8. Add an optional Description that will appear at the top of the workspace in the Terraform Cloud UI.

  9. (Version control only) Open Advanced options to optionally configure the following settings:

    • Terraform Working Directory
    • Automatic Run Triggering
    • VCS branch
    • Include submodules on clone
  10. Click Create workspace.

For CLI and API-driven workspaces, the workspace overview page appears. For version control workspaces, the Configure Terraform variables page appears.

Configure Terraform Variables (Version Control Only)

After you create a new workspace from a version control repository, Terraform Cloud scans its configuration files for Terraform variables and displays any that do not have a default value and do not have a definition in an existing global variable set. Terraform cannot perform successful runs in the workspace until you set values for these variables.

Choose one of the following actions:

  • To skip this step, click Go to workspace overview. You can load these variables from files or create and set values for them later from within the workspace. Terraform Cloud does not automatically scan your configuration again; you can only add variables from within the workspace individually.
  • To configure variables, enter a value for each variable on the page. You may want to leave a variable empty if you plan to provide it through another source, like an auto.tfvars file. Click Save variables to add these variables to the workspace.

After Creating a Workspace

If you have already configured all Terraform variables, we recommend manually starting a run to prepare VCS-driven workspaces. You may also want to do one or more of the following actions:

  • Upload configuration versions: If you chose the API or CLI-Driven workflow, you must upload configuration versions for the workspace.
  • Edit environment variables: Shell environment variables store credentials and customize Terraform's behavior.
  • Edit additional workspace settings: This includes notifications, permissions, and run triggers to start runs automatically.
  • Learn more about running Terraform in your workspace: This includes how Terraform processes runs within the workspace, run modes, run states, etc.

VCS Connection

If you connected a VCS repository to the workspace, Terraform Cloud automatically registers a webhook with your VCS provider. A workspace with no runs will not accept new runs from a VCS webhook, so you must manually start at least one run.

After you manually start a run, Terraform Cloud automatically queues a plan when new commits appear in the selected branch of the linked repository or someone opens a pull request on that branch. Refer to Webhooks for more details.

Edit this page on GitHub

On this page

  1. Creating Workspaces
  2. Permissions
  3. Workspace Naming
  4. Create a Workspace
  5. After Creating a Workspace
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)