output value

A named value a configuration publishes after apply, declared in an output block, like the return value of a function.

In more detail

Outputs serve people reading the apply summary, scripts that need a value afterwards, and callers of a module, which can see nothing else inside it. Give every output a description, because for a module the outputs are its published interface. Outputs are stored in state, so terraform output can read them at any time.

Example

output "manifest_path" {
  description = "File this configuration wrote."
  value       = local_file.manifest.filename
}

Related terms

Taught in

References

Certification courses