How do you define an output and what is it for?
BeginnerConceptVariables, Locals, Outputs and Types
Answer
An output block exposes a value. In the root module it prints after apply and can be read by terraform output; in a child module it is how the caller gets values.
output "alb_dns" {
value = aws_lb.main.dns_name
description = "Public DNS of the ALB"
}
More on Variables, Locals, Outputs and Types
How do you declare an input variable?BeginnerIn what order does Terraform load variable values?BeginnerWhat is the difference between locals and variables?BeginnerWhat are the primitive types in Terraform?BeginnerHow do list, set and map differ?IntermediateWhat are `object` and `tuple` types?Intermediate