> For the complete documentation index, see [llms.txt](https://notes.nomanaziz.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.nomanaziz.me/devops/infrastructure-as-a-code-iac/terraform/7.-terraform-output.md).

# 7. Terraform Output

We can specify certain values in output block which are printed when the config file is applied

```hcl
resource "aws_eip" "one" {
  vpc = true
  network_interface = aws_network_interface.web-server-nic.id
  associate_with_private_ip = "10.0.1.50"
  depends_on = [ aws_internet_gateway.gw, aws_instance.web-server-instance ]
}

output "server_public_ip" {
    value = aws_eip.one.public_ip
}
```

In above example, upon applying the config file, public ip of NIC will be printed on the terminal.
