Question 490
During a design review, the requirement is to determine a module's declared inputs, outputs, providers and usage examples. Which option should the engineer select?
- terraform get
- An absolute local module source
- A Git HTTPS module source
- Registry module documentation
Explanation
Correct Answer
D:Published module documentation and metadata describe the module interface and help consumers understand required arguments; this directly meets the requirement to determine a module's declared inputs, outputs, providers and usage examples. By comparison, terraform get is intended to retrieve child modules without running the complete backend and provider setup steps, which is a different task from determine a module's declared inputs, outputs, providers and usage examples.
Incorrect Answers
A:The terraform get command updates downloaded module sources only; routine workflows generally prefer terraform init; this mechanism is useful when the job is to retrieve child modules without running the complete backend and provider setup steps, whereas the current scenario requires the engineer to determine a module's declared inputs, outputs, providers and usage examples. These operations have different effects in the stated Terraform workflow.
B:Terraform can load a module from a local filesystem path, though absolute paths make configurations less portable; this mechanism is useful when the job is to call a child module from an explicit filesystem path, whereas the current scenario requires the engineer to determine a module's declared inputs, outputs, providers and usage examples. These operations have different effects in the stated Terraform workflow.
C:A git::https:// source can retrieve a Terraform module from version control rather than from the module registry; this mechanism is useful when the job is to fetch module code directly from a remote Git repository, whereas the current scenario requires the engineer to determine a module's declared inputs, outputs, providers and usage examples. These operations have different effects in the stated Terraform workflow.
Question 491
A new infrastructure-as-code adoption project has a concrete implementation goal: identify changes between the declared configuration and managed infrastructure. What is the most appropriate Terraform mechanism?
- Version-controlled infrastructure definition
- A resource graph
- Repeatable environment definition
- Desired-state reconciliation
Explanation
Correct Answer
D:Planning compares configuration with state and refreshed remote data to propose actions that reconcile differences; this directly meets the requirement to identify changes between the declared configuration and managed infrastructure. By comparison, repeatable environment definition is intended to recreate the same logical infrastructure design across test and production, which is a different task from identify changes between the declared configuration and managed infrastructure.
Incorrect Answers
A:Infrastructure configuration can be committed and reviewed in version control so the intended change is traceable before a Terraform run; this mechanism is useful when the job is to review a proposed infrastructure change before team members deploy it, whereas the current scenario requires the engineer to identify changes between the declared configuration and managed infrastructure. These operations have different effects in the stated Terraform workflow.
B:Terraform derives dependency edges from references, using the graph to order dependent changes and permit safe parallel operations; this mechanism is useful when the job is to determine a safe sequence for creating objects with references between them, whereas the current scenario requires the engineer to identify changes between the declared configuration and managed infrastructure. These operations have different effects in the stated Terraform workflow.
C:IaC configuration provides repeatable definitions; variables and isolated state allow environments to differ without independently hand-building each object; this mechanism is useful when the job is to recreate the same logical infrastructure design across test and production, whereas the current scenario requires the engineer to identify changes between the declared configuration and managed infrastructure. These operations have different effects in the stated Terraform workflow.
Question 492
An engineer intends to avoid confusing provider plugin selection with reusable module source selection and is reviewing “Provider and module version separation”. What consequence follows from using it as intended?
- The module version argument accepts version constraints for registry sources and Terraform resolves compatible published releases during init.
- A module version ~> 2.1.0 permits 2.1.x releases but excludes 2.2.0 and later.
- A module upgrade can change resource definitions and outputs, so the consumer should inspect the new source and resulting Terraform plan.
- The upgrade mode reselects module versions subject to constraints instead of automatically keeping the previously installed copy.
- A Git module's ?ref= tag or commit selects a repository revision instead of a registry module version constraint.
- Provider versions are constrained in required_providers and locked in .terraform.lock.hcl; registry modules use their module block version arguments.
Explanation
Correct Answer
F:The named mechanism is used when the objective is to avoid confusing provider plugin selection with reusable module source selection, so it produces the behavior described. In contrast, a pessimistic module version constraint serves a different goal: allow compatible patch updates within a module's minor release series, not avoid confusing provider plugin selection with reusable module source selection.
Incorrect Answers
A:The description applies to a registry module version constraint when an engineer needs to select a supported module release range from the registry; the named provider and module version separation instead handles the requirement to avoid confusing provider plugin selection with reusable module source selection, so this behavior does not describe Provider and module version separation in the situation named.
B:The description applies to a pessimistic module version constraint when an engineer needs to allow compatible patch updates within a module's minor release series; the named provider and module version separation instead handles the requirement to avoid confusing provider plugin selection with reusable module source selection, so this behavior does not describe Provider and module version separation in the situation named.
C:The description applies to reviewing module upgrade changes when an engineer needs to control behavioral changes after moving to a new module release; the named provider and module version separation instead handles the requirement to avoid confusing provider plugin selection with reusable module source selection, so this behavior does not describe Provider and module version separation in the situation named.
D:The description applies to init -upgrade for registry modules when an engineer needs to consider newer published module releases already allowed by a version constraint; the named provider and module version separation instead handles the requirement to avoid confusing provider plugin selection with reusable module source selection, so this behavior does not describe Provider and module version separation in the situation named.
E:The description applies to a Git tag pin for a module when an engineer needs to select a specific VCS module release without using a registry version argument; the named provider and module version separation instead handles the requirement to avoid confusing provider plugin selection with reusable module source selection, so this behavior does not describe Provider and module version separation in the situation named.
Question 493
A platform standardization effort needs to notice remote infrastructure changes made outside Terraform. Which feature or operation is the most direct match?
- Environment parametrization
- Drift detection during planning
- Plan-before-apply reviews
- Idempotent convergence
Explanation
Correct Answer
B:Terraform can refresh managed objects during planning and flag differences between the observed infrastructure and configuration; this directly meets the requirement to notice remote infrastructure changes made outside Terraform. By comparison, idempotent convergence is intended to run unchanged configuration repeatedly without inventing new infrastructure updates, which is a different task from notice remote infrastructure changes made outside Terraform.
Incorrect Answers
A:Terraform input variables permit different values for capacity, names and endpoints without copying the entire resource definition; this mechanism is useful when the job is to deploy similarly structured stacks with environment-specific settings, whereas the current scenario requires the engineer to notice remote infrastructure changes made outside Terraform. These operations have different effects in the stated Terraform workflow.
C:A Terraform plan is a reviewable proposed set of actions; execution occurs only when an apply runs against the chosen plan; this mechanism is useful when the job is to see intended infrastructure changes without immediately creating them, whereas the current scenario requires the engineer to notice remote infrastructure changes made outside Terraform. These operations have different effects in the stated Terraform workflow.
D:With no configuration or remote drift requiring action, a new plan normally proposes no infrastructure changes; this mechanism is useful when the job is to run unchanged configuration repeatedly without inventing new infrastructure updates, whereas the current scenario requires the engineer to notice remote infrastructure changes made outside Terraform. These operations have different effects in the stated Terraform workflow.
Question 494
A Terraform deployment has independent requirements: (1) route a particular managed object to the named alternate provider configuration; (2) avoid using provider versions from a newer unsupported major release; (3) prevent staging changes from unintentionally sharing the production state mapping. Which THREE mechanisms directly address these needs? Choose THREE.
- A resource's provider meta-argument
- Remote state sharing boundaries
- An upper-bound provider constraint
- Provider registry installation
- A provider plugin
- Separate state per environment
Explanation
Correct Answers
A:The resource-level provider meta-argument selects a provider instance, not a different backend or Terraform workspace; this meets the requirement to route a particular managed object to the named alternate provider configuration, while the other selected techniques address avoid using provider versions from a newer unsupported major release and prevent staging changes from unintentionally sharing the production state mapping, which require their own distinct Terraform mechanisms.
C:A constraint such as < 6.0.0 prevents selection of versions that reach the excluded release boundary; this meets the requirement to avoid using provider versions from a newer unsupported major release, while the other selected techniques address route a particular managed object to the named alternate provider configuration and prevent staging changes from unintentionally sharing the production state mapping, which require their own distinct Terraform mechanisms.
F:Distinct backends, workspaces or root configurations can isolate state, but the configuration must target the intended instance set; this meets the requirement to prevent staging changes from unintentionally sharing the production state mapping, while the other selected techniques address route a particular managed object to the named alternate provider configuration and avoid using provider versions from a newer unsupported major release, which require their own distinct Terraform mechanisms.
Incorrect Answers
B:Reading a remote state output still requires access to the underlying snapshot; exporting data through a narrower interface can reduce exposure; it addresses avoid exposing full state when another stack only needs a published identifier, but this delivery instead requires route a particular managed object to the named alternate provider configuration and avoid using provider versions from a newer unsupported major release and prevent staging changes from unintentionally sharing the production state mapping. The required combination involves An upper-bound provider constraint and A resource's provider meta-argument and Separate state per environment, not the behavior of Remote state sharing boundaries.
D:Terraform uses provider source metadata and its configured installation methods to find and install the appropriate plugin binary; it addresses retrieve a published plugin from its declared registry source, but this delivery instead requires route a particular managed object to the named alternate provider configuration and avoid using provider versions from a newer unsupported major release and prevent staging changes from unintentionally sharing the production state mapping. The required combination involves An upper-bound provider constraint and A resource's provider meta-argument and Separate state per environment, not the behavior of Provider registry installation.
E:Providers implement resource and data-source schemas plus read, create, update and delete operations for their services; it addresses translate Terraform resource operations into calls to the relevant remote API, but this delivery instead requires route a particular managed object to the named alternate provider configuration and avoid using provider versions from a newer unsupported major release and prevent staging changes from unintentionally sharing the production state mapping. The required combination involves An upper-bound provider constraint and A resource's provider meta-argument and Separate state per environment, not the behavior of A provider plugin.
Question 495
A change request asks an engineer to record higher-level operational messages during troubleshooting. Which choice best implements the requested behavior?
- TF_LOG=INFO
- TF_LOG_PATH
- Disabling TF_LOG
- TF_LOG_PROVIDER
Explanation
Correct Answer
A:INFO logging provides operational context with less detail than DEBUG and TRACE; this directly meets the requirement to record higher-level operational messages during troubleshooting. By comparison, disabling TF_LOG is intended to return a shell session to ordinary Terraform logging after investigation, which is a different task from record higher-level operational messages during troubleshooting.
Incorrect Answers
B:TF_LOG_PATH directs log output to a file and should be combined with an enabled TF_LOG level; this mechanism is useful when the job is to save enabled Terraform diagnostic logs to a designated file, whereas the current scenario requires the engineer to record higher-level operational messages during troubleshooting. These operations have different effects in the stated Terraform workflow.
C:Unsetting or disabling Terraform's TF_LOG environment setting removes extra diagnostic verbosity from later commands; this mechanism is useful when the job is to return a shell session to ordinary Terraform logging after investigation, whereas the current scenario requires the engineer to record higher-level operational messages during troubleshooting. These operations have different effects in the stated Terraform workflow.
D:The TF_LOG_PROVIDER setting controls provider log verbosity and can help locate failures involving provider communication; this mechanism is useful when the job is to isolate provider-related diagnostic output during API troubleshooting, whereas the current scenario requires the engineer to record higher-level operational messages during troubleshooting. These operations have different effects in the stated Terraform workflow.
Question 496
A Terraform runbook prescribes “Init -upgrade for registry modules” to select a specific VCS module release without using a registry version argument, but it does not meet the requirement. What does that step actually accomplish?
- Provider versions are constrained in required_providers and locked in .terraform.lock.hcl; registry modules use their module block version arguments.
- A Git module's ?ref= tag or commit selects a repository revision instead of a registry module version constraint.
- A module version ~> 2.1.0 permits 2.1.x releases but excludes 2.2.0 and later.
- The upgrade mode reselects module versions subject to constraints instead of automatically keeping the previously installed copy.
Explanation
Correct Answer
D:Init -upgrade for registry modules is used when an operator needs to consider newer published module releases already allowed by a version constraint. Consequently, this choice cannot meet the separate requirement to select a specific VCS module release without using a registry version argument. The intended action would instead require A Git tag pin for a module.
Incorrect Answers
A:This behavior belongs to Provider and module version separation, which helps engineers avoid confusing provider plugin selection with reusable module source selection rather than satisfying the separate requirement to select a specific VCS module release without using a registry version argument. The attempted technique was Init -upgrade for registry modules; it would instead be used to consider newer published module releases already allowed by a version constraint, not to produce the effect associated with Provider and module version separation.
B:That outcome belongs to A Git tag pin for a module, the mechanism that can select a specific VCS module release without using a registry version argument. The question concerns the engineer’s actual proposal, Init -upgrade for registry modules; it is directed at consider newer published module releases already allowed by a version constraint, not that result.
C:This behavior belongs to A pessimistic module version constraint, which helps engineers allow compatible patch updates within a module's minor release series rather than satisfying the separate requirement to select a specific VCS module release without using a registry version argument. The attempted technique was Init -upgrade for registry modules; it would instead be used to consider newer published module releases already allowed by a version constraint, not to produce the effect associated with A pessimistic module version constraint.
Question 497
A team compares Terraform mechanisms for the goal to bring a previously unmanaged remote object under a resource block's lifecycle. Which stated consequence belongs specifically to “Importing an existing object”?
- A provider data source can resolve the zone ID for use in managed records while the zone itself remains outside that configuration's resource lifecycle.
- References to data.TYPE.NAME.attribute retrieve values supplied by a read-only provider data source.
- Import associates a configured resource address with an existing remote object's provider identity in Terraform state.
- A resource type name usually starts with its provider local name, such as aws_instance for the AWS provider.
Explanation
Correct Answer
C:The named mechanism is used when the objective is to bring a previously unmanaged remote object under a resource block's lifecycle, so it produces the behavior described. In contrast, provider resource type prefixes serves a different goal: identify which provider implements a resource's API operations, not bring a previously unmanaged remote object under a resource block's lifecycle.
Incorrect Answers
A:The description applies to data sources as external lookups when an engineer needs to use an existing DNS zone from a provider without taking ownership of the zone; the named importing an existing object instead handles the requirement to bring a previously unmanaged remote object under a resource block's lifecycle, so this behavior does not describe Importing an existing object in the situation named.
B:The description applies to a data-source reference when an engineer needs to use attributes read from an existing resource when configuring a new managed object; the named importing an existing object instead handles the requirement to bring a previously unmanaged remote object under a resource block's lifecycle, so this behavior does not describe Importing an existing object in the situation named.
D:The description applies to provider resource type prefixes when an engineer needs to identify which provider implements a resource's API operations; the named importing an existing object instead handles the requirement to bring a previously unmanaged remote object under a resource block's lifecycle, so this behavior does not describe Importing an existing object in the situation named.
Question 498
A declarative resource and expression design has a concrete implementation goal: set a resource argument according to a boolean expression. What is the most appropriate Terraform mechanism?
- The format function
- The ternary conditional operator
- The join function
- The jsondecode function
Explanation
Correct Answer
B:The condition ? value_a : value_b expression chooses a suitable branch without creating duplicate resource blocks; this directly meets the requirement to set a resource argument according to a boolean expression. By comparison, the join function is intended to build one delimited string from a list of strings, which is a different task from set a resource argument according to a boolean expression.
Incorrect Answers
A:format interpolates arguments into a printf-style string template for predictable names or identifiers; this mechanism is useful when the job is to build formatted text using placeholders for typed values, whereas the current scenario requires the engineer to set a resource argument according to a boolean expression. These operations have different effects in the stated Terraform workflow.
C:join takes a separator followed by a list and concatenates elements with that separator between them; this mechanism is useful when the job is to build one delimited string from a list of strings, whereas the current scenario requires the engineer to set a resource argument according to a boolean expression. These operations have different effects in the stated Terraform workflow.
D:jsondecode converts JSON input into native maps, objects, lists or primitives used in expressions; this mechanism is useful when the job is to parse a JSON document string into Terraform values, whereas the current scenario requires the engineer to set a resource argument according to a boolean expression. These operations have different effects in the stated Terraform workflow.
Question 499
Reviewers reject “A removed block with destroy=false” as a way to obtain the current state snapshot for inspection or controlled backup. Which actual behavior explains why the proposal is unsuitable?
- The lifecycle ignore_changes rule suppresses post-creation update plans for selected attributes while leaving other attributes managed.
- Refresh-only apply can update the recorded state to match observed remote attributes without modifying cloud resources.
- A removed block can intentionally forget the previous resource address without a provider delete when lifecycle destroy is false.
- The state pull command retrieves state from the configured backend and prints a snapshot that may contain secrets.
Explanation
Correct Answer
C:A removed block with destroy=false is used when an operator needs to declare that a resource should leave management while its actual object is retained. Consequently, this choice cannot meet the separate requirement to obtain the current state snapshot for inspection or controlled backup. The intended action would instead require terraform state pull.
Incorrect Answers
A:This behavior belongs to ignore_changes for shared ownership, which helps engineers stop Terraform from overwriting a field delegated to an external controller rather than satisfying the separate requirement to obtain the current state snapshot for inspection or controlled backup. The attempted technique was A removed block with destroy=false; it would instead be used to declare that a resource should leave management while its actual object is retained, not to produce the effect associated with ignore_changes for shared ownership.
B:This behavior belongs to terraform apply -refresh-only, which helps engineers accept current remote readings into Terraform's state through an apply operation rather than satisfying the separate requirement to obtain the current state snapshot for inspection or controlled backup. The attempted technique was A removed block with destroy=false; it would instead be used to declare that a resource should leave management while its actual object is retained, not to produce the effect associated with terraform apply -refresh-only.
D:That outcome belongs to terraform state pull, the mechanism that can obtain the current state snapshot for inspection or controlled backup. The question concerns the engineer’s actual proposal, A removed block with destroy=false; it is directed at declare that a resource should leave management while its actual object is retained, not that result.
Question 500
A team compares Terraform mechanisms for the goal to respond after changing the source address of a required provider. Which stated consequence belongs specifically to “Provider source change reinitialization”?
- The get=false switch skips child module installation, which is generally safe only if module dependencies are already present.
- A modified provider requirement can trigger a need to rerun init to resolve the newly declared plugin dependency.
- This option provides backend configuration values separately from static code, although locally cached backend settings may still contain secrets.
- Terraform records provider version and checksum selections in its dependency lock file, which teams normally commit to source control.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to respond after changing the source address of a required provider, so it produces the behavior described. In contrast, terraform init -get=false serves a different goal: avoid downloading child modules during a narrowly scoped initialization, not respond after changing the source address of a required provider.
Incorrect Answers
A:The description applies to terraform init -get=false when an engineer needs to avoid downloading child modules during a narrowly scoped initialization; the named provider source change reinitialization instead handles the requirement to respond after changing the source address of a required provider, so this behavior does not describe Provider source change reinitialization in the situation named.
C:The description applies to terraform init -backend-config when an engineer needs to inject partial backend settings at initialization time; the named provider source change reinitialization instead handles the requirement to respond after changing the source address of a required provider, so this behavior does not describe Provider source change reinitialization in the situation named.
D:The description applies to the .terraform.lock.hcl file when an engineer needs to identify which file should be checked in to preserve selected provider packages; the named provider source change reinitialization instead handles the requirement to respond after changing the source address of a required provider, so this behavior does not describe Provider source change reinitialization in the situation named.