HashiCorp TA-002-P HashiCorp Certified: Terraform Associate Online Training
HashiCorp TA-002-P Online Training
The questions for TA-002-P were last updated at Jan 12,2025.
- Exam Code: TA-002-P
- Exam Name: HashiCorp Certified: Terraform Associate
- Certification Provider: HashiCorp
- Latest update: Jan 12,2025
Where does the Terraform local backend store its state?
- A . In the /tmp directory
- B . In the terraform.tfvars file
- C . In the terraform.tfstate file
- D . In the user’s .terraformrc file
C
Explanation:
https://www.terraform.io/language/state
The local backend stores state on the local filesystem, locks that state using system APIs, and performs operations locally.
Reference: https://www.terraform.io/docs/language/settings/backends/local.html
Terraform variables and outputs that set the "description" argument will store that description in the state file.
- A . True
- B . False
B
Explanation:
Reference: https://www.terraform.io/docs/language/values/outputs.html
Module variable assignments are inherited from the parent module and do not need to be explicitly set.
- A . True
- B . False
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
- A . Run terraform refresh
- B . It will happen automatically
- C . Manually update the state fire
- D . Run terraform import
A
Explanation:
https://www.terraform.io/cli/commands/refresh#:~:text=The%20terraform%20refresh%20command%20reads%20the%20current%20settings%20from%20all%20managed%20remote%20objects%20and%20updates%20the%20Terraform%20state%20to%20match.
All standard backend types support state storage, locking, and remote operations like plan.
apply and destroy.
- A . True
- B . False
B
Explanation:
https://www.terraform.io/language/settings/backends/configuration "Some of these backends act like plain remote disks for state files, while others support locking the state while operations are being performed. This helps prevent conflicts and inconsistencies. The built-in backends listed are the only backends. You cannot load additional backends as plugins."
What command does Terraform require the first time you run it within a configuration directory?
- A . terraform import
- B . terraform init
- C . terraform plan
- D . terraform workspace
B
Explanation:
terraform init command is used to initialize a working directory containing Terraform configuration files.
Reference: https://www.terraform.io/docs/cli/commands/init.html
Which task does terraform init not perform?
- A . Sources all providers present in the configuration and ensures they are downloaded and available locally
- B . Connects to the backend
- C . Sources any modules and copies the configuration locally
- D . Validates all required variables are present
D
Explanation:
Reference: https://www.terraform.io/docs/cli/commands/init.html
Terraform can run on Windows or Linux, but it requires a Server version of the Windows operating system.
- A . True
- B . False
B
Explanation:
https://www.terraform.io/downloads
What is terraform refresh intended to detect?
- A . Terraform configuration code changes
- B . Empty state files
- C . State file drift
- D . Corrupt state files
C
Explanation:
"The terraform refresh command reads the current settings from all managed remote objects and updates the Terraform state to match. Warning: This command is deprecated, because its default behavior is unsafe if you have misconfigured credentials for any of your providers. See below for more information and recommended alternatives." https://www.terraform.io/cli/commands/refresh
Which of the following is available only in Terraform Enterprise or Cloud workspaces and not in Terraform CLI?
- A . Secure variable storage
- B . Support for multiple cloud providers
- C . Dry runs with terraform plan
- D . Using the workspace as a data source
A
Explanation:
Reference: https://www.terraform.io/docs/language/providers/configuration.html