Summary
The spacelift_run resource currently supports triggering runs on a stack, but has no way to pass custom runtime configuration, environment variables or Terraform variable overrides scoped to a single run.
This capability already exists in the Spacelift UI ("Trigger with custom runtime config") and the GraphQL API, but the Terraform provider doesn't expose it.
Use Case
When programmatically triggering runs, it's common to need per-run configuration that differs from the stack's default. For example:
- Passing a one-time variable override to control behavior for a specific run
- Setting an environment variable that should not persist on the stack
- Triggering a targeted plan/apply with runtime-specific parameters
Proposed Change
Add an optional block to spacelift_run for runtime configuration:
resource "spacelift_run" "example" {
stack_id = spacelift_stack.this.id
runtime_config {
environment_variable {
key = "TARGET_RESOURCE"
value = "aws_instance.example"
}
terraform_variable {
key = "enable_migration"
value = "true"
}
}
}
Summary
The
spacelift_runresource currently supports triggering runs on a stack, but has no way to pass custom runtime configuration, environment variables or Terraform variable overrides scoped to a single run.This capability already exists in the Spacelift UI ("Trigger with custom runtime config") and the GraphQL API, but the Terraform provider doesn't expose it.
Use Case
When programmatically triggering runs, it's common to need per-run configuration that differs from the stack's default. For example:
Proposed Change
Add an optional block to
spacelift_runfor runtime configuration: