HashiCorp
TERRAFORM-ASSOCIATE-003 · Question #5
You have deployed a new webapp with a public IP address on a cloud provider. However, you did not create any outputs for your code. What is the best method to quickly find the IP address of the…
The correct answer is B. Run terraform state list to find the name of the resource, then terraform state show to find the. This is a quick way to inspect the state file and find the information you need without modifying anything. The other options are either incorrect or inefficient.
Tools for Test Analysts
Question
You have deployed a new webapp with a public IP address on a cloud provider. However, you did not create any outputs for your code. What is the best method to quickly find the IP address of the resource you deployed?
Options
- AIn a new folder, use the terraform_remote_state data source to load in the state file, then write an
- BRun terraform state list to find the name of the resource, then terraform state show to find the
- CRun terraform output ip_address to view the result
- DRun terraform destroy then terraform apply and look for the IP address in stdout
How the community answered
(32 responses)- A3% (1)
- B81% (26)
- C6% (2)
- D9% (3)
Explanation
This is a quick way to inspect the state file and find the information you need without modifying anything. The other options are either incorrect or inefficient.
Topics
#Terraform#terraform state#resource inspection#outputs
Community Discussion
No community discussion yet for this question.