Question 770
A team compares Terraform mechanisms for the goal to use a nested module stored below a repository's root directory. Which stated consequence belongs specifically to “The double-slash source subdirectory”?
- Registry module sources use the namespace/name/provider address form and can support a separate version argument.
- Module source syntax places //subdir after the package address to select the intended directory within the downloaded package.
- Initialization retrieves module sources and populates .terraform/modules while preparing other required dependencies.
- HCP Terraform's private registry can distribute approved modules with access control and supported version metadata.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to use a nested module stored below a repository's root directory, so it produces the behavior described. In contrast, a private registry module source serves a different goal: reuse an internally published module available to authorized organization members, not use a nested module stored below a repository's root directory.
Incorrect Answers
A:The description applies to a public registry module source when an engineer needs to download a community module published with an official registry address; the named the double-slash source subdirectory instead handles the requirement to use a nested module stored below a repository's root directory, so this behavior does not describe The double-slash source subdirectory in the situation named.
C:The description applies to terraform init for modules when an engineer needs to install all referenced remote child modules before planning; the named the double-slash source subdirectory instead handles the requirement to use a nested module stored below a repository's root directory, so this behavior does not describe The double-slash source subdirectory in the situation named.
D:The description applies to a private registry module source when an engineer needs to reuse an internally published module available to authorized organization members; the named the double-slash source subdirectory instead handles the requirement to use a nested module stored below a repository's root directory, so this behavior does not describe The double-slash source subdirectory in the situation named.
Question 771
During a design review, the requirement is to declare that Terraform should create and maintain a new infrastructure object. Which option should the engineer select?
- Provider resource type prefixes
- Resource local names
- A managed resource block
- The terraform_data resource
Explanation
Correct Answer
C:A resource block represents an object Terraform manages through a provider, with its identity and attributes tracked in state; this directly meets the requirement to declare that Terraform should create and maintain a new infrastructure object. By comparison, the terraform_data resource is intended to model a Terraform-managed lifecycle value without requiring an external service object, which is a different task from declare that Terraform should create and maintain a new infrastructure object.
Incorrect Answers
A:A resource type name usually starts with its provider local name, such as aws_instance for the AWS provider; this mechanism is useful when the job is to identify which provider implements a resource's API operations, whereas the current scenario requires the engineer to declare that Terraform should create and maintain a new infrastructure object. These operations have different effects in the stated Terraform workflow.
B:A resource block has a type and a local label; together they form its address within the module; this mechanism is useful when the job is to distinguish two managed instances of the same provider-defined resource type, whereas the current scenario requires the engineer to declare that Terraform should create and maintain a new infrastructure object. These operations have different effects in the stated Terraform workflow.
D:The built-in terraform_data resource can represent input changes and trigger replacement behavior without managing a cloud API resource; this mechanism is useful when the job is to model a Terraform-managed lifecycle value without requiring an external service object, whereas the current scenario requires the engineer to declare that Terraform should create and maintain a new infrastructure object. These operations have different effects in the stated Terraform workflow.
Question 772
An HCP Terraform workspace design needs to coordinate a dependent app deployment following an upstream network workspace apply. Which feature or operation is the most direct match?
- Environment promotion via workspaces
- An HCP Terraform project
- One state per independently owned system
- HCP Terraform run triggers between workspaces
- Workspace-specific variables
Explanation
Correct Answer
D:A run trigger can initiate a downstream plan when its designated upstream workspace completes the relevant run; this directly meets the requirement to coordinate a dependent app deployment following an upstream network workspace apply. By comparison, environment promotion via workspaces is intended to use a reviewed configuration revision across separate testing and production states, which is a different task from coordinate a dependent app deployment following an upstream network workspace apply.
Incorrect Answers
A:Workspaces can reference separate branches or release controls while retaining isolated state for each environment; this mechanism is useful when the job is to use a reviewed configuration revision across separate testing and production states, whereas the current scenario requires the engineer to coordinate a dependent app deployment following an upstream network workspace apply. These operations have different effects in the stated Terraform workflow.
B:Projects organize workspaces by application, team or environment, simplifying scope and access administration; this mechanism is useful when the job is to group related workspaces under one organizational and permissions boundary, whereas the current scenario requires the engineer to coordinate a dependent app deployment following an upstream network workspace apply. These operations have different effects in the stated Terraform workflow.
C:Separate workspaces allow independent state lifecycles for services that are changed and approved separately; this mechanism is useful when the job is to avoid coupling different teams' deploys into a single state and blast radius, whereas the current scenario requires the engineer to coordinate a dependent app deployment following an upstream network workspace apply. These operations have different effects in the stated Terraform workflow.
E:Workspace settings store variables for that workspace's execution; global sets should not replace environment-specific data blindly; this mechanism is useful when the job is to override or tailor values used by one particular stack, whereas the current scenario requires the engineer to coordinate a dependent app deployment following an upstream network workspace apply. These operations have different effects in the stated Terraform workflow.
Question 773
A Terraform deployment has independent requirements: (1) ensure a dependent resource waits for the object whose ID it needs; (2) identify which provider implements a resource's API operations; (3) retrieve or generate temporary data that should not be persisted in Terraform state. Which THREE mechanisms directly address these needs? Choose THREE.
- An implicit attribute dependency
- An ephemeral resource block
- Provider resource type prefixes
- A data source that depends on a resource
- Vault short-lived credentials
- The resource address format
Explanation
Correct Answers
A:Referencing another managed resource's attribute creates an implicit dependency in Terraform's graph; this meets the requirement to ensure a dependent resource waits for the object whose ID it needs, while the other selected techniques address identify which provider implements a resource's API operations and retrieve or generate temporary data that should not be persisted in Terraform state, which require their own distinct Terraform mechanisms.
B:Provider-supported ephemeral resources exist only during an operation and can feed appropriate ephemeral consumers; this meets the requirement to retrieve or generate temporary data that should not be persisted in Terraform state, while the other selected techniques address ensure a dependent resource waits for the object whose ID it needs and identify which provider implements a resource's API operations, which require their own distinct Terraform mechanisms.
C:A resource type name usually starts with its provider local name, such as aws_instance for the AWS provider; this meets the requirement to identify which provider implements a resource's API operations, while the other selected techniques address ensure a dependent resource waits for the object whose ID it needs and retrieve or generate temporary data that should not be persisted in Terraform state, which require their own distinct Terraform mechanisms.
Incorrect Answers
D:Data source reads can be deferred during planning when their inputs depend on values not known until apply; it addresses delay a lookup until a prerequisite object is available, but this delivery instead requires ensure a dependent resource waits for the object whose ID it needs and identify which provider implements a resource's API operations and retrieve or generate temporary data that should not be persisted in Terraform state. The required combination involves Provider resource type prefixes and An implicit attribute dependency and An ephemeral resource block, not the behavior of A data source that depends on a resource.
E:Vault's dynamic credentials can provide expiring access with centrally enforced policies instead of permanent embedded keys; it addresses limit the lifetime and scope of identities used by infrastructure automation, but this delivery instead requires ensure a dependent resource waits for the object whose ID it needs and identify which provider implements a resource's API operations and retrieve or generate temporary data that should not be persisted in Terraform state. The required combination involves Provider resource type prefixes and An implicit attribute dependency and An ephemeral resource block, not the behavior of Vault short-lived credentials.
F:A resource address inside a module ordinarily uses TYPE.NAME, with optional instance indexing when count or for_each is used; it addresses identify a resource instance by its type and local name, but this delivery instead requires ensure a dependent resource waits for the object whose ID it needs and identify which provider implements a resource's API operations and retrieve or generate temporary data that should not be persisted in Terraform state. The required combination involves Provider resource type prefixes and An implicit attribute dependency and An ephemeral resource block, not the behavior of The resource address format.
Question 774
A change request asks an engineer to read an object from a secondary account rather than the default account. Which choice best implements the requested behavior?
- A default provider configuration
- Explicit provider selection on data blocks
- No implicit child-module alias inheritance
- configuration_aliases in required_providers
- The providers map on a module call
Explanation
Correct Answer
B:A data block can set provider = aws.secondary to query through an alternate provider configuration; this directly meets the requirement to read an object from a secondary account rather than the default account. By comparison, a default provider configuration is intended to make resources use a common account without an explicit provider argument, which is a different task from read an object from a secondary account rather than the default account.
Incorrect Answers
A:An unaliased provider block configures the default instance used by matching resources that do not override provider selection; this mechanism is useful when the job is to make resources use a common account without an explicit provider argument, whereas the current scenario requires the engineer to read an object from a secondary account rather than the default account. These operations have different effects in the stated Terraform workflow.
C:Non-default provider configurations must be passed explicitly to a child module instead of assuming aliases will propagate; this mechanism is useful when the job is to prevent a child module from silently using an unpassed alternate provider configuration, whereas the current scenario requires the engineer to read an object from a secondary account rather than the default account. These operations have different effects in the stated Terraform workflow.
D:A child module's required_providers entry uses configuration_aliases to advertise provider aliases referenced inside the module; this mechanism is useful when the job is to declare which alternate provider configurations a child module is allowed to receive, whereas the current scenario requires the engineer to read an object from a secondary account rather than the default account. These operations have different effects in the stated Terraform workflow.
E:The module call's providers argument maps the child's expected provider configuration name to a provider configuration available in the parent; this mechanism is useful when the job is to pass an aliased provider configuration into a child module, whereas the current scenario requires the engineer to read an object from a secondary account rather than the default account. These operations have different effects in the stated Terraform workflow.
Question 775
A collaboration and governance review requires a way to trigger infrastructure runs from changes in a configured version-control repository. Which Terraform approach most directly fulfills that request?
- A VCS-connected workspace
- A run apply phase
- Workspace outputs
- A speculative HCP plan
Explanation
Correct Answer
A:HCP Terraform can connect a workspace to a VCS repository and create runs when relevant commits are pushed; this directly meets the requirement to trigger infrastructure runs from changes in a configured version-control repository. By comparison, a speculative HCP plan is intended to evaluate a pull request's proposed changes without immediately applying them, which is a different task from trigger infrastructure runs from changes in a configured version-control repository.
Incorrect Answers
B:HCP Terraform can run the apply stage after its configured approval, policy and workflow requirements are satisfied; this mechanism is useful when the job is to execute approved resource changes within an HCP Terraform workspace, whereas the current scenario requires the engineer to trigger infrastructure runs from changes in a configured version-control repository. These operations have different effects in the stated Terraform workflow.
C:Workspace output values come from root module output blocks and can be consumed through supported interfaces; this mechanism is useful when the job is to publish selected values produced by an HCP Terraform run, whereas the current scenario requires the engineer to trigger infrastructure runs from changes in a configured version-control repository. These operations have different effects in the stated Terraform workflow.
D:HCP Terraform can perform speculative plans for VCS changes to preview impact before merge or approval; this mechanism is useful when the job is to evaluate a pull request's proposed changes without immediately applying them, whereas the current scenario requires the engineer to trigger infrastructure runs from changes in a configured version-control repository. These operations have different effects in the stated Terraform workflow.
Question 776
An engineering checklist calls for separate outcomes: (1) avoid confusing provider plugin selection with reusable module source selection; (2) reuse a neighboring module directory in the same repository. Which TWO options implement the requested outcomes? Choose TWO.
- A relative local module source
- Init -upgrade for registry modules
- terraform get
- A public registry module source
- Provider and module version separation
- Registry module documentation
Explanation
Correct Answers
A:A module source such as ./modules/network points to a local directory and requires no registry download or semantic version selection; this meets the requirement to reuse a neighboring module directory in the same repository, while the other selected techniques address avoid confusing provider plugin selection with reusable module source selection, which require their own distinct Terraform mechanisms.
E:Provider versions are constrained in required_providers and locked in .terraform.lock.hcl; registry modules use their module block version arguments; this meets the requirement to avoid confusing provider plugin selection with reusable module source selection, while the other selected techniques address reuse a neighboring module directory in the same repository, which require their own distinct Terraform mechanisms.
Incorrect Answers
B:The upgrade mode reselects module versions subject to constraints instead of automatically keeping the previously installed copy; it addresses consider newer published module releases already allowed by a version constraint, but this delivery instead requires avoid confusing provider plugin selection with reusable module source selection and reuse a neighboring module directory in the same repository. The required combination involves A relative local module source and Provider and module version separation, not the behavior of Init -upgrade for registry modules.
C:The terraform get command updates downloaded module sources only; routine workflows generally prefer terraform init; it addresses retrieve child modules without running the complete backend and provider setup steps, but this delivery instead requires avoid confusing provider plugin selection with reusable module source selection and reuse a neighboring module directory in the same repository. The required combination involves A relative local module source and Provider and module version separation, not the behavior of terraform get.
D:Registry module sources use the namespace/name/provider address form and can support a separate version argument; it addresses download a community module published with an official registry address, but this delivery instead requires avoid confusing provider plugin selection with reusable module source selection and reuse a neighboring module directory in the same repository. The required combination involves A relative local module source and Provider and module version separation, not the behavior of A public registry module source.
F:Published module documentation and metadata describe the module interface and help consumers understand required arguments; it addresses determine a module's declared inputs, outputs, providers and usage examples, but this delivery instead requires avoid confusing provider plugin selection with reusable module source selection and reuse a neighboring module directory in the same repository. The required combination involves A relative local module source and Provider and module version separation, not the behavior of Registry module documentation.
Question 777
An operations runbook for tracked objects requires a way to read plan or state information in a structured representation. Which Terraform approach most directly fulfills that request?
- terraform workspace select
- terraform show -json
- terraform state mv
- terraform providers
Explanation
Correct Answer
B:The JSON representation supports automated inspection but must be protected because redacted display is not a security boundary; this directly meets the requirement to read plan or state information in a structured representation. By comparison, terraform state mv is intended to change a tracked object's resource address after an intentional refactor, which is a different task from read plan or state information in a structured representation.
Incorrect Answers
A:Workspace selection changes which workspace state namespace the root configuration uses; it does not select a cloud account automatically; this mechanism is useful when the job is to switch the currently selected Terraform CLI workspace, whereas the current scenario requires the engineer to read plan or state information in a structured representation. These operations have different effects in the stated Terraform workflow.
C:State mv updates address mapping within state and does not move the real infrastructure object between regions or accounts; this mechanism is useful when the job is to change a tracked object's resource address after an intentional refactor, whereas the current scenario requires the engineer to read plan or state information in a structured representation. These operations have different effects in the stated Terraform workflow.
D:The providers command displays provider requirements and their module relationships for dependency troubleshooting; this mechanism is useful when the job is to inspect which providers the current configuration requires, whereas the current scenario requires the engineer to read plan or state information in a structured representation. These operations have different effects in the stated Terraform workflow.
Question 778
A reusable infrastructure definition requires a way to create a replacement object before deleting the previous instance. Which Terraform approach most directly fulfills that request?
- ignore_changes = all
- Explicit depends_on for side effects
- ignore_changes on a tag
- create_before_destroy
Explanation
Correct Answer
D:This lifecycle setting changes replacement order, but requires names and quotas to permit temporary coexistence; this directly meets the requirement to create a replacement object before deleting the previous instance. By comparison, ignore_changes on a tag is intended to allow another system to update selected attributes without Terraform reverting them, which is a different task from create a replacement object before deleting the previous instance.
Incorrect Answers
A:With all attributes ignored during updates, Terraform can still create and destroy the resource but does not reconcile field-level changes; this mechanism is useful when the job is to disable updates to all managed resource attributes after creation, whereas the current scenario requires the engineer to create a replacement object before deleting the previous instance. These operations have different effects in the stated Terraform workflow.
B:The depends_on meta-argument is suitable when a real dependency exists but no normal expression reference conveys it; this mechanism is useful when the job is to order a resource after a prerequisite that has no referenced attribute, whereas the current scenario requires the engineer to create a replacement object before deleting the previous instance. These operations have different effects in the stated Terraform workflow.
C:The lifecycle ignore_changes list excludes chosen attributes from later update comparisons while creation still considers configured values; this mechanism is useful when the job is to allow another system to update selected attributes without Terraform reverting them, whereas the current scenario requires the engineer to create a replacement object before deleting the previous instance. These operations have different effects in the stated Terraform workflow.
Question 779
A release pipeline preparing provider access has a concrete implementation goal: evaluate HCL expressions and calculate a resource dependency graph. What is the most appropriate Terraform mechanism?
- Provider-defined resource schemas
- Provider integrity hashes
- Terraform Core
- Provider-defined data sources
Explanation
Correct Answer
C:Terraform Core handles language evaluation, planning and state orchestration while provider plugins execute service-specific operations; this directly meets the requirement to evaluate HCL expressions and calculate a resource dependency graph. By comparison, provider integrity hashes is intended to detect a mismatched plugin distribution package, which is a different task from evaluate HCL expressions and calculate a resource dependency graph.
Incorrect Answers
A:The provider declares accepted resource arguments and computed attributes; Terraform validates configuration against that schema; this mechanism is useful when the job is to determine which arguments a resource type accepts, whereas the current scenario requires the engineer to evaluate HCL expressions and calculate a resource dependency graph. These operations have different effects in the stated Terraform workflow.
B:Terraform checks downloaded provider package checksums against lock information where hashes are available; this mechanism is useful when the job is to detect a mismatched plugin distribution package, whereas the current scenario requires the engineer to evaluate HCL expressions and calculate a resource dependency graph. These operations have different effects in the stated Terraform workflow.
D:A provider's data source reads existing data and exposes attributes without creating or destroying the queried object; this mechanism is useful when the job is to read information from an external service without owning its lifecycle, whereas the current scenario requires the engineer to evaluate HCL expressions and calculate a resource dependency graph. These operations have different effects in the stated Terraform workflow.
Question 780
A change request asks an engineer to force an update when a write-only secret changes without exposing the secret itself. Which choice best implements the requested behavior?
- Environment-based provider credentials
- Not treating Base64 as secrecy
- Vault short-lived credentials
- A write-only argument version field
Explanation
Correct Answer
D:Some write-only provider arguments expose an accompanying nonsecret version marker that triggers a new operation when incremented; this directly meets the requirement to force an update when a write-only secret changes without exposing the secret itself. By comparison, not treating Base64 as secrecy is intended to recognize that an encoded password remains sensitive information, which is a different task from force an update when a write-only secret changes without exposing the secret itself.
Incorrect Answers
A:Providers can often authenticate through environment variables or identity integrations so credentials are absent from checked-in HCL; this mechanism is useful when the job is to avoid putting provider access tokens directly in configuration source, whereas the current scenario requires the engineer to force an update when a write-only secret changes without exposing the secret itself. These operations have different effects in the stated Terraform workflow.
B:Base64 is reversible encoding; exposing encoded credentials in configuration or state still risks disclosure; this mechanism is useful when the job is to recognize that an encoded password remains sensitive information, whereas the current scenario requires the engineer to force an update when a write-only secret changes without exposing the secret itself. These operations have different effects in the stated Terraform workflow.
C:Vault's dynamic credentials can provide expiring access with centrally enforced policies instead of permanent embedded keys; this mechanism is useful when the job is to limit the lifetime and scope of identities used by infrastructure automation, whereas the current scenario requires the engineer to force an update when a write-only secret changes without exposing the secret itself. These operations have different effects in the stated Terraform workflow.