Workspace app.terraform.io mode local execution?

I need to send the parameter inside my terraform init to create a workspace so that “local execution”.

Thank

Hi @davispalomino,

Can you help me understand this a bit better? What is your current configuration and how are you using Terraform locally?

By declaring a remote backend in the terraform stanza, it will create the workspace for you once you run terraform init locally.

Thanks!

Hi @joatmon08 , I use a remote “app.terraform.io” -Terraform Enterprise- backend to save my state.

Terraform code (main.tf)

Summary
terraform {
      required_version = "> 0.12.0"
      backend "remote" {
        hostname="app.terraform.io"
        organization="myenterprise"
        workspaces {
          name = "myWorkspaceX"
        }
      }
    }

execution:

terraform init
terraform plan -var ‘region=us-east-1’

Error: Run variables are currently not supported

Summary
The "remote" backend does not support setting run variables at this time.
Currently the only to way to pass variables to the remote backend is by
creating a '*.auto.tfvars' variables file. This file will automatically be
loaded by the "remote" backend when the workspace is configured to use
Terraform v0.10.0 or later.

This is because a workspace is created with remote execution mode.

Every time I run the terraform init it creates a new workspace, when I access Terraform Enterprise to view it creates a workspace by default mode of execution-Remote, I would like to know if I can send a command in terraform init or configure to create a workspace with type of execution-local-

Thank You

I ran into a similar problem recently as well. Go into the workspace settings and change to the execution to local. This solved the issue for me.

2 Likes

hi @davispalomino and @davidjeddy – you are correct. We are defaulting any new workspaces to ‘remote execution’ in Terraform Cloud. As @davidjeddy already pointed out, you can change the execution mode to local if you like by going to Settings | General for the specific workspace.

We appreciate the feedback that users will likely want to control this and are exploring options to provide ways for users to do that.

1 Like

hola @davidjeddy
Thanks for your comment, it happens that I can apply changing from remote to local when the workspace is created, but if it is being created by doing “terraform init” by default it is created in remote = (.

Hi @anilmurty1 , We will be aware of the change in order to handle the execution.

Thank You.