Terraform: Create workspace with local execution mode from CLI

Created on 2 Nov 2019  ·  4Comments  ·  Source: hashicorp/terraform

Could you add an optional argument to the ”terraform workspace new” command to set the execution mode of the new workspace to local?

Use case: when creating a new service, we want to copy a project template that includes terraform files and automated ci/cd-scripts. With ☝️ we would be able to simple commit and the automated pipeline would create new workspaces, provision infrastructure and deploy artifacts. At the moment, we need to first create the workspaces manually.

backenremote enhancement

Most helpful comment

I personally would like to see this added to the configuration as well; within the definition of the backend like:

terraform {
  backend "remote" {
    hostname     = "app.terraform.io"
    organization = "my-organization"

    workspaces {
      prefix = "myapp-"
      mode = "local" | "remote"
    }
  }
}

All 4 comments

I personally would like to see this added to the configuration as well; within the definition of the backend like:

terraform {
  backend "remote" {
    hostname     = "app.terraform.io"
    organization = "my-organization"

    workspaces {
      prefix = "myapp-"
      mode = "local" | "remote"
    }
  }
}

I think we should be able to also set the default mode at the org level in the TF Cloud UI.

+1

I would also really like to see this. Makes automation more difficult.

Was this page helpful?
0 / 5 - 0 ratings