HashiCorp Terraform Associate (HashiCorp Certified: Terraform Associate) Practice Test 1

Question 1

A platform group is replacing manual setup checklists. The requirement is to translate declared intent into an execution plan and then API operations. Which Terraform mechanism directly meets this requirement?

  1. Run the configuration through Terraform CLI
  2. Treat the current state as a mapping, not the source code
  3. Recognize provider plugins as IaC integration adapters
  4. Recognize configuration modules as reusable units
  5. Use a repeatable plan/apply cycle

Explanation

Correct Answer

A:

The CLI parses configuration, resolves dependencies, coordinates provider plugins, and tracks resource bindings through state; it does not require manually operating each provider console; this behavior should be assessed against the concrete need to translate declared intent into an execution plan and then API operations. This directly supports the task to translate declared intent into an execution plan and then API operations during an automated release.

Incorrect Answers

B:

State records associations and attributes needed to reconcile real objects with configuration; configuration expresses desired intent; state is operational metadata about what Terraform currently manages; this behavior should be assessed against the concrete need to translate declared intent into an execution plan and then API operations. That can be useful when the aim is to connect resource addresses to existing remote object identities, but it does not directly deliver the requested ability to translate declared intent into an execution plan and then API operations.

C:

Providers let the same language address different service APIs; terraform Core orchestrates the graph while individual plugins implement the service details; this behavior should be assessed against the concrete need to translate declared intent into an execution plan and then API operations. The distinction matters here: using that mechanism to turn service-specific API operations into Terraform resource and data types would still leave the objective to translate declared intent into an execution plan and then API operations unmet.

D:

Modules let several configurations express a consistent design without duplicating every resource declaration; a module is code organization, not a state backend; this behavior should be assessed against the concrete need to translate declared intent into an execution plan and then API operations. It may support a related workflow, but the question specifically requires the mechanism for translate declared intent into an execution plan and then API operations rather than package a related group of declarative blocks behind inputs and outputs.

E:

Planning previews Terraform's proposed actions while applying realizes them through providers; neither step is the same as manually editing infrastructure in a browser; this behavior should be assessed against the concrete need to translate declared intent into an execution plan and then API operations. The stated requirement is to translate declared intent into an execution plan and then API operations, not to evaluate the effect of a declared change before executing it; this alternative addresses a different control or phase.

Question 2

During a deployment checklist, one task is to provide a preview of proposed infrastructure modifications, while another is to keep common infrastructure patterns consistent across environments. Select the matching pair of techniques.

  1. Review plan output before apply + Parameterize reusable configurations
  2. Separate planning from applying + Reuse community or private modules thoughtfully
  3. Review plan output before apply + Use pull-request review for infrastructure changes
  4. Keep infrastructure changes in Git history + Parameterize reusable configurations
  5. Apply consistent formatting conventions + Parameterize reusable configurations

Explanation

Correct Answer

A:

For the first criterion, the plan exposes create, update, replace, and destroy intentions before the provider APIs execute them; it reduces surprises but cannot guarantee an error-free real-world apply; this behavior should be assessed against the concrete need to provide a preview of proposed infrastructure modifications and keep common infrastructure patterns consistent across environments; this directly addresses the need to provide a preview of proposed infrastructure modifications. For the separate second criterion, input variables and modules allow environment-specific values while retaining a shared design; this reduces divergence without forcing every environment to share one state file; this behavior should be assessed against the concrete need to provide a preview of proposed infrastructure modifications and keep common infrastructure patterns consistent across environments; this fulfills the need to keep common infrastructure patterns consistent across environments. Together they cover the independent tasks of provide a preview of proposed infrastructure modifications and keep common infrastructure patterns consistent across environments without exchanging the responsibilities of these features.

Incorrect Answers

B:

The first measure is intended to add an approval point between change evaluation and execution: A saved execution plan can be reviewed and later applied to execute the selected actions; a saved plan may contain sensitive information and should be protected; this behavior should be assessed against the concrete need to provide a preview of proposed infrastructure modifications and keep common infrastructure patterns consistent across environments. The second measure is intended to accelerate standard designs without copy-pasting whole configurations: A vetted module can expose supported inputs while hiding repeated implementation details; consumers must still review versions, permissions, and actual proposed changes; this behavior should be assessed against the concrete need to provide a preview of proposed infrastructure modifications and keep common infrastructure patterns consistent across environments. Neither is the directly designated method for the separate goals of provide a preview of proposed infrastructure modifications and keep common infrastructure patterns consistent across environments in this review.

C:

The first measure meets the requirement to provide a preview of proposed infrastructure modifications, but its partner serves a different role: Storing configuration as text enables standard code review and approval gates; a review of HCL is not a substitute for safeguarding secrets in state; this behavior should be assessed against the concrete need to provide a preview of proposed infrastructure modifications and keep common infrastructure patterns consistent across environments. That second component is designed to allow peers to inspect diffs before modifying production, so the still-missing criterion is to keep common infrastructure patterns consistent across environments, while the first criterion remains provide a preview of proposed infrastructure modifications.

D:

The second measure does meet the keep common infrastructure patterns consistent across environments requirement, but the first is designed for another concern: Commits and review records identify the definition that changed and when; reverting code can propose infrastructure changes but is not an automatic full infrastructure rollback; this behavior should be assessed against the concrete need to provide a preview of proposed infrastructure modifications and keep common infrastructure patterns consistent across environments. That first component is designed to support traceability and controlled rollback of configuration edits, which does not accomplish the requested task to provide a preview of proposed infrastructure modifications, even though the other measure satisfies keep common infrastructure patterns consistent across environments.

E:

The second measure does meet the keep common infrastructure patterns consistent across environments requirement, but the first is designed for another concern: terraform fmt normalizes supported HCL formatting so reviews focus on meaningful edits; it changes syntax presentation, not the managed cloud resource configuration by itself; this behavior should be assessed against the concrete need to provide a preview of proposed infrastructure modifications and keep common infrastructure patterns consistent across environments. That first component is designed to make infrastructure code easier to compare and maintain, which does not accomplish the requested task to provide a preview of proposed infrastructure modifications, even though the other measure satisfies keep common infrastructure patterns consistent across environments.

Question 3

The immediate Terraform task is to reuse a pattern across environments with clearly defined input boundaries. Which method handles that task most directly?

  1. Reference an output from a resource managed by another provider
  2. Use distinct provider blocks for different APIs
  3. Model on-premises services with supported providers
  4. Keep credentials scoped to each provider integration
  5. Separate service-specific settings from reusable module interfaces

Explanation

Correct Answer

E:

Module variables and provider configuration mapping help callers supply environment-specific choices; provider implementations still determine the resources and supported arguments; this behavior should be assessed against the concrete need to reuse a pattern across environments with clearly defined input boundaries. This directly supports the task to reuse a pattern across environments with clearly defined input boundaries during a configuration change.

Incorrect Answers

A:

Terraform can pass an attribute produced by one provider-managed resource into another provider's argument; the reference establishes ordering even when the APIs differ; this behavior should be assessed against the concrete need to reuse a pattern across environments with clearly defined input boundaries. The distinction matters here: using that mechanism to connect resources across platforms when an attribute creates a dependency would still leave the objective to reuse a pattern across environments with clearly defined input boundaries unmet.

B:

Each provider configuration has its own arguments and credential mechanism; an AWS provider setting does not automatically authenticate an AzureRM provider; this behavior should be assessed against the concrete need to reuse a pattern across environments with clearly defined input boundaries. It may support a related workflow, but the question specifically requires the mechanism for reuse a pattern across environments with clearly defined input boundaries rather than configure authentication and endpoints separately for each platform.

C:

Terraform's provider architecture is not limited to public clouds; a compatible provider can manage a private system if reachable and properly authorized; this behavior should be assessed against the concrete need to reuse a pattern across environments with clearly defined input boundaries. The stated requirement is to reuse a pattern across environments with clearly defined input boundaries, not to include private infrastructure in the same IaC methodology; this alternative addresses a different control or phase.

D:

Each API requires its own authentication material and permissions; terraform does not confer cross-provider privileges simply because both resources share HCL files; this behavior should be assessed against the concrete need to reuse a pattern across environments with clearly defined input boundaries. That can be useful when the aim is to avoid treating access to one environment as universal access, but it does not directly deliver the requested ability to reuse a pattern across environments with clearly defined input boundaries.

Question 4

A review board is defining reproducible infrastructure practices. A reviewer must determine how to connect resource addresses to existing remote object identities. Which action is the appropriate choice?

  1. Distinguish declarative from imperative scripts
  2. Recognize provider plugins as IaC integration adapters
  3. Understand idempotent convergence as the target pattern
  4. Treat the current state as a mapping, not the source code
  5. Run the configuration through Terraform CLI

Explanation

Correct Answer

D:

State records associations and attributes needed to reconcile real objects with configuration; configuration expresses desired intent; state is operational metadata about what Terraform currently manages; this behavior should be assessed against the concrete need to connect resource addresses to existing remote object identities. This directly supports the task to connect resource addresses to existing remote object identities during a staged rollout.

Incorrect Answers

A:

Terraform's dependency graph determines much of the operation order from references; imperative scripts usually encode step-by-step commands without the same persistent resource-state model; this behavior should be assessed against the concrete need to connect resource addresses to existing remote object identities. That can be useful when the aim is to specify the end state instead of an exact sequence of shell commands, but it does not directly deliver the requested ability to connect resource addresses to existing remote object identities.

B:

Providers let the same language address different service APIs; terraform Core orchestrates the graph while individual plugins implement the service details; this behavior should be assessed against the concrete need to connect resource addresses to existing remote object identities. The distinction matters here: using that mechanism to turn service-specific API operations into Terraform resource and data types would still leave the objective to connect resource addresses to existing remote object identities unmet.

C:

After successful reconciliation, a subsequent plan with unchanged inputs and infrastructure normally contains no proposed changes; terraform does not blindly replay a resource-creation script; this behavior should be assessed against the concrete need to connect resource addresses to existing remote object identities. It may support a related workflow, but the question specifically requires the mechanism for connect resource addresses to existing remote object identities rather than avoid recreating unchanged resources on every run.

E:

The CLI parses configuration, resolves dependencies, coordinates provider plugins, and tracks resource bindings through state; it does not require manually operating each provider console; this behavior should be assessed against the concrete need to connect resource addresses to existing remote object identities. That can be useful when the aim is to translate declared intent into an execution plan and then API operations, but it does not directly deliver the requested ability to connect resource addresses to existing remote object identities.

Question 5

A Terraform review separates 2 requirements: (1) surface differences between tracked objects and their real settings; (2) accelerate standard designs without copy-pasting whole configurations. Identify the two features that each directly handle one of those requirements. Choose TWO.

  1. Detect unintended drift during planning
  2. Separate planning from applying
  3. Use automation for repeatable deployments
  4. Use pull-request review for infrastructure changes
  5. Reuse community or private modules thoughtfully

Explanation

Correct Answers

A:

Refreshing remote attributes during planning can reveal external edits; the desired configuration and state provide the basis for proposed remediation; this behavior should be assessed against the concrete need to surface differences between tracked objects and their real settings and accelerate standard designs without copy-pasting whole configurations. This matches the distinct objective to surface differences between tracked objects and their real settings; the remaining chosen features address accelerate standard designs without copy-pasting whole configurations.

E:

A vetted module can expose supported inputs while hiding repeated implementation details; consumers must still review versions, permissions, and actual proposed changes; this behavior should be assessed against the concrete need to surface differences between tracked objects and their real settings and accelerate standard designs without copy-pasting whole configurations. This matches the distinct objective to accelerate standard designs without copy-pasting whole configurations; the remaining chosen features address surface differences between tracked objects and their real settings.

Incorrect Answers

B:

A saved execution plan can be reviewed and later applied to execute the selected actions; a saved plan may contain sensitive information and should be protected; this behavior should be assessed against the concrete need to surface differences between tracked objects and their real settings and accelerate standard designs without copy-pasting whole configurations. Its main application is to add an approval point between change evaluation and execution; the checklist instead asks for surface differences between tracked objects and their real settings; and accelerate standard designs without copy-pasting whole configurations. None of those distinct criteria specifically calls for this alternative.

C:

A pipeline can run init, validation, planning, approvals, and apply reproducibly; it still needs secure credentials and concurrency controls; this behavior should be assessed against the concrete need to surface differences between tracked objects and their real settings and accelerate standard designs without copy-pasting whole configurations. Its main application is to reduce error-prone manual sequencing of the same provisioning routine; the checklist instead asks for surface differences between tracked objects and their real settings; and accelerate standard designs without copy-pasting whole configurations. None of those distinct criteria specifically calls for this alternative.

D:

Storing configuration as text enables standard code review and approval gates; a review of HCL is not a substitute for safeguarding secrets in state; this behavior should be assessed against the concrete need to surface differences between tracked objects and their real settings and accelerate standard designs without copy-pasting whole configurations. Its main application is to allow peers to inspect diffs before modifying production; the checklist instead asks for surface differences between tracked objects and their real settings; and accelerate standard designs without copy-pasting whole configurations. None of those distinct criteria specifically calls for this alternative.

Question 6

During a maintenance request, the team must accomplish all of these distinct aims: (1) connect resources across platforms when an attribute creates a dependency; (2) evaluate multi-service changes with one core orchestration sequence. Select exactly the two relevant mechanisms. Choose TWO.

  1. Reference an output from a resource managed by another provider
  2. Separate service-specific settings from reusable module interfaces
  3. Coordinate dependencies rather than scripting artificial waits
  4. Use a consistent plan-and-apply workflow across providers
  5. Use provider aliases for multiple configurations of one service

Explanation

Correct Answers

A:

Terraform can pass an attribute produced by one provider-managed resource into another provider's argument; the reference establishes ordering even when the APIs differ; this behavior should be assessed against the concrete need to connect resources across platforms when an attribute creates a dependency and evaluate multi-service changes with one core orchestration sequence. This matches the distinct objective to connect resources across platforms when an attribute creates a dependency; the remaining chosen features address evaluate multi-service changes with one core orchestration sequence.

D:

Terraform Core plans a graph containing resources from several provider plugins; availability, limits, and transactional guarantees remain service-specific; this behavior should be assessed against the concrete need to connect resources across platforms when an attribute creates a dependency and evaluate multi-service changes with one core orchestration sequence. This matches the distinct objective to evaluate multi-service changes with one core orchestration sequence; the remaining chosen features address connect resources across platforms when an attribute creates a dependency.

Incorrect Answers

B:

Module variables and provider configuration mapping help callers supply environment-specific choices; provider implementations still determine the resources and supported arguments; this behavior should be assessed against the concrete need to connect resources across platforms when an attribute creates a dependency and evaluate multi-service changes with one core orchestration sequence. Its main application is to reuse a pattern across environments with clearly defined input boundaries; the checklist instead asks for connect resources across platforms when an attribute creates a dependency; and evaluate multi-service changes with one core orchestration sequence. None of those distinct criteria specifically calls for this alternative.

C:

References form dependency edges regardless of which provider creates the objects; an explicit dependency is needed only if no usable expression reference communicates the relationship; this behavior should be assessed against the concrete need to connect resources across platforms when an attribute creates a dependency and evaluate multi-service changes with one core orchestration sequence. Its main application is to let Terraform order cross-provider operations through references; the checklist instead asks for connect resources across platforms when an attribute creates a dependency; and evaluate multi-service changes with one core orchestration sequence. None of those distinct criteria specifically calls for this alternative.

E:

Named provider configurations identify separate endpoints or identities; resources select the appropriate alias instead of inheriting a single default; this behavior should be assessed against the concrete need to connect resources across platforms when an attribute creates a dependency and evaluate multi-service changes with one core orchestration sequence. Its main application is to manage two regions or accounts of the same provider in one root module; the checklist instead asks for connect resources across platforms when an attribute creates a dependency; and evaluate multi-service changes with one core orchestration sequence. None of those distinct criteria specifically calls for this alternative.

Question 7

The immediate Terraform task is to specify the end state instead of an exact sequence of shell commands. Which method handles that task most directly?

  1. Recognize provider plugins as IaC integration adapters
  2. Distinguish declarative from imperative scripts
  3. Recognize configuration modules as reusable units
  4. Use provider-backed resource blocks

Explanation

Correct Answer

B:

Terraform's dependency graph determines much of the operation order from references; imperative scripts usually encode step-by-step commands without the same persistent resource-state model; this behavior should be assessed against the concrete need to specify the end state instead of an exact sequence of shell commands. This directly supports the task to specify the end state instead of an exact sequence of shell commands during a configuration change.

Incorrect Answers

A:

Providers let the same language address different service APIs; terraform Core orchestrates the graph while individual plugins implement the service details; this behavior should be assessed against the concrete need to specify the end state instead of an exact sequence of shell commands. The distinction matters here: using that mechanism to turn service-specific API operations into Terraform resource and data types would still leave the objective to specify the end state instead of an exact sequence of shell commands unmet.

C:

Modules let several configurations express a consistent design without duplicating every resource declaration; a module is code organization, not a state backend; this behavior should be assessed against the concrete need to specify the end state instead of an exact sequence of shell commands. The stated requirement is to specify the end state instead of an exact sequence of shell commands, not to package a related group of declarative blocks behind inputs and outputs; this alternative addresses a different control or phase.

D:

Managed resource blocks describe objects to create, update, or remove; providers implement the remote API operations; a block alone does not create anything until execution; this behavior should be assessed against the concrete need to specify the end state instead of an exact sequence of shell commands. That can be useful when the aim is to declare infrastructure objects Terraform is expected to manage, but it does not directly deliver the requested ability to specify the end state instead of an exact sequence of shell commands.

Question 8

In an automated release, the requested result is to catch configuration problems before attempting deployment. What should the engineer select?

  1. Use pull-request review for infrastructure changes
  2. Keep infrastructure changes in Git history
  3. Parameterize reusable configurations
  4. Run static validation in CI
  5. Detect unintended drift during planning

Explanation

Correct Answer

D:

terraform validate checks structural validity and supported arguments after initialization; it does not prove a cloud API call will succeed with current credentials or quotas; this behavior should be assessed against the concrete need to catch configuration problems before attempting deployment. This directly supports the task to catch configuration problems before attempting deployment during a module implementation.

Incorrect Answers

A:

Storing configuration as text enables standard code review and approval gates; a review of HCL is not a substitute for safeguarding secrets in state; this behavior should be assessed against the concrete need to catch configuration problems before attempting deployment. That can be useful when the aim is to allow peers to inspect diffs before modifying production, but it does not directly deliver the requested ability to catch configuration problems before attempting deployment.

B:

Commits and review records identify the definition that changed and when; reverting code can propose infrastructure changes but is not an automatic full infrastructure rollback; this behavior should be assessed against the concrete need to catch configuration problems before attempting deployment. The distinction matters here: using that mechanism to support traceability and controlled rollback of configuration edits would still leave the objective to catch configuration problems before attempting deployment unmet.

C:

Input variables and modules allow environment-specific values while retaining a shared design; this reduces divergence without forcing every environment to share one state file; this behavior should be assessed against the concrete need to catch configuration problems before attempting deployment. It may support a related workflow, but the question specifically requires the mechanism for catch configuration problems before attempting deployment rather than keep common infrastructure patterns consistent across environments.

E:

Refreshing remote attributes during planning can reveal external edits; the desired configuration and state provide the basis for proposed remediation; this behavior should be assessed against the concrete need to catch configuration problems before attempting deployment. That can be useful when the aim is to surface differences between tracked objects and their real settings, but it does not directly deliver the requested ability to catch configuration problems before attempting deployment.

Question 9

An engineer needs to let Terraform order cross-provider operations through references as part of an automated release. Which option is the best fit?

  1. Model on-premises services with supported providers
  2. Use provider aliases for multiple configurations of one service
  3. Keep credentials scoped to each provider integration
  4. Coordinate dependencies rather than scripting artificial waits
  5. Understand limitations of cross-cloud consistency

Explanation

Correct Answer

D:

References form dependency edges regardless of which provider creates the objects; an explicit dependency is needed only if no usable expression reference communicates the relationship; this behavior should be assessed against the concrete need to let Terraform order cross-provider operations through references. This directly supports the task to let Terraform order cross-provider operations through references during an infrastructure audit.

Incorrect Answers

A:

Terraform's provider architecture is not limited to public clouds; a compatible provider can manage a private system if reachable and properly authorized; this behavior should be assessed against the concrete need to let Terraform order cross-provider operations through references. The stated requirement is to let Terraform order cross-provider operations through references, not to include private infrastructure in the same IaC methodology; this alternative addresses a different control or phase.

B:

Named provider configurations identify separate endpoints or identities; resources select the appropriate alias instead of inheriting a single default; this behavior should be assessed against the concrete need to let Terraform order cross-provider operations through references. That can be useful when the aim is to manage two regions or accounts of the same provider in one root module, but it does not directly deliver the requested ability to let Terraform order cross-provider operations through references.

C:

Each API requires its own authentication material and permissions; terraform does not confer cross-provider privileges simply because both resources share HCL files; this behavior should be assessed against the concrete need to let Terraform order cross-provider operations through references. The distinction matters here: using that mechanism to avoid treating access to one environment as universal access would still leave the objective to let Terraform order cross-provider operations through references unmet.

E:

Providers normalize lifecycle orchestration but do not erase product differences; matching resource names do not guarantee equivalent semantics or quotas; this behavior should be assessed against the concrete need to let Terraform order cross-provider operations through references. The stated requirement is to let Terraform order cross-provider operations through references, not to avoid assuming different providers expose identical capabilities; this alternative addresses a different control or phase.

Question 10

In an automated release, the requested result is to evaluate the effect of a declared change before executing it. What should the engineer select?

  1. Run the configuration through Terraform CLI
  2. Use a repeatable plan/apply cycle
  3. Recognize configuration modules as reusable units
  4. Treat the current state as a mapping, not the source code

Explanation

Correct Answer

B:

Planning previews Terraform's proposed actions while applying realizes them through providers; neither step is the same as manually editing infrastructure in a browser; this behavior should be assessed against the concrete need to evaluate the effect of a declared change before executing it. This directly supports the task to evaluate the effect of a declared change before executing it during a module implementation.

Incorrect Answers

A:

The CLI parses configuration, resolves dependencies, coordinates provider plugins, and tracks resource bindings through state; it does not require manually operating each provider console; this behavior should be assessed against the concrete need to evaluate the effect of a declared change before executing it. It may support a related workflow, but the question specifically requires the mechanism for evaluate the effect of a declared change before executing it rather than translate declared intent into an execution plan and then API operations.

C:

Modules let several configurations express a consistent design without duplicating every resource declaration; a module is code organization, not a state backend; this behavior should be assessed against the concrete need to evaluate the effect of a declared change before executing it. That can be useful when the aim is to package a related group of declarative blocks behind inputs and outputs, but it does not directly deliver the requested ability to evaluate the effect of a declared change before executing it.

D:

State records associations and attributes needed to reconcile real objects with configuration; configuration expresses desired intent; state is operational metadata about what Terraform currently manages; this behavior should be assessed against the concrete need to evaluate the effect of a declared change before executing it. The distinction matters here: using that mechanism to connect resource addresses to existing remote object identities would still leave the objective to evaluate the effect of a declared change before executing it unmet.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests