TERRAFORM-ASSOCIATE-003 practice question 29 of 30
[Understand Terraform Basics and CLI] Which of the following commands would you use to access all of the attributes and details of a resource managed by Terraform?
Full set: 226 questionsThe terraform state show command is used to inspect a specific resource within the Terraform state file. When provided with the resource's address (in the format resourcetype.resourcename), it outputs all the stored attributes and their values for that particular resource. This allows for a detailed view of a single managed resource, which directly addresses the user's need to access all its attributes and details.
A. terraform state list ‘providertype.name’ This command lists resource instances. Providing an address filters the list to that specific resource, but it only outputs the address itself, not its detailed attributes.
C. terraform get ‘providertype.name’ The terraform get command is used to download and update modules for the configuration. It does not interact with the state file to show resource attributes.
D. terraform state list This command lists the addresses of all resources managed in the current state file. It does not display the detailed attributes of any individual resource.
1. HashiCorp Terraform Documentation, terraform state show command: "The terraform state show command is used to show the attributes of a single resource in the Terraform state." The documentation provides the usage as terraform state show [options] ADDRESS, confirming this is the correct command for the task. (Source: HashiCorp, Terraform CLI Documentation, state show subcommand).
2. HashiCorp Terraform Documentation, terraform state list command: "The terraform state list command is used to list resources within a Terraform state... The output format is the resource address." This confirms that list only shows addresses, not details. (Source: HashiCorp, Terraform CLI Documentation, state list subcommand).
3. HashiCorp Terraform Documentation, terraform get command: "The terraform get command downloads and installs modules needed for the configuration." This confirms its purpose is related to modules, not resource inspection. (Source: HashiCorp, Terraform CLI Documentation, get command).
Keep practicing
Take the free TERRAFORM-ASSOCIATE-003 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other TERRAFORM-ASSOCIATE-003 practice questions
- Question 1[Understand Terraform Basics and CLI] If you update the version constraint in your Terraf…
- Question 2[Navigate Terraform State and Backends] Terraform variable names are saved in the state f…
- Question 3[Understand Terraform Basics and CLI] You modified your Terraform configuration and run T…
- Question 4[Understand Terraform Basics and CLI] You must use different Terraform commands depending…
- Question 6[Understand Terraform Basics and CLI] terraform init creates an example main.tf file in t…
- Question 7[Understand Terraform Basics and CLI] terraform validate confirms that your infrastructur…
