🏗️ Terraform / IaC
Beginner
What are Terraform Outputs?
Answer
Terraform Outputs expose values from your configuration — they are the return values of a Terraform module. Declare: output "instance_ip" { value = aws_instance.web.public_ip; description = "Public IP of the web server" }. View: terraform output instance_ip after apply. Outputs are used to: share values between Terraform configurations (root module to calling module), surface resource IDs and endpoints for use in scripts/CI, expose child module values to the parent. Mark outputs as sensitive = true to suppress them in logs. In root modules, outputs are saved to state and displayed after apply. In child modules, outputs are the only way to pass values to the calling module — all other resource attributes are private to the module.