HashiCorp Terraform-Associate-004 Exam
HashiCorp Certified: Terraform Associate (004) (Page 3 )

Updated On: 4-Feb-2026

When does Sentinel enforce policy logic during a Terraform Cloud run?

  1. Before the plan phase
  2. During the plan phase
  3. Before the apply phase
  4. After the apply phase

Answer(s): C

Explanation:

Sentinel policies are checked after the plan stage of a Terraform run, but before it can be confirmed or the terraform apply is executed3. This allows you to enforce rules on your infrastructure before it is created or modified.



You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with Terraform and want to manage these VMs using Terraform instead.
What are the two things you must do to achieve this? Choose two correct answers.

  1. Run the terraform Import-gcp command
  2. Write Terraform configuration for the existing VMs
  3. Use the terraform import command for the existing VMs
  4. Provision new VMs using Terraform with the same VM names

Answer(s): B,C

Explanation:

To import existing resources into Terraform, you need to do two things1:

Write a resource configuration block for each resource, matching the type and name used in your state file.

Run terraform import for each resource, specifying its address and ID. There is no such command as terraform Import-gcp, and provisioning new VMs with the same names will not import them into Terraform.



Which of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.

  1. Lets you version, reuse, and share infrastructure configuration
  2. Provisions the same resources at a lower cost
  3. Secures your credentials
  4. Reduces risk of operator error
  5. Prevents manual modifications to your resources

Answer(s): A,D

Explanation:

It lets you version, reuse, and share infrastructure configuration as code files, which can be stored in a source control system and integrated with your CI/CD pipeline.

It reduces risk of operator error by automating repetitive tasks and ensuring consistency across environments. IaC does not necessarily provision resources at a lower cost, secure your credentials, or prevent manual modifications to your resources - these depend on other factors such as your cloud provider, your security practices, and your access policies.



Outside of the required_providers block, Terraform configurations always refer to providers by their local names.

  1. True
  2. False

Answer(s): B

Explanation:

Outside of the required_providers block, Terraform configurations can refer to providers by either their local names or their source addresses. The local name is a short name that can be used throughout the configuration, while the source address is a global identifier for the provider in the format registry.terraform.io/namespace/type. For example, you can use either aws or registry.terraform.io/hashicorp/aws to refer to the AWS provider.



Terraform providers are always installed from the Internet.

  1. True
  2. False

Answer(s): B

Explanation:

Terraform providers are not always installed from the Internet. There are other ways to install provider plugins, such as from a local mirror or cache, from a local filesystem directory, or from a network filesystem. These methods can be useful for offline or air-gapped environments, or for customizing the installation process. You can configure the provider installation methods using the provider_installation block in the CLI configuration file.



Viewing page 3 of 53
Viewing questions 11 - 15 out of 259 questions



Post your Comments and Discuss HashiCorp Terraform-Associate-004 exam prep with other Community members:

Join the Terraform-Associate-004 Discussion