Skill 4.3.3
Output values
Key Concepts
output "bucket_arn" { value = aws_s3_bucket.logs.arn } makes the value available after apply. Root module outputs are printed at the end of apply and with terraform output; terraform output -raw NAME prints a plain string for scripts and -json prints all outputs as JSON. Child module outputs are the only way for the parent to read values from inside the module, as module.NAME.OUTPUT.
Outputs accept description, sensitive to redact the value in CLI output, depends_on for rare hidden dependencies, precondition blocks, and ephemeral in child modules. Root outputs are stored in state, which is how terraform_remote_state and HCP Terraform workspaces read them.