Terraform outputs let you see or share key details about your resources, such as IP addresses or connection strings, which helps in using or connecting to those resources.
output "instance_ip" {
value = aws_instance.web.public_ip
}The output references public_ip which is the public IP address assigned to the instance resource.
Outputs that include sensitive data can be seen by anyone with access to the Terraform state or output, so they should be marked sensitive or avoided.
Outputs allow one module to expose values that other modules can consume as inputs, making it easier to build reusable and connected infrastructure parts.
output "db_password" {
value = aws_db_instance.main.password
sensitive = true
}Setting sensitive = true tells Terraform not to show the output value in plain text in CLI or logs.
