First, let's determine what to show. Let's take an example - public IP of the new provisioned instance:
$ terraform console
> aws_instance.dev_node.public_ip
"54.159.150.15"
Or to view more details:
$ terraform state show aws_instance.dev_node
To create the output use the file outputs.tf in the project folder:
output "dev_ip" {
value = aws_instance.dev_node.public_ip
}
And to not to provision everything from the beginning and only to refresh the state - use the following command:
$ terraform apply -refresh-only
That besically will consider the output and add it to the current state. So we can view it:
$ terraform output
dev_ip = "54.159.150.15"