HashiCorp certification · Exam Terraform-Associate-003

Terraform-Associate-003 Mock Exam Page 5

HashiCorp Certified: Terraform Associate (003) (HCTA0-003)

Free Terraform-Associate-003 mock exam questions 41–50, each with the answer and an explanation.

20 questions · 33 minutes · free, no sign-up

Free Terraform-Associate-003 questions

41–50 of 58 free
Question 41 Choose 1
Infrastructure as Code (laC) can be stored in a version control system along with application code.
Show answerHide answer

Correct answer: A True

Explanation

Explanation: Infrastructure as Code (IaC) can indeed be stored in a version control system along with application code. This practice is a fundamental principle of modern infrastructure management, allowing teams to apply software development practices like versioning, peer review, and CI/CD to infrastructure management. Storing IaC configurations in version control facilitates collaboration, history tracking, and change management.References = While this concept is a foundational aspect of IaC and is widely accepted in the industry, direct references from the HashiCorp Terraform Associate (003) study materials were not found in the provided files. However, this practice is encouraged in Terraform's best practices and various HashiCorp learning resources.
Question 42 Choose 2
Which of these are features of HCP Terraform/Terraform Cloud? (Pick the 2 correct responses)
Show answerHide answer

Correct answer: B, D Remote state storage.A web-based user interface (UI).

Explanation

Explanation: Terraform Cloud provides features like remote state storage and a webbased user interface for managing your Terraform runs. While it offers robust infrastructure as code capabilities, automatic backups of configuration and state are not directly provided by Terraform Cloud; instead, the state is stored remotely and secured.
Question 43 Choose 3
What are some benefits of using Sentinel with Terraform Cloud/Terraform Cloud? Choose three correct answers.
Show answerHide answer

Correct answer: A, D, E You can restrict specific resource configurations, such as disallowing the use of CIDR=0.0.0.0/0.Policy-as-code can enforce security best practicesYou can enforce a list of approved AWS AMIs

Explanation

Explanation: Sentinel is a policy-as-code framework that allows you to define and enforce rules on your Terraform configurations, states, and plans1. Some of the benefits of using Sentinel with Terraform Cloud/Terraform Enterprise are:
•You can restrict specific resource configurations, such as disallowing the use of CIDR=0.0.0.0/0, which would open up your network to the entire internet. This can help you prevent misconfigurations or security vulnerabilities in your infrastructure2.
•Policy-as-code can enforce security best practices, such as requiring encryption, authentication, or compliance standards. This can help you protect your data and meet regulatory requirements3.
•You can enforce a list of approved AWS AMIs, which are pre-configured images that contain the operating system and software you need to run your applications. This can help you ensure consistency, reliability, and performance across your infrastructure4.
References =
•1: Terraform and Sentinel | Sentinel | HashiCorp Developer
•2: Terraform Learning Resources: Getting Started with Sentinel in Terraform Cloud
•3: Exploring the Power of HashiCorp Terraform, Sentinel, Terraform Cloud …
•4: Using New Sentinel Features in Terraform Cloud – Medium
Question 44 Select all that apply
Terraform configuration can only call modules from the public registry.
Show answerHide answer

Correct answer: B False

Explanation

Explanation: Terraform can call modules from various sources including the public Terraform Registry, private registries, local file paths, or version control systems like GitHub.
Question 45 Choose 1
A provider configuration block is required in every Terraform configuration.
Example:

Show answerHide answer

Correct answer: B False

Explanation

Explanation: A provider configuration block is not required in every Terraform configuration. A provider configuration block can be omitted if its contents would otherwise be empty. Terraform assumes an empty default configuration for any provider that is not explicitly configured. However, some providers may require some configuration arguments (such as endpoint URLs or cloud regions) before they can be used. A provider’s documentation should list which configuration arguments it expects. For providers distributed on the Terraform Registry, versioned documentation is available on each provider’s page, via the “Documentation” link in the provider’s header1. References = [Provider Configuration]1
Question 46 Choose 1
The Terraform binary version and provider versions must match each other in a single configuration.
Show answerHide answer

Correct answer: B False

Explanation

Explanation: The Terraform binary version and provider versions do not have to match each other in a single configuration. Terraform allows you to specify provider version constraints in the configuration’s terraform block, which can be different from the Terraform binary version1.
Terraform will use the newest version of the provider that meets the configuration’s version constraints2. You can also use the dependency lock file to ensure Terraform is using the correct provider version3. References =
•1: Providers - Configuration Language | Terraform | HashiCorp Developer
•2: Multiple provider versions with Terraform - Stack Overflow
•3: Lock and upgrade provider versions | Terraform - HashiCorp Developer
Question 47 Choose 1
You should run terraform fnt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions.
Show answerHide answer

Correct answer: A True

Explanation

Explanation: You should run terraform fmt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions. This command applies a subset of the Terraform language style conventions, along with other minor adjustments for readability. It is recommended to use this command to ensure consistency of style across different Terraform codebases. The command is optional, opinionated, and has no customization options, but it can help you and your team understand the code more quickly and easily. References = : Command: fmt : Using Terraform fmt Command to Format Your Terraform Code
Question 48 Choose 3
You want to use API tokens and other secrets within your team's Terraform workspaces. Where does HashiCorp recommend you store these sensitive values? (Pick the 3 correct responses)
Show answerHide answer

Correct answer: A, B, C In an HCP Terraform/Terraform Cloud variable, with the sensitive option checked.In HashiCorp VaultIn a terraform.tfvars file, securely managed and shared with your team.

Explanation

Explanation: Sensitive values such as API tokens should be stored in a secure way, either in Terraform Cloud variables marked as sensitive or in HashiCorp Vault. Storing secrets in version control systems or plaintext files is not recommended.
Question 49 Choose 1
While attempting to deploy resources into your cloud provider using Terraform, you begin to see some odd behavior and experience slow responses. In order to troubleshoot you decide to turn on Terraform debugging. Which environment variables must be configured to make Terraform's logging more verbose?
Show answerHide answer

Correct answer: B TF_LOG

Explanation

Explanation: To make Terraform's logging more verbose for troubleshooting purposes, you must configure the TF_LOG environment variable. This variable controls the level of logging and can be set to TRACE, DEBUG, INFO, WARN, or ERROR, with TRACE providing the most verbose output.References = Detailed debugging instructions and the use of environment variables like TF_LOG for increasing verbosity are part of Terraform's standard debugging practices
Question 50 Choose 1
Any user can publish modules to the public Terraform Module Registry.
Show answerHide answer

Correct answer: A True

Explanation

Explanation: The Terraform Registry allows any user to publish and share modules. Published modules support versioning, automatically generate documentation, allow browsing version histories, show examples and READMEs, and more. Public modules are managed via Git and GitHub, and publishing a module takes only a few minutes. Once a module is published, releasing a new version of a module is as simple as pushing a properly formed Git tag1.
Full mock exam

Sit the Terraform-Associate-003 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real Terraform-Associate-003 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full Terraform-Associate-003 mock exam
  • 65questions per mock
  • 105 mintime limit
  • 194questions in the bank
  • Newmock on every attempt