Which is a benefit of the Terraform state file?
Answer : C
Rationale for Correct Answe r: Terraform state is Terraform's record of what it manages: it maps
resource addresses in configuration to real-world resource IDs and stores metadata needed to plan changes. That makes it a source of truth for resources Terraform is managing, enabling accurate diffs, updates, and deletes.
Analysis of Incorrect Options (Distractors):
A: Incorrect---Terraform state does not schedule jobs; that's the role of external schedulers/automation tools.
B: Incorrect---the desired state is expressed in .tf configuration, not in the state file. State reflects the current known state of managed infrastructure.
D: Incorrect---resources created manually in a cloud console are not automatically in Terraform state unless they are imported/adopted.
Key Concept: Purpose of Terraform state: resource mapping, metadata, and planning accuracy.
The Terraform binary version and provider versions must match each other in a single configuration.
Answer : B
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. Reference =
*1: Providers - Configuration Language | Terraform | HashiCorp Developer
*2: Multiple provider versions with Terraform - Stack Overflow
*3: Lock and upgrade provider versions | Terraform - HashiCorp Developer
What does the import block do?
Answer : D
Detailed
Rationale for Correct Answe r: The import block declaratively tells Terraform to associate an
existing infrastructure object with a Terraform resource address. After the configuration is applied, Terraform imports the existing resource and updates Terraform state so that Terraform can manage it.
Analysis of Incorrect Options (Distractors):
A: Moving resources between state addresses or state files is a state-management operation; it is not the purpose of an import block.
B: The import block does not merge Terraform state files.
C: Modules are downloaded during initialization, not by an import block.
Key Concept: Bringing existing infrastructure under Terraform management by importing it into state.
====================
Which parameters does the import block require? (Pick the 2 correct responses below.)
Answer : A, C
Rationale for Correct Answe r: The Terraform import block (used with configuration-driven
import) must specify:
id: the resource ID from the provider (the remote object identifier).
to: the target resource address in your configuration (where the imported object should map in state, e.g., aws_s3_bucket.example).These are the essential inputs Terraform needs to associate an existing remote object with a resource address in state.
Analysis of Incorrect Options (Distractors):
B (Provider): Not required as a parameter in the import block. Provider selection is determined by the configuration/provider setup (and optionally by provider meta-arguments on the resource), not by a required import block field.
D (Backend): Backends configure state storage and are set in the terraform block, unrelated to the import block's required arguments.
Key Concept: Configuration-driven import requires mapping an existing remote object (id) to a resource address (to).
A module block is shown in the Exhibit space of this page.

When you use a module block to reference a module from the Terraform Registry such as the one in the example, how do you specify version 1.0.0 of the module?
Answer : C
Module Versioning: To specify a version in a module block for modules in theTerraform Registry, you add the version attribute, e.g., version = '1.0.0'.
Terraform Registry Support: The public registrysupports versioningby enabling semantic constraints, allowing users to define specific versions compatible with their infrastructure requirements.
Refer to themodule versioning documentationin Terraform's official registry guide.
Which syntax check returns an error when you run terraform validate?
Answer : D
Detailed
Rationale for Correct Answe r:The terraform validate command checks whether the Terraform configuration is syntactically valid and internally consistent, but it does not check runtime state, enforce formatting preferences, or require all optional blocks to exist. None of the listed scenarios will cause terraform validate to fail:
Terraform does not require a variable block unless a variable is referenced incorrectly.
Tabs vs. spaces are formatting concerns handled by terraform fmt, not validate.
State drift is not checked by validate.
Analysis of Incorrect Options (Distractors):
A . The state file does not match the current infrastructure. Incorrect because terraform validate does not compare state with real infrastructure; that is handled during plan or apply.
B . The code contains tabs for indentation instead of spaces. Incorrect because formatting issues are handled by terraform fmt, not validate.
C . There is a missing variable block. Incorrect because Terraform does not require variable blocks unless variables are declared and improperly referenced. Simply missing a variable block is not a validation error.
Key Concept:terraform validate checks syntax and internal consistency, not formatting, runtime state, or infrastructure drift.
A Terraform configuration returns errors when you run terraform plan. How would you enable debug logging to investigate further?
Answer : B
Detailed
Rationale for Correct Answe r: Terraform debugging is enabled through the TF_LOG
environment variable. For example, TF_LOG=DEBUG enables debug-level logging, while TRACE provides even more detail.
Analysis of Incorrect Options (Distractors):
A: Debug logging is not normally enabled through a terraform plan debug flag.
C: The Terraform CLI configuration file is used for CLI behavior such as provider installation and credentials-related settings, not for enabling standard TF_LOG debugging.
D: Backend settings determine state-storage behavior and are unrelated to enabling Terraform diagnostic logging.
Key Concept: Terraform CLI troubleshooting and logging through environment variables.
====================