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 are terraform or shell.
  • key (String) Key of the variable.

Optional

  • account_id (String) The account that owns the variable, specified as an ID, in the format acc-<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 format env-<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. Default false.
  • 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). Default false.
  • hcl (Boolean) Set (true/false) to configure the variable as a string of HCL code. Has no effect for category = "shell" variables. Default false.
  • sensitive (Boolean) Set (true/false) to configure as sensitive. Sensitive variable values are not visible after being set. Default false.
  • value (String, Sensitive) Variable value.
  • workspace_id (String) The workspace that owns the variable, specified as an ID, in the format ws-<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