PRACTICE ENGINE · TERRAFORM ASSOCIATE

Terraform Associate Practice Exam.
Free practice test — 45 verified questions, instant feedback.

Progress saves on this device — no signup
Difficulty
QUESTION 1 / 45Understand Infrastructure as Code (IaC) conceptsEasy
A team currently provisions cloud servers by manually clicking through a console and keeping a shared spreadsheet of what was created. Which core benefit would adopting Infrastructure as Code (IaC) most directly provide?
0/0session

Know the exam before you sit it

the facts most prep sites bury
Scored questions
1h m time limit
Passing score
Set by the governing body
Study by section weight
The cheat sheet is built like the exam blueprint →

Every free resource for this exam

family overview →

Get a free Terraform Associate study plan

A week-by-week plan plus new practice questions, straight to your inbox.

Frequently asked questions

What version of Terraform does the Terraform Associate (004) exam cover, and what does it test?

The 004 exam tests on Terraform 1.12. It measures your knowledge across eight objective domains: Infrastructure as Code (IaC) concepts, the purpose of Terraform versus other IaC tools, Terraform basics, using Terraform outside of the core workflow, interacting with modules, the core Terraform workflow, implementing and maintaining state, and reading/generating/modifying configuration. Content spans areas like state management (local and remote backends, state locking, and drift management) and HCP Terraform (cloud-based infrastructure creation, collaboration features, and workspace organization). Note that the exam does not publish per-objective percentage weightings, so you should aim for balanced coverage rather than betting on any single domain.

How long is the exam, what does it cost, and what question formats should I expect?

The exam is an online proctored, multiple choice exam that lasts 60 minutes and costs $70.50 USD (plus locally applicable taxes and fees). A free retake is not included in that price, so treat your first attempt as the one that counts and budget for a second sitting only if needed. You'll encounter three question formats: true or false, multiple choice, and multiple answer questions. Because multiple-answer questions require selecting every correct option, read those carefully and note how many answers each question asks for. With roughly 60 minutes for the whole exam, pacing yourself to avoid getting stuck on any single item is worthwhile.

Who is this certification for, and what background do I need before attempting it?

The Terraform Associate (004) is aimed at Cloud Engineers, DevOps practitioners, and others who use Terraform in production. The recommended prerequisites are basic terminal skills and a basic understanding of on-premises and cloud architecture; professional experience is recommended but not required. This means motivated newcomers can pass without a formal job title in the field, but you should be comfortable running commands in a terminal and understand core cloud concepts before you begin. Hands-on practice writing and applying configurations will help far more than reading alone, given the workflow- and configuration-focused objectives.

How long is the credential valid, and what should I plan for after passing?

The Terraform Associate credential is valid for 2 years. After that window, you'll need to recertify to keep your credential current — so it's worth noting your pass date and setting a reminder roughly a couple of months before expiry to review and re-sit. Because the exam version tracks a specific Terraform release (currently 1.12), the recertification exam may test on a newer version and updated objectives by the time you renew, so plan to refresh your knowledge of the latest features rather than relying solely on what you learned the first time.

Browse all questions & answers
  1. 1. A team currently provisions cloud servers by manually clicking through a console and keeping a shared spreadsheet of what was created. Which core benefit would adopting Infrastructure as Code (IaC) most directly provide?

    • A. Infrastructure changes become reproducible and reviewable because they are defined in version-controlled configuration files
    • B. Cloud provider costs are automatically reduced regardless of the resources deployed
    • C. The need for testing before deploying to production is eliminated
    • D. Manual console access is required in addition to the code to keep infrastructure accurate
    Show answer & explanation

    Answer: A
    IaC's core value is treating infrastructure definitions as code: reviewable diffs, version history, and repeatable, auditable changes replace undocumented manual clicks. It does not automatically cut cloud spend, does not remove the need for testing, and it reduces (not adds) reliance on manual console changes since the code becomes the source of truth.

  2. 2. Which statement best describes a key advantage of a declarative IaC approach (like Terraform) compared to a purely imperative scripting approach for provisioning infrastructure?

    • A. You describe the desired end state and the tool determines the steps to reach it, rather than scripting each individual action in order
    • B. Declarative tools never need to communicate with a provider API
    • C. Declarative configurations cannot be reused across environments
    • D. Imperative scripts automatically track infrastructure drift over time
    Show answer & explanation

    Answer: A
    Declarative IaC specifies the desired end state, and the tool computes the plan of actions needed, unlike imperative scripts which encode explicit step-by-step commands. Declarative tools still call provider APIs, are commonly reused across environments via variables, and plain imperative scripts have no built-in drift detection.

  3. 3. An organization wants infrastructure changes to go through the same pull-request review process as application code changes. Which IaC characteristic makes this workflow possible?

    • A. Infrastructure configurations are stored as plain-text files that can be committed to a version control system
    • B. IaC tools require a dedicated binary configuration format that cannot be diffed
    • C. Cloud providers mandate that all changes be reviewed before an API accepts them
    • D. IaC eliminates the need for a version control system entirely
    Show answer & explanation

    Answer: A
    Because IaC configurations are plain text, they can be committed, diffed, and reviewed in version control exactly like application code, enabling PR-based review workflows. IaC tools use human-readable text formats (not undiffable binaries), providers don't enforce review, and version control remains essential rather than eliminated.

  4. 4. A company deploys resources across AWS, Azure, and an on-premises VMware cluster and wants a single tool and workflow to manage all three. Which characteristic of Terraform makes it well suited to this multi-platform scenario compared to a single cloud vendor's native IaC tool?

    • A. Terraform uses a provider plugin model that lets the same workflow target many different platforms through their respective APIs
    • B. Terraform only works with a single cloud vendor at a time and requires separate state files per vendor tool
    • C. Terraform automatically migrates resources between clouds without reconfiguration
    • D. Terraform requires each provider to expose an identical API schema
    Show answer & explanation

    Answer: A
    Terraform's provider plugin architecture abstracts many different platform APIs behind a common configuration language and workflow, which is why it's commonly chosen for multi-cloud/hybrid scenarios, unlike vendor-native tools scoped to one platform. It doesn't migrate resources between clouds automatically, and providers are not required to share an identical schema — each provider maps its own resource types.

  5. 5. Compared to a configuration management tool primarily focused on configuring software on existing servers, what is Terraform primarily designed to manage?

    • A. The provisioning and lifecycle of infrastructure resources themselves, such as compute instances, networks, and managed services
    • B. Installing and updating application packages on an already-running operating system
    • C. Real-time application performance monitoring and alerting
    • D. Source code compilation and build artifact packaging
    Show answer & explanation

    Answer: A
    Terraform's core purpose is provisioning and managing the lifecycle of infrastructure resources (create, update, destroy), whereas configuration management tools focus on configuring software state on already-provisioned machines. Terraform is not a package installer, a monitoring platform, or a build/CI tool, though it is often used alongside such tools.

  6. 6. A team is choosing between Terraform and a mutable, agent-based configuration tool for managing cloud VM infrastructure that is frequently torn down and recreated. Why might Terraform's immutable infrastructure model be preferable in this scenario?

    • A. Replacing resources from a known configuration reduces configuration drift compared to repeatedly mutating long-lived servers in place
    • B. Immutable infrastructure guarantees zero downtime during every apply
    • C. Mutable tools cannot run more than once against the same server
    • D. Immutable infrastructure requires no state tracking of any kind
    Show answer & explanation

    Answer: A
    Terraform's tendency to replace rather than mutate resources in place helps avoid configuration drift that accumulates when servers are patched repeatedly, which fits well with frequently recycled infrastructure. It does not guarantee zero downtime on every apply, mutable tools can absolutely run repeatedly against the same host, and Terraform still requires tracking state to know what exists.

  7. 7. Which of the following is the correct sequence of the core Terraform workflow when making a change to existing infrastructure?

    • A. terraform init, then terraform plan, then terraform apply
    • B. terraform apply, then terraform plan, then terraform init
    • C. terraform destroy, then terraform init, then terraform plan
    • D. terraform validate, then terraform destroy, then terraform apply
    Show answer & explanation

    Answer: A
    The standard core workflow is init (prepare the working directory and providers), plan (preview proposed changes), then apply (execute them) — in that order. Applying before planning skips change review, destroying before initializing is out of order and destructive by default, and validate/destroy/apply is not the standard change workflow.

  8. 8. A developer runs `terraform plan` and sees that an EC2 instance will be destroyed and recreated rather than updated in place, even though only one attribute changed. What most likely explains this behavior?

    • A. The changed attribute requires replacement because the provider cannot update it in place, so Terraform plans a destroy-and-recreate
    • B. terraform plan always destroys and recreates every resource regardless of what changed
    • C. The state file has become corrupted and must be manually deleted
    • D. The developer must run terraform import before any further changes are allowed
    Show answer & explanation

    Answer: A
    Some resource attributes are marked by the provider schema as requiring replacement (ForceNew-style behavior) because the underlying API has no in-place update path for that attribute, so Terraform plans destroy-then-create. Plan does not always destroy every resource, this behavior does not indicate state corruption, and import is unrelated to why a specific attribute forces replacement.

  9. 9. During `terraform apply`, a user is prompted with a plan summary and asked to type 'yes' to proceed. What is the purpose of this interactive approval step in the core workflow?

    • A. It gives the operator a final chance to review the exact set of additions, changes, and destructions before they are applied to real infrastructure
    • B. It re-downloads all provider plugins before any resources can change
    • C. It permanently locks the configuration files from further edits
    • D. It is required only the very first time a workspace is ever applied
    Show answer & explanation

    Answer: A
    The apply confirmation step exists so an operator can review the concrete plan output (adds/changes/destroys) before it's executed against real infrastructure, preventing unintended changes. It does not re-download providers, does not lock config files, and applies every time apply is run interactively, not just the first time.

  10. 10. A CI pipeline runs terraform apply non-interactively for every merge to main. Which flag or approach is appropriate to skip the interactive yes/no confirmation while still applying a specific saved plan?

    • A. Run terraform apply against a previously saved plan file so the exact reviewed changes are applied without re-prompting
    • B. Delete the state file before every apply so no confirmation is needed
    • C. Run terraform taint on every resource before applying
    • D. Disable the provider's authentication so the apply always fails safely
    Show answer & explanation

    Answer: A
    Applying a saved plan file (created via terraform plan -out) in automation lets CI apply exactly the reviewed changes without interactive confirmation. Deleting the state file would cause Terraform to lose track of existing resources and likely attempt to recreate everything; tainting every resource forces unnecessary replacement; and disabling authentication would simply break the pipeline.

  11. 11. A configuration file defines a resource block for an AWS S3 bucket with several arguments and a nested lifecycle block. Which statement correctly describes HCL syntax being used here?

    • A. Resource blocks use a resource type and a local name, and arguments inside are key-value pairs, with nested blocks representing structured sub-configuration
    • B. HCL requires all resource arguments to be defined as separate top-level resource blocks
    • C. Nested blocks like lifecycle can only be used inside variable declarations
    • D. HCL syntax mandates that every block be wrapped in double quotes
    Show answer & explanation

    Answer: A
    HCL resource blocks follow the pattern resource "type" "name" { arguments and nested blocks }, where nested blocks like lifecycle group related structured configuration under the resource. Arguments aren't required to be separate top-level resources, lifecycle blocks are used inside resource blocks (not variable declarations), and blocks are not wrapped in quotes — only certain labels are quoted strings.

  12. 12. A configuration needs to reference the ID of an aws_vpc resource named "main" from within an aws_subnet resource's vpc_id argument. Which expression correctly does this?

    • A. aws_vpc.main.id
    • B. vpc.main.id
    • C. aws_subnet.main.vpc_id
    • D. var.aws_vpc.main.id
    Show answer & explanation

    Answer: A
    Terraform resource references follow the pattern <resource_type>.<local_name>.<attribute>, so aws_vpc.main.id correctly references the id attribute of the aws_vpc resource named main. 'vpc.main.id' omits the required resource type prefix, 'aws_subnet.main.vpc_id' references the subnet's own argument rather than the VPC's exported id, and prefixing with var. is incorrect since this is a resource reference, not an input variable.

  13. 13. A variable block declares `variable "instance_count" { type = number, default = 2 }`. If a caller does not supply a value for instance_count, what value will Terraform use?

    • A. The default value of 2, since no override was supplied
    • B. Terraform will always fail immediately at plan time due to a missing required value
    • C. Terraform will silently substitute the value 0 for any numeric variable without a default
    • D. Terraform will prompt for the value only during terraform destroy
    Show answer & explanation

    Answer: A
    When a variable has a default and no other value is supplied via -var, a tfvars file, or environment variable, Terraform uses that default. It will not fail since a default exists, it does not silently substitute 0 for undeclared defaults, and prompting (when it happens for variables with no default) is not limited to destroy operations.

  14. 14. A configuration must create three nearly identical S3 buckets, differing only by name, based on a list variable containing three strings. Which HCL construct is most appropriate?

    • A. A count or for_each meta-argument on the resource block, iterating over the list to create one instance per element
    • B. Writing three separate, hand-duplicated resource blocks with unique local names
    • C. A provisioner block that loops internally to create each bucket
    • D. A nested module with no input variables at all
    Show answer & explanation

    Answer: A
    count or for_each meta-arguments let a single resource block iterate over a list or map to produce multiple similar resource instances without duplication. Hand-duplicating blocks works but violates DRY and doesn't scale; provisioners run scripts on resources rather than looping resource creation; and a module without any input variables couldn't parameterize the bucket names at all.

  15. 15. An engineer wants to select an appropriate meta-argument for creating multiple resource instances from a map where each resource needs a stable identity even if items are added or removed from the middle of the collection. Why is for_each generally preferred over count in this case?

    • A. for_each keys each instance by a map key or set value, so removing or adding an unrelated element does not shift the index-based identity of other instances
    • B. count automatically re-keys instances by name whenever the list changes
    • C. for_each cannot be used with modules, only with resources
    • D. count and for_each are functionally identical and interchangeable in every scenario
    Show answer & explanation

    Answer: A
    for_each keys instances by a stable map key/set value, so unrelated additions or removals don't shift other instances' identities, whereas count's numeric-index identity can cause unrelated resources to be destroyed and recreated when the list changes. count does not re-key by name, for_each works with both resources and modules, and the two are not interchangeable in every scenario given this indexing difference.

  16. 16. A configuration includes `locals { name_prefix = "${var.environment}-app" }` and later references `local.name_prefix` in multiple resources. What is the primary benefit of using a local value here?

    • A. It computes a derived expression once and gives it a reusable name, avoiding repeating the same interpolation logic across multiple resources
    • B. Local values can be overridden at apply time using a -var flag just like input variables
    • C. Local values automatically become outputs of the root module
    • D. Local values are required before any variable can be declared
    Show answer & explanation

    Answer: A
    Locals let you name a computed expression once and reuse it, reducing duplication and improving readability versus repeating the interpolation in every resource. Unlike variables, locals cannot be overridden with -var; they are not automatically exposed as outputs unless explicitly defined in an output block; and there is no ordering requirement that locals precede variable declarations.

  17. 17. A root configuration calls a module for provisioning a VPC, passing in a cidr_block variable and expecting a vpc_id back for use elsewhere in the root. Which two module features make this data flow possible?

    • A. Input variables defined in the module accept values from the caller, and output values defined in the module expose data back to the caller
    • B. Modules automatically share their entire state with the root module without any explicit inputs or outputs
    • C. Only the root module can define variables; child modules can only define outputs
    • D. Modules communicate exclusively through provider configuration blocks
    Show answer & explanation

    Answer: A
    A module receives configuration through its own input variable declarations and exposes computed data to callers through output values — this variable-in, output-out pattern is exactly how the root passes cidr_block in and receives vpc_id back. Modules do not implicitly share full state without explicit outputs, child modules can and do define their own variables, and this data flow has nothing to do with provider blocks.

  18. 18. A team wants to reuse a well-tested networking module published by a third party, pinning it to a specific version to avoid unexpected breaking changes. Which source configuration best supports this in a module block?

    • A. Referencing the module from a registry source with an explicit version constraint, e.g. version = "~> 2.0"
    • B. Copying the module's source files directly into every consuming configuration's directory
    • C. Referencing the module source with no version argument so it always tracks the newest release
    • D. Declaring the module as a provider block instead of a module block
    Show answer & explanation

    Answer: A
    Registry module sources support a version constraint argument, letting teams pin to a known-good version range and control upgrades deliberately. Copying files defeats the purpose of centralized reuse and updates; omitting a version constraint risks unexpected breaking changes on the next run; and modules and providers are distinct block types serving different purposes.

  19. 19. Within a root module, a child module block is written as `module "network" { source = "./modules/network" }` and the module internally creates an aws_vpc resource named "this". How would the root module reference an output value named vpc_id exposed by that module?

    • A. module.network.vpc_id
    • B. aws_vpc.this.vpc_id
    • C. network.module.vpc_id
    • D. var.network.vpc_id
    Show answer & explanation

    Answer: A
    Module outputs are referenced from the calling configuration as module.<module_name>.<output_name>, so module.network.vpc_id is correct. aws_vpc.this.vpc_id would only work inside the module itself, not from the root, since the root doesn't have direct access to the module's internal resources; the other two options use invalid reference syntax.

  20. 20. A large configuration repeats near-identical blocks for provisioning a web tier across three environments (dev, staging, prod), varying only instance sizes and counts. What is the primary architectural benefit of extracting this into a reusable module with input variables for size and count?

    • A. It centralizes the shared logic in one place so fixes and improvements propagate to every environment that calls the module
    • B. It removes the need to ever run terraform plan in any environment that uses the module
    • C. It guarantees that all three environments will always have identical instance counts
    • D. It automatically merges the three environments' state files into one
    Show answer & explanation

    Answer: A
    Modules encapsulate shared logic once, so a bug fix or improvement made in the module benefits every environment that calls it, rather than needing to be copy-pasted three times. Modules don't remove the need to plan/apply per environment, they don't force identical counts (that's the point of parameterizing with variables), and they don't merge separate state files together.

  21. 21. A nested child module internally calls another module two levels deep, and that innermost module declares a resource. From the root module's perspective, why can't the root directly reference that innermost resource by its resource address without going through outputs?

    • A. Each module has its own local resource namespace, and data only crosses a module boundary through explicitly declared outputs and inputs
    • B. Terraform limits module nesting to a single level, so this configuration would fail to load
    • C. Resources declared in nested modules are automatically renamed to include the root module's name
    • D. Only provider configurations, never resources, can exist inside nested modules
    Show answer & explanation

    Answer: A
    Module boundaries encapsulate their internal resource addresses; the only sanctioned way to pass data upward is through explicitly declared output values that a caller then references via module.<name>.<output>. Terraform supports multiple levels of module nesting (not just one), resources aren't auto-renamed to include the root's name, and resources absolutely can exist inside nested modules alongside provider configuration.

  22. 22. Two engineers run terraform apply against the same remote backend workspace at nearly the same time. What mechanism is designed to prevent both applies from corrupting the state file simultaneously?

    • A. State locking, which many remote backends support to serialize concurrent write operations
    • B. Terraform automatically merges concurrent state changes like a version control system merges text files
    • C. The second terraform apply silently overwrites the first apply's state changes without warning
    • D. Local state files always prevent concurrent access even without a remote backend
    Show answer & explanation

    Answer: A
    State locking is the mechanism supported by many remote backends to ensure only one operation can write to state at a time, preventing corruption from concurrent applies. Terraform does not perform automatic conflict-style merges of state, a locked second apply is blocked/errored rather than silently overwriting, and plain local state files provide much weaker (often no) protection against concurrent access compared to a locking remote backend.

  23. 23. An engineer manually deletes a cloud resource from the provider console that Terraform is still tracking in its state file. The next time terraform plan runs, what will Terraform most likely report?

    • A. Terraform will detect drift and plan to recreate the resource, since state says it should exist but the real infrastructure does not
    • B. Terraform will automatically update its state to remove the resource with no plan output at all
    • C. terraform plan will fail with an unrecoverable error and require deleting the entire state file
    • D. Terraform will ignore the discrepancy until the next terraform destroy is run
    Show answer & explanation

    Answer: A
    During refresh, Terraform detects that a resource present in state no longer exists in the real infrastructure (drift) and will typically plan to create it again to reconcile state with the desired configuration. It doesn't silently and automatically drop it from state without surfacing a plan, it does not require deleting the whole state file, and it does not simply ignore the discrepancy until a destroy.

  24. 24. A team stores terraform.tfstate as a local file inside their project's git repository. What is the most significant risk of this practice compared to using a remote backend?

    • A. State can easily fall out of sync between collaborators, and sensitive values in state may be exposed in version control history
    • B. Local state files cannot store resource attributes at all
    • C. Git repositories reject any file over 1 KB, so state files will not commit successfully
    • D. Local state automatically encrypts itself when committed to any git provider
    Show answer & explanation

    Answer: A
    Local state committed to git risks collaborators working from stale or conflicting copies and exposes potentially sensitive resource attributes (like passwords or keys stored in state) in version history — a key reason remote backends with locking and encryption-at-rest are recommended. Local state does store resource attributes (that's its purpose), git has no such 1 KB restriction, and state committed to git is not automatically encrypted.

  25. 25. A resource was created outside of Terraform (via the console) and now needs to be brought under Terraform management without destroying and recreating it. Which command is designed for this purpose?

    • A. terraform import
    • B. terraform taint
    • C. terraform refresh only, with no configuration written
    • D. terraform apply -destroy
    Show answer & explanation

    Answer: A
    terraform import associates an existing real-world resource with a resource address in Terraform state, without destroying or recreating it, so it can then be managed going forward. terraform taint instead marks an already-managed resource for forced recreation, refreshing without any matching configuration won't create the tracked mapping needed, and 'apply -destroy' would tear the resource down rather than adopt it.

  26. 26. A team splits a large monolithic configuration's state into multiple smaller state files organized by service boundary (networking, database, application). What is a key trade-off introduced by this split?

    • A. Cross-service references now require explicit data sharing (such as remote state data sources or outputs), since each state file only knows about its own resources
    • B. All state files must now be applied in a single terraform apply command simultaneously
    • C. Splitting state eliminates the possibility of ever needing state locking
    • D. Terraform automatically keeps all split state files in sync with no additional configuration
    Show answer & explanation

    Answer: A
    When state is split by service, each state file only tracks its own resources, so referencing another service's resource (e.g., the networking VPC ID from the database configuration) requires an explicit mechanism like a terraform_remote_state data source or another shared data-passing approach. Split states are still applied independently (not forced into one combined apply), locking remains relevant to each backend, and Terraform does not auto-synchronize independent state files.

  27. 27. A provider's resource attribute value stored in state does not match the real infrastructure's current value because someone modified the resource out-of-band. Which core Terraform operation, run as part of plan, is responsible for detecting this kind of discrepancy before proposing changes?

    • A. The refresh step, which queries the current state of real infrastructure and reconciles it against the recorded state
    • B. terraform fmt, which reformats configuration files
    • C. terraform validate, which only checks configuration syntax
    • D. terraform init, which downloads provider plugins
    Show answer & explanation

    Answer: A
    As part of generating a plan, Terraform performs a refresh that queries real infrastructure and reconciles any drift against the recorded state before determining what changes are needed. terraform fmt only reformats code style, terraform validate checks syntax/internal consistency without querying real infrastructure, and terraform init just prepares the working directory and providers.

  28. 28. An operator wants to permanently remove a resource from Terraform's management without destroying the underlying real-world infrastructure. Which action accomplishes this?

    • A. Removing the resource from state (e.g., via terraform state rm) while leaving the configuration or real resource alone as needed
    • B. Running terraform destroy, which only removes the state entry and never touches real infrastructure
    • C. Deleting the resource block from configuration is always sufficient with no other steps and never triggers a destroy
    • D. Renaming the resource's local name in configuration accomplishes the same outcome automatically
    Show answer & explanation

    Answer: A
    terraform state rm removes a resource from Terraform's state tracking without issuing any API calls against the real infrastructure, effectively 'forgetting' it while leaving it running. terraform destroy actively deletes the real infrastructure (not just the state entry); simply deleting the resource block from configuration will cause the next apply to plan a destroy of the real resource, not just forget it; and renaming a resource's local name without a moved block will make Terraform plan to destroy the old address and create a new one, not simply detach it.

  29. 29. A team wants to run custom validation scripts, generate documentation, or trigger notifications as part of their infrastructure lifecycle, but outside the scope of what terraform plan/apply directly does. Which category of usage does this best describe?

    • A. Using Terraform outside of its core workflow, such as via external tooling, wrapper scripts, or provisioners integrated around the standard commands
    • B. This is only possible by modifying the Terraform binary's source code directly
    • C. This requires abandoning Terraform entirely in favor of a different tool
    • D. terraform plan natively performs documentation generation and notification sending with no extra tooling
    Show answer & explanation

    Answer: A
    Extending Terraform's lifecycle with custom validation, documentation generation, or notifications via wrapper scripts, CI integration, or provisioners is a standard example of using Terraform outside its core init/plan/apply workflow. None of this requires modifying Terraform's own source code or abandoning it, and plan/apply do not natively perform documentation generation or send notifications on their own.

  30. 30. A provisioner block is added to a resource to run a remote-exec script that installs an application after the instance is created. What is a commonly cited caveat about relying heavily on provisioners for this purpose?

    • A. Provisioners are considered a last resort because they can introduce non-idempotent, harder-to-track behavior compared to native provider features or dedicated configuration management tools
    • B. Provisioners can only be attached to data sources, never to resources
    • C. Provisioners always run before terraform plan and never during apply
    • D. Using any provisioner permanently disables state locking for that resource
    Show answer & explanation

    Answer: A
    Terraform's own guidance treats provisioners as a last resort because their imperative script execution can behave inconsistently across runs and is harder for Terraform to model/track than declarative resource attributes or purpose-built configuration management tools. Provisioners attach to resources (not data sources), they execute during apply/destroy (not before plan), and they have no relationship to disabling state locking.

  31. 31. A pipeline wants to check that all committed .tf files are syntactically valid and consistently formatted before merging, without actually connecting to any cloud provider. Which combination of commands best supports this outside the normal plan/apply flow?

    • A. terraform fmt -check and terraform validate
    • B. terraform apply -auto-approve and terraform destroy
    • C. terraform import and terraform state rm
    • D. terraform workspace new and terraform workspace select
    Show answer & explanation

    Answer: A
    terraform fmt -check verifies formatting consistency and terraform validate checks configuration syntax and internal consistency, both without requiring provider credentials or making real infrastructure calls, making them ideal for pre-merge CI gating. apply/destroy would actually provision/tear down infrastructure, import/state rm manipulate state tracking of real resources, and workspace commands manage workspace context rather than validating syntax or formatting.

  32. 32. A team wants a shared, remote location to run terraform plan and apply, with built-in state storage, access controls, and a history of runs visible to the whole team, rather than everyone running Terraform CLI locally against a self-managed backend. Which product area does this describe?

    • A. HCP Terraform (Terraform Cloud), which provides remote runs, state management, and collaboration features as a managed service
    • B. terraform console, a local-only command for evaluating expressions interactively
    • C. The terraform fmt command, which only reformats configuration files
    • D. A provider plugin, which only implements resource and data source logic for a specific platform
    Show answer & explanation

    Answer: A
    HCP Terraform (Terraform Cloud) is HashiCorp's managed offering providing remote plan/apply runs, centralized state storage, access controls, and run history/collaboration for teams — exactly the shared workflow described. terraform console is a local interactive expression evaluator, terraform fmt only reformats files, and a provider plugin implements resource/data source logic rather than offering collaborative remote runs.

  33. 33. An organization uses HCP Terraform workspaces to separate configuration and state for dev, staging, and prod environments, each with its own variable sets and run history. What is the primary organizational benefit of using separate workspaces here rather than one shared workspace for all three environments?

    • A. Each environment's state, variables, and run history stay isolated, reducing the risk that a change intended for one environment accidentally affects another
    • B. Separate workspaces automatically synchronize variable values across all environments
    • C. Only one workspace total is allowed per HCP Terraform organization
    • D. Workspaces remove the need to ever define environment-specific variables
    Show answer & explanation

    Answer: A
    Separate workspaces isolate state, variable sets, and run history per environment, which limits blast radius so a dev change can't accidentally apply against prod's state. Workspaces don't auto-sync variables across environments (isolation is the point), organizations can have many workspaces, and environment-specific variables are still very much needed — workspaces are how you organize them, not eliminate them.

  34. 34. A company wants multiple engineers to collaborate on the same set of Terraform configurations, with runs automatically triggered on VCS commits and clear visibility into who approved which apply. Which HCP Terraform capability area most directly supports this requirement?

    • A. VCS-driven workflows combined with team-based access controls and run approval history
    • B. Only running terraform apply -auto-approve locally on each engineer's laptop
    • C. Manually emailing plan output to teammates for review before every apply
    • D. Disabling state locking so multiple people can apply concurrently without waiting
    Show answer & explanation

    Answer: A
    HCP Terraform's VCS integration triggers runs from commits, and its team/permissions model plus run history gives visibility into who approved or applied changes — directly matching the described collaboration need. Running apply locally with auto-approve bypasses review entirely, manually emailing plan output is an ad hoc workaround rather than a built-in collaboration feature, and disabling locking would increase risk of state corruption rather than support safe collaboration.

  35. 35. A workspace in HCP Terraform is configured with remote execution mode, meaning plan and apply operations run on HCP Terraform's infrastructure rather than a user's local machine. What is one advantage of this remote execution model for a team?

    • A. Runs execute in a consistent, centrally managed environment with consistent provider/plugin versions and don't depend on any individual engineer's local machine setup
    • B. Remote execution mode removes the need for any provider credentials to be configured anywhere
    • C. Remote execution guarantees that plans never show any changes
    • D. Remote execution mode is only available for the terraform destroy command
    Show answer & explanation

    Answer: A
    Remote execution runs plan/apply in a consistent, centrally managed environment, avoiding 'works on my machine' drift from differing local CLI/provider versions across engineers. Provider credentials must still be configured (just centrally, e.g., as workspace variables) rather than eliminated, remote execution doesn't guarantee empty plans, and it applies to the standard plan/apply/destroy operations, not just destroy.

  36. 36. Which of the following best describes what HCP Terraform's Sentinel or OPA-based policy checks are typically used for in a workspace's run pipeline?

    • A. Enforcing organizational rules (such as required tags, allowed instance types, or cost limits) against a plan before it can be applied
    • B. Automatically writing the Terraform configuration files for the user
    • C. Replacing the need for a provider block in the configuration
    • D. Formatting HCL code according to canonical style
    Show answer & explanation

    Answer: A
    Policy-as-code checks (like Sentinel or OPA) evaluate a proposed plan against organizational guardrails — tagging standards, allowed resource types, cost thresholds — and can block non-compliant applies, which is their core purpose in a run pipeline. They don't generate configuration files, don't substitute for provider blocks, and are unrelated to code formatting (that's terraform fmt).

  37. 37. A newcomer to Terraform asks why 'basic terminal skills and an understanding of on-premises and cloud architecture' are recommended before attempting to learn Terraform in a production context. Which best explains this recommendation?

    • A. Terraform is operated primarily via CLI commands and manages real infrastructure resources, so comfort with a terminal and infrastructure concepts helps in understanding what configurations actually provision
    • B. Terraform cannot be installed on any operating system that includes a graphical user interface
    • C. HashiCorp requires a separate terminal-usage certification before anyone may install Terraform
    • D. Infrastructure architecture knowledge is only relevant to Terraform's HCP Terraform product, not the open-source CLI
    Show answer & explanation

    Answer: A
    Since Terraform is primarily a CLI-driven tool that provisions real infrastructure, basic terminal fluency and infrastructure/architecture familiarity help practitioners understand and safely use the commands and the resources they create. Terraform installs fine on GUI-based operating systems, there is no separate mandatory terminal certification, and infrastructure knowledge is relevant to core Terraform usage broadly, not just HCP Terraform.

  38. 38. A candidate is scheduling their Terraform Associate exam and wants to know roughly how long they should budget for the actual online proctored session. Which duration should they plan for?

    • A. About 1 hour (60 minutes)
    • B. About 4 hours
    • C. About 15 minutes
    • D. About 8 hours across two sessions
    Show answer & explanation

    Answer: A
    The exam is a multiple choice exam that lasts 1 hour (60 minutes), so candidates should budget roughly that amount of time for the proctored session itself. It is not a multi-hour exam, nowhere near as short as 15 minutes, and is not split into an 8-hour two-session format.

  39. 39. A candidate wants to know how many separate objective domains the Terraform Associate (004) exam measures knowledge across, so they can plan their study checklist. What is the correct count?

    • A. Eight objective domains
    • B. Three objective domains
    • C. Twelve objective domains
    • D. Five objective domains
    Show answer & explanation

    Answer: A
    The exam measures knowledge across eight objective domains, spanning topics from IaC concepts through HCP Terraform. Three would undercount significantly (that number actually corresponds to the exam's question format types, not domain count), twelve overcounts the objectives, and five is also an undercount relative to the documented eight domains.

  40. 40. A candidate is reviewing the format of the Terraform Associate exam and wants to know what kinds of questions to expect on exam day. Which set of question types matches the official format?

    • A. True or false, multiple choice, and multiple answer questions
    • B. Only essay-style, free-response questions
    • C. Only fill-in-the-blank coding exercises with no answer choices
    • D. Only matching-pairs style questions
    Show answer & explanation

    Answer: A
    The exam uses three question formats: true or false, multiple choice, and multiple answer question types, all objective and machine-scored. It is not composed of essay/free-response items, does not use open fill-in-the-blank coding exercises, and does not use a matching-pairs format.

  41. 41. A candidate passes the Terraform Associate exam today and wants to know how long the resulting certification credential remains valid before recertification is required.

    • A. 2 years
    • B. 1 year
    • C. 5 years
    • D. The credential never expires
    Show answer & explanation

    Answer: A
    The Terraform Associate credential is valid for 2 years from the date it is earned, after which recertification is required to maintain it. It is not valid for only 1 year, does not extend to 5 years, and is not a permanently non-expiring credential.

  42. 42. A candidate is budgeting for the Terraform Associate exam registration and wants to know the base exam fee before any locally applicable taxes or fees are added.

    • A. $70.50 USD
    • B. $150.00 USD
    • C. $35.00 USD
    • D. $225.00 USD
    Show answer & explanation

    Answer: A
    The exam costs $70.50 USD, plus any locally applicable taxes and fees, and this price does not include a free retake. The other listed amounts do not match the documented base exam fee.

  43. 43. A candidate fails the Terraform Associate exam on their first attempt and asks whether a free retake is included in the price they already paid. Based on the official policy, what should they be told?

    • A. No, a free retake is not included in the exam price, so a retake would require paying again
    • B. Yes, every candidate automatically receives one free retake within 24 hours
    • C. Yes, but only if they fail by fewer than five percentage points
    • D. Retakes are entirely prohibited and the credential can never be attempted again
    Show answer & explanation

    Answer: A
    A free retake is not included in the exam price, meaning candidates who wish to retake the exam after failing generally need to pay again. There is no automatic free retake window, no scoring-margin exception for a free retake, and retakes are not categorically prohibited — the point is simply that they aren't bundled free with the original fee.

  44. 44. A study guide for this exam version notes that scenario questions may assume behavior consistent with a specific Terraform release line. Which version does this exam version test on?

    • A. Terraform 1.12
    • B. Terraform 0.11
    • C. Terraform 2.0
    • D. Terraform 1.0 exactly, with no later point releases
    Show answer & explanation

    Answer: A
    This version of the exam tests on Terraform 1.12, so candidates should be comfortable with behavior and syntax current as of that release line. Terraform 0.11 predates the modern HCL2 syntax and is long outdated, there is no Terraform 2.0 release, and the exam is not scoped narrowly to only the original 1.0 release with no later point releases.

  45. 45. A candidate asks whether the Terraform Associate exam publishes an official percentage weighting for each of its eight objective domains, similar to how some other certification exams list exact percentages per domain. Based on the official exam guidance, what is accurate?

    • A. The exam does not publish per-objective percentage weightings, so candidates should prepare across all eight domains rather than optimizing study time by a published percentage split
    • B. Each of the eight domains is weighted at exactly 12.5 percent, published officially by HashiCorp
    • C. The state management domain alone makes up 50 percent of the exam by official published weighting
    • D. Only two of the eight domains are actually tested, despite all eight being listed
    Show answer & explanation

    Answer: A
    HashiCorp's official guidance for this exam states that per-objective percentage weightings are not published, so candidates cannot rely on an official breakdown to prioritize study time by percentage. There is no officially published even 12.5 percent split, no official statement that state management alone is 50 percent, and all eight listed domains are in scope for testing, not just two.