Terraform state and Outputs
See terraform output documentation:
File outputs.tf |
Result |
|---|---|
output "hello_ip_addr" { value = hcloud_server.helloServer.ipv4_address description = "The server's IPv4 address" } output "hello_location" { value = hcloud_server.helloServer.location description = "The server's datacenter location" } |
$ terraform output
hello_location = "nbg1"
hello_ip_addr = "159.69.152.37" |
$ terraform output hello_ip_addr "159.69.152.37" |
File outputs.tf |
terraform output
-json |
|---|---|
output "hello_ip_addr" { value = hcloud_server.helloServer.ipv4_address description = "The server's IPv4 address" } output "hello_location" { value = hcloud_server.helloServer.location description = "The server's datacenter location" } |
{
"hello_location": {
"sensitive": false,
"type": "string",
"value": "nbg1"
},
"hello_ip_addr": {
"sensitive": false,
"type": "string",
"value": "159.69.152.37"
}
} |
