The input block β
Use the input block to define values that a stack depends on from other stacks. When terramate generate is run, input blocks are translated into the appropriate code for the configured backend (e.g., Terraform variable blocks).
INFO
Outputs Sharing is an experimental feature. To use this block, enable the experiment in your Terramate configuration:
terramate {
config {
experiments = ["outputs-sharing"]
}
}Arguments β
label (required) - The name of the input variable.
backend(required, string) - The name of thesharing_backendthat this input refers to.from_stack_id(required, string) - The stack ID of the stack whose outputs this input depends on.value(required, expression) - An expression that computes this input at runtime from the referenced stack's outputs.sensitive(optional, boolean) - Marks the input value as sensitive. Only generated when set.mock(optional, any) - A fallback value used when the dependency stack's outputs are not yet applied (useful for previewing planned changes).
Syntax β
input "vpc_id" {
backend = "default"
from_stack_id = "vpc"
value = outputs.vpc_id.value
}Examples β
Import a VPC ID from another stack β
input "vpc_id" {
backend = "default"
from_stack_id = "vpc"
value = outputs.vpc_id.value
}Use a mock value for plan previews β
input "vpc_id" {
backend = "default"
from_stack_id = "vpc"
value = outputs.vpc_id.value
mock = "vpc-mock-id"
}