scalr_variable Resource¶
Manage the state of variables in Scalr. Creates, updates and destroy.
Example Usage¶
Basic usage:
resource "scalr_workspace" "example" {
name = "my-workspace-name"
environment_id = "env-xxxxxxxxxx"
}
resource "scalr_variable" "example" {
key = "my_key_name"
value = "my_value_name"
category = "terraform"
workspace_id = scalr_workspace.example.id
}
Argument Reference¶
key
- (Required) Key of the variable.value
- (Required) Variable value.category
- (Required) Indicates if this is a Terraform or environment variable. Allowed values areterraform
orenv
.hcl
- (Optional) Set (true/false) to configure the variable as a string of HCL code. Has no effect forcategory = "env"
variables. Defaultfalse
.sensitive
- (Optional) Set (true/false) to configure as sensitive. Sensitive variable values are not visible after being set. Defaultfalse
.workspace_id
- (Required) The workspace that owns the variable, specified as an ID, in the formatws-<RANDOM STRING>
.
Attribute Reference¶
All arguments plus:
id
- The ID of the variable, in the formatvar-<RANDOM STRING>
.
Import¶
To import variables use <Environment NAME>/<WORKSPACE NAME>/<VARIABLE ID>
as the import ID. For example:
terraform import scalr_variable.example environment-name/workspace-name/var-xxxxxxxxxxxx