HashiCorp Certified: Terraform Associate (004) (HCTA0-004) Questions and Answers
Question 17
What is one disadvantage of using dynamic blocks in Terraform?
Options:
A.
Dynamic blocks can construct repeatable nested blocks
B.
Terraform will run more slowly
C.
They cannot be used to loop through a list of values
D.
They make configuration harder to read and understand
Answer:
D
Explanation:
This is one disadvantage of using dynamic blocks in Terraform, as they can introduce complexity and reduce readability of the configuration. The other options are either advantages or incorrect statements.
Question 18
When do you need to explicitly execute Terraform in refresh-only mode?
Options:
A.
Before every terraform plan.
B.
Before every terraform apply.
C.
Before every terraform import.
D.
None of the above.
Answer:
C
Explanation:
Purpose of Refresh-Only Mode: Running Terraform inrefresh-only modeupdates Terraform ' s state file with the current state of resources in your infrastructure without making changes to the resources themselves.
Context of Terraform Import: When usingterraform import, you’re adding existing resources to the state file, and running Terraform in refresh-only mode before this operation can ensure that any initial configuration syncs precisely with the actual state.
For more on refresh-only mode in relation to terraform import, refer to Terraform ' s import documentation.
terraform validatechecks for syntax errors and internal consistencyin the configuration files.
However, itdoes notcheck if resource configurations are valid with the provider.
Official Terraform Documentation Reference:
terraform validate - HashiCorp Documentation
Question 20
Which of the following is not true of Terraform providers?
Options:
A.
An individual person can write a Terraform Provider
B.
A community of users can maintain a provider
C.
HashiCorp maintains some providers
D.
Cloud providers and infrastructure vendors can write, maintain, or collaborate on Terraform
E.
providers
F.
None of the above
Answer:
F
Explanation:
All of the statements are true of Terraform providers. Terraform providers are plugins that enable Terraform to interact with various APIs and services1. Anyone can write a Terraform provider, either as an individual or as part of a community2. HashiCorp maintains some providers, such as the AWS, Azure, and Google Cloud providers3. Cloud providers and infrastructure vendors can also write, maintain, or collaborate on Terraform providers, such as the VMware, Oracle, and Alibaba Cloud providers. References =
•1: Providers - Configuration Language | Terraform | HashiCorp Developer
•2: Plugin Development - How Terraform Works With Plugins | Terraform | HashiCorp Developer