An output gives a name to a value that the root module or a child module exposes. Its value can be an expression, including a resource attribute or a computed collection. A root output appears after apply and can be read with terraform output. An output block does not create infrastructure by itself.
Use outputs to publish a small, deliberate interface instead of asking a caller to inspect internal addresses. The output name and the resource label are independent. A correct value under the wrong output name still breaks a caller that expects the documented interface.
Publish a resource attribute instead of repeating its expected value.