Storing Complex Variables
Describes how to store complex Terraform variable types within Spacelift Contexts and/or a Spacelift Stack's environment.
Usage Example
locals {
map = {
foo = "bar"
}
list = ["this", "is", "a", "list"]
}
resource "spacelift_context" "example" {
description = "Example of storing complex variable types"
name = "Terraform Complex Variable Types Example"
}
resource "spacelift_environment_variable" "map_example" {
context_id = spacelift_context.example.id
name = "map_example"
value = jsonencode(local.map)
write_only = false
}
resource "spacelift_environment_variable" "list_example" {
context_id = spacelift_context.example.id
name = "list_example"
value = jsonencode(local.list)
write_only = false
}
Consuming Stored Variables
Last updated
Was this helpful?