nerdexam
HashiCorpHashiCorp

TERRAFORM-ASSOCIATE-004 · Question #5

TERRAFORM-ASSOCIATE-004 Question #5: Real Exam Question with Answer & Explanation

The correct answer is B: Run terraform state list to find the name of the resource, then terraform state show to find the. Since no Terraform outputs were defined, you cannot use 'terraform output'. The best approach is: (1) run 'terraform state list' to enumerate all resources managed in the state file and find the specific resource name, then (2) run 'terraform state show <resource_name>' to displa

Submitted by kim_seoul· Apr 18, 2026Manage Terraform State

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

Explanation

Since no Terraform outputs were defined, you cannot use 'terraform output'. The best approach is: (1) run 'terraform state list' to enumerate all resources managed in the state file and find the specific resource name, then (2) run 'terraform state show <resource_name>' to display all attributes of that resource, including its public IP address. Option A is overly complex for a quick lookup. Option C would fail because no output named 'ip_address' was defined. Option D is destructive and should never be used just to retrieve information.

Topics

#Terraform State#CLI Commands#Resource Inspection#Debugging

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 PracticeBrowse All TERRAFORM-ASSOCIATE-004 Questions