concept

Outputs and module interfaces

Declare an output with a name and value expression. Child outputs are available to callers; ordinary root outputs persist in state. Sensitive display redaction is not encryption.

Formal Syntax & Structure

terraform syntaxterraform
Outputs and module interfaces

Working Example

Example Snippetterraform
variable "port" {  type    = number  default = 8080}
output "service_port" {  description = "Port selected for a fictional local service."  value       = var.port
  precondition {    condition     = var.port >= 1024 && var.port <= 65535 && floor(var.port) == var.port    error_message = "Choose a whole number between 1024 and 65535."  }}
Terraform Reference