Apply for invite to IaCP

Workspace Resource

The workspace resource allows you to create, update, and delete workspaces in the Scalr IaCP.

resource "tfe_workspace" "test" {
  name         = "my-workspace-name"
  organization = "my-org-name"
}

Example

provider "scalr" {
  hostname = var.hostname
  token    = var.api_token
}

resource "scalr_workspace" "test" {
  name         = "my-workspace-name"
  organization = "your_org_id"
  auto_apply = "true"
  terraform_version = "0.12.19"
  #vcs_repo only needed if you want to link to a repo
   vcs_repo {
      identifier = "repo_org/repo_name"
      oauth_token_id = "the_vcs_id"
      }
  }

Configuration Parameters:

Name

Required

Description

Default

name

y

Name of the workspace.

n/a

organization

y

ID of the organization

n/a

auto_apply

n

Enable auto-apply if the plan, cost, and policy checks are successful.

false

operations

n

This allows Scalr to be the remote executor. If this is disables, Scalr is only used for state storage.

true

queue_all_runs

n

This determines if initial runs should be queued. If false, run that are triggered by VCS will not work until the first manual run is kicked off

false

terraform_version

n

The default Terraform version.

Default is the latest

working_directory

n

The path which Terraform will execute in.

The default is the root of the repository.

vcs_repo

n

A block containing the VCS repository settings.

No default.