Skip to content

The output block ​

Use the output block to define values that a stack exports for consumption by other stacks via outputs sharing. When terramate generate is run, output blocks are translated into the appropriate code for the configured backend (e.g., Terraform output blocks).

INFO

Outputs Sharing is an experimental feature. To use this block, enable the experiment in your Terramate configuration:

hcl
terramate {
  config {
    experiments = ["outputs-sharing"]
  }
}

Arguments ​

  • label (required) - The name of the output.

  • backend (required, string) - The name of the sharing_backend that this output refers to.

  • value (required, expression) - The expression that exports the stack's resource value.

  • description (optional, string) - A description of the output.

  • sensitive (optional, boolean) - Marks the output value as sensitive. Only generated when set.

Syntax ​

hcl
output "vpc_id" {
  backend   = "default"
  value     = module.vpc.id
}

Examples ​

Export a VPC ID ​

hcl
output "vpc_id" {
  backend     = "default"
  value       = module.vpc.id
  description = "The AWS VPC ID"
  sensitive   = false
}

See also ​