scalr_workspace Resource¶
Manage the state of workspaces in Scalr. Create, update and destroy
Example Usage¶
Basic usage:
resource "scalr_workspace" "example" {
name = "my-workspace-name"
environment_id = "env-xxxxxxxxx"
vcs_provider_id = "my_vcs_provider"
vcs_repo {
identifier = "org/repo"
branch = "dev"
}
}
Argument Reference¶
name
- (Required) Name of the workspace.environment_id
- (Required) ID of the environment, in the formatenv-<RANDOM STRING>
.auto_apply
- (Optional) Set (true/false) to configure ifterraform apply
should automatically run whenterraform plan
ends without error. Defaultfalse
.operations
- (Optional) Set (true/false) to configure workspace remote execution. Whenfalse
workspace is only used to store state. Defaulttrue
. Defaults totrue
.terraform_version
- (Optional) The version of Terraform to use for this workspace. Defaults to the latest available version.working_directory
- (Optional) A relative path that Terraform will be run in. Defaults to the root of the repository.vcs_provider_id
- (Optional) ID of vcs provider - required if vcs-repo present and vice versa, in the formatvcs-<RANDOM STRING>
vcs_repo
- (Optional) Settings for the workspace’s VCS repository.
The vcs_repo
block supports:
identifier
- (Required) A reference to your VCS repository in the format:org/:repo
, this refers to the organization and repository in your VCS provider.branch
- (Optional) The repository branch where Terraform will be run from. Defaultmaster
.
Attribute Reference¶
All arguments plus:
id
- The workspace’s ID, in the formatws-<RANDOM STRING>
.created_by
- Details of the user that created the workspace.
The created_by
block contains:
username
- Username of creator.email
- Email address of creator.full_name
- Full name of creator.
Import¶
To import workspaces use workspace ID as the import ID. For example:
terraform import scalr_workspace.example ws-t47s1aa6s4boubg