scalr_variable
Resource: scalr_variable
Manage the state of the variables in Scalr. Create, update and destroy.
Example Usage
resource "scalr_variable" "example1" {
key = "my_key_name"
value = "my_value_name"
category = "terraform"
description = "variable description"
workspace_id = "ws-xxxxxxxxxx"
}
resource "scalr_variable" "example2" {
key = "xyz"
value = jsonencode(["foo", "bar"])
hcl = true
category = "terraform"
workspace_id = "ws-yyyyyyyyyy"
}
Schema
Required
category
(String) Indicates if this is a Terraform or shell variable. Allowed values areterraform
orshell
.key
(String) Key of the variable.
Optional
account_id
(String) The account that owns the variable, specified as an ID, in the formatacc-<RANDOM STRING>
.description
(String) Variable verbose description, defaults to empty string.environment_id
(String) The environment that owns the variable, specified as an ID, in the formatenv-<RANDOM STRING>
.final
(Boolean) Set (true/false) to configure as final. Indicates whether the variable can be overridden on a lower scope down the Scalr organizational model. Defaultfalse
.force
(Boolean) Set (true/false) to configure as force. Allows creating final variables on higher scope, even if the same variable exists on lower scope (lower is to be deleted). Defaultfalse
.hcl
(Boolean) Set (true/false) to configure the variable as a string of HCL code. Has no effect forcategory = "shell"
variables. Defaultfalse
.sensitive
(Boolean) Set (true/false) to configure as sensitive. Sensitive variable values are not visible after being set. Defaultfalse
.value
(String, Sensitive) Variable value.workspace_id
(String) The workspace that owns the variable, specified as an ID, in the formatws-<RANDOM STRING>
.
Read-Only
id
(String) The ID of this resource.
Import
Import is supported using the following syntax:
terraform import scalr_variable.example var-xxxxxxxxxx
Updated 3 months ago