100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 270
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A security group requires multiple repeated ingress blocks derived from a variable collection, and copy-pasting blocks is error-prone. and Workstream B: An operations team edits cloud VM tags manually, and normal Terraform plan shows an unexpected change even though HCL has not changed. and Workstream C: A configuration has two aliases of the same cloud provider and both use different regions; one resource must be created outside the default region. Select exactly 3 actions, one addressing each distinct workstream.
- Set provider = aws.secondary on that resource, referencing the aliased provider configuration.
- Select the correct workspace/backend state and run terraform destroy only after reviewing its destruction plan.
- Use a dynamic nested block for the repeatable ingress structure when the provider schema allows it.
- Inspect terraform plan -replace=ADDRESS and review any downstream dependencies before applying.
- Interpret the refreshed plan as detected drift and decide whether to restore declared tags or intentionally update configuration.
- Use terraform validate for the initialized configuration, then separately test variable values during a plan.
Explanation
Correct Answers
A:For the workstream in which a configuration has two aliases of the same cloud provider and both use different regions; one resource must be created outside the default region, use this action: Set provider = aws.secondary on that resource, referencing the aliased provider configuration. Explicit provider selection lets a resource use a non-default provider configuration. Verify: The planned resource address resolves through the secondary provider while unqualified resources use the default. Limitation: Alias names are Terraform-local configuration references, not separate plugin versions.
C:For the workstream in which a security group requires multiple repeated ingress blocks derived from a variable collection, and copy-pasting blocks is error-prone, use this action: Use a dynamic nested block for the repeatable ingress structure when the provider schema allows it. Dynamic blocks construct repeatable nested provider-defined configuration blocks. Verify: Each input rule produces a corresponding nested ingress block in the planned resource. Limitation: dynamic can generate normal nested blocks, not arbitrary provider meta-arguments or resource blocks.
E:For the workstream in which an operations team edits cloud VM tags manually, and normal Terraform plan shows an unexpected change even though HCL has not changed, use this action: Interpret the refreshed plan as detected drift and decide whether to restore declared tags or intentionally update configuration. Refreshing known remote objects exposes differences between actual and declared desired state. Verify: The reviewed plan explains which observed remote attributes differ from desired HCL. Limitation: Not every remote change is actionable drift; provider-computed attributes and intentional shared ownership need consideration.
Incorrect Answers
B:This action is appropriate instead for a different, unlisted requirement: A disposable integration environment must be removed without unintentionally deleting shared infrastructure in another state. It would be checked by: The destruction plan lists the managed objects targeted in that state, not arbitrary cloud resources. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
D:This action is appropriate instead for a different, unlisted requirement: A deployment operator needs to replace a single degraded instance deliberately while keeping its resource address. It would be checked by: The proposed plan marks that particular resource instance for replacement. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
F:This action is appropriate instead for a different, unlisted requirement: A root module contains a new variable validation rule, and an engineer wants to check the HCL before accessing cloud credentials. It would be checked by: Static validation succeeds and an invalid supplied input is rejected at the stage where its custom condition is evaluated. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
Question 271
An infrastructure team faces this specific situation: A deployment needs to choose a service hostname based on whether the environment is production. Which Terraform action most directly satisfies the requirement?
- Choose an appropriate set(number) input type for distinct port values.
- Use a conditional expression over a declared environment variable to select the appropriate hostname.
- Read or pass credentials with an approved Vault integration and secure runtime identity, applying ephemeral/write-only protections where supported.
- Use a list(string) or tuple with explicit ordering semantics rather than a set.
Explanation
Correct Answer
B:Use a conditional expression over a declared environment variable to select the appropriate hostname. Conditional expressions select one of two typed values based on a boolean condition. Verify: The plan selects the production hostname only when the condition evaluates true. Limitation: Both branches need compatible types and the condition must be a boolean expression.
Incorrect Answers
A:This is linked to a different situation: A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. There the relevant decision is: Choose an appropriate set(number) input type for distinct port values. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant decision is: Use a conditional expression over a declared environment variable to select the appropriate hostname. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A company rotates application credentials in Vault and wants Terraform pipelines to avoid checking decrypted secrets into source control. There the relevant decision is: Read or pass credentials with an approved Vault integration and secure runtime identity, applying ephemeral/write-only protections where supported. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant decision is: Use a conditional expression over a declared environment variable to select the appropriate hostname. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. There the relevant decision is: Use a list(string) or tuple with explicit ordering semantics rather than a set. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant decision is: Use a conditional expression over a declared environment variable to select the appropriate hostname. It would therefore not resolve or assess the case as stated.
Question 272
A reviewer is confirming a change for the following use case: A deployment needs to choose a service hostname based on whether the environment is production. The implementation follows this approach: Use a conditional expression over a declared environment variable to select the appropriate hostname. Which observation or acceptance test most directly verifies the intended result?
- Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required.
- Plans show environment-specific port values while preserving the declared type constraint.
- A failing postcondition signals an error and prevents downstream dependent actions.
- The plan selects the production hostname only when the condition evaluates true.
Explanation
Correct Answer
D:Acceptance evidence: The plan selects the production hostname only when the condition evaluates true. It validates the proposed action, use a conditional expression over a declared environment variable to select the appropriate hostname, because conditional expressions select one of two typed values based on a boolean condition. Remaining limitation: Both branches need compatible types and the condition must be a boolean expression.
Incorrect Answers
A:This is linked to a different situation: An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. There the relevant acceptance is: Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant acceptance is: The plan selects the production hostname only when the condition evaluates true. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A deployment needs separate port numbers per environment and a documented default for developer sandboxes. There the relevant acceptance is: Plans show environment-specific port values while preserving the declared type constraint. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant acceptance is: The plan selects the production hostname only when the condition evaluates true. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. There the relevant acceptance is: A failing postcondition signals an error and prevents downstream dependent actions. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant acceptance is: The plan selects the production hostname only when the condition evaluates true. It would therefore not resolve or assess the case as stated.
Question 273
Consider a proposed solution for this requirement: A deployment needs to choose a service hostname based on whether the environment is production. The team plans to do the following: Use a conditional expression over a declared environment variable to select the appropriate hostname. Which limitation or operational caveat must remain in the review?
- The data source requires access and will fail if its lookup criteria match no suitable object.
- An automatically changing latest-image lookup may propose later VM replacements depending on resource schema.
- Both branches need compatible types and the condition must be a boolean expression.
- Ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly.
Explanation
Correct Answer
C:The limitation is both branches need compatible types and the condition must be a boolean expression. The proposed change is use a conditional expression over a declared environment variable to select the appropriate hostname. Validate it by checking the plan selects the production hostname only when the condition evaluates true. Conditional expressions select one of two typed values based on a boolean condition.
Incorrect Answers
A:This is linked to a different situation: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. There the relevant limitation is: The data source requires access and will fail if its lookup criteria match no suitable object. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant limitation is: Both branches need compatible types and the condition must be a boolean expression. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A module uses a provider data source to find the newest image and a resource block to launch a VM from its returned identifier. There the relevant limitation is: An automatically changing latest-image lookup may propose later VM replacements depending on resource schema. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant limitation is: Both branches need compatible types and the condition must be a boolean expression. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. There the relevant limitation is: Ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant limitation is: Both branches need compatible types and the condition must be a boolean expression. It would therefore not resolve or assess the case as stated.
Question 274
The team is reviewing a Terraform implementation for this case: A deployment needs to choose a service hostname based on whether the environment is production. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Use an unknown expression branch as though Terraform skips all type checking.
- Use a numeric count index for a for_each resource that is addressed by map keys.
- Hardcode a stale image identifier while retaining a data source solely as decoration.
- Assume all values fetched through Vault are automatically omitted from Terraform state.
Explanation
Correct Answer
A:Reject the assumption: Use an unknown expression branch as though Terraform skips all type checking. Instead, use a conditional expression over a declared environment variable to select the appropriate hostname. Conditional expressions select one of two typed values based on a boolean condition. Acceptance evidence: The plan selects the production hostname only when the condition evaluates true.
Incorrect Answers
B:This is linked to a different situation: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. There the relevant misconception is: Use a numeric count index for a for_each resource that is addressed by map keys. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant misconception is: Use an unknown expression branch as though Terraform skips all type checking. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A module uses a provider data source to find the newest image and a resource block to launch a VM from its returned identifier. There the relevant misconception is: Hardcode a stale image identifier while retaining a data source solely as decoration. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant misconception is: Use an unknown expression branch as though Terraform skips all type checking. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A company rotates application credentials in Vault and wants Terraform pipelines to avoid checking decrypted secrets into source control. There the relevant misconception is: Assume all values fetched through Vault are automatically omitted from Terraform state. For the question's actual requirement — A deployment needs to choose a service hostname based on whether the environment is production. — the specifically relevant misconception is: Use an unknown expression branch as though Terraform skips all type checking. It would therefore not resolve or assess the case as stated.
Question 275
A Terraform platform team is coordinating 2 independent decisions. Workstream A: A deployment needs to choose a service hostname based on whether the environment is production. and Workstream B: A resource was renamed from aws_instance.app to aws_instance.frontend in HCL, but it is the same underlying VM. Select exactly 2 actions, one addressing each distinct workstream.
- Write a matching resource declaration and use an import block or terraform import with the real object identifier.
- Create a child module with declared input variables, resource blocks, and output values, then invoke it from a root module.
- Configure a valid cloud block for the organization/workspace and authenticate with terraform login.
- Use a conditional expression over a declared environment variable to select the appropriate hostname.
- Use an appropriate moved block to preserve the instance's state address during the refactor.
Explanation
Correct Answers
D:For the workstream in which a deployment needs to choose a service hostname based on whether the environment is production, use this action: Use a conditional expression over a declared environment variable to select the appropriate hostname. Conditional expressions select one of two typed values based on a boolean condition. Verify: The plan selects the production hostname only when the condition evaluates true. Limitation: Both branches need compatible types and the condition must be a boolean expression.
E:For the workstream in which a resource was renamed from aws_instance.app to aws_instance.frontend in HCL, but it is the same underlying VM, use this action: Use an appropriate moved block to preserve the instance's state address during the refactor. A moved block records intentional resource address changes while preserving managed object identity. Verify: The plan reports an address move instead of unnecessary destruction and recreation. Limitation: Moved blocks need correct old/new addresses and should be reviewed for concurrent changes.
Incorrect Answers
A:This option addresses a separate requirement: A database already exists outside Terraform but needs to become managed under an explicit new resource address. Evidence for that other requirement would be state gains the intended address and a reviewed plan evaluates remaining configuration differences; neither listed workstream asks for it.
B:This option addresses a separate requirement: A team is packaging a repeated VPC pattern and wants a stable interface for internal consumers. Evidence for that other requirement would be consumers can pass environment-specific inputs and receive selected outputs without editing child internals; neither listed workstream asks for it.
C:This option addresses a separate requirement: A workstation has Terraform CLI installed but a team wants the local CLI to invoke HCP Terraform remote runs and manage state. Evidence for that other requirement would be the CLI connects to the HCP workspace and follows its selected remote execution and state workflow; neither listed workstream asks for it.
Question 276
An infrastructure team faces this specific situation: A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. Which Terraform action most directly satisfies the requirement?
- Use a for expression with lower() to derive normalized names from the input collection.
- Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup.
- Read or pass credentials with an approved Vault integration and secure runtime identity, applying ephemeral/write-only protections where supported.
- Consider lifecycle create_before_destroy on the managed resource after confirming simultaneous old and new instances are permitted.
Explanation
Correct Answer
A:Use a for expression with lower() to derive normalized names from the input collection. For expressions transform Terraform values during evaluation; functions supply operations such as case conversion. Verify: The computed list contains each intended service name normalized consistently. Limitation: Collision after normalization must be handled explicitly; lower() alone does not ensure uniqueness.
Incorrect Answers
B:This is linked to a different situation: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. There the relevant decision is: Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant decision is: Use a for expression with lower() to derive normalized names from the input collection. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A company rotates application credentials in Vault and wants Terraform pipelines to avoid checking decrypted secrets into source control. There the relevant decision is: Read or pass credentials with an approved Vault integration and secure runtime identity, applying ephemeral/write-only protections where supported. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant decision is: Use a for expression with lower() to derive normalized names from the input collection. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A service cannot tolerate downtime when replacing a VM and the provider's planned operation requires destroy-and-create. There the relevant decision is: Consider lifecycle create_before_destroy on the managed resource after confirming simultaneous old and new instances are permitted. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant decision is: Use a for expression with lower() to derive normalized names from the input collection. It would therefore not resolve or assess the case as stated.
Question 277
A reviewer is confirming a change for the following use case: A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. The implementation follows this approach: Use a for expression with lower() to derive normalized names from the input collection. Which observation or acceptance test most directly verifies the intended result?
- The dependency graph orders the attachment action before the dependent rule operation.
- Plans show environment-specific port values while preserving the declared type constraint.
- The computed list contains each intended service name normalized consistently.
- Invalid records with wrong attribute types fail validation rather than causing obscure downstream errors.
Explanation
Correct Answer
C:Acceptance evidence: The computed list contains each intended service name normalized consistently. It validates the proposed action, use a for expression with lower() to derive normalized names from the input collection, because for expressions transform Terraform values during evaluation; functions supply operations such as case conversion. Remaining limitation: Collision after normalization must be handled explicitly; lower() alone does not ensure uniqueness.
Incorrect Answers
A:This is linked to a different situation: A firewall rule should be provisioned only after a policy attachment exists, but the rule's arguments do not reference that attachment. There the relevant acceptance is: The dependency graph orders the attachment action before the dependent rule operation. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant acceptance is: The computed list contains each intended service name normalized consistently. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A deployment needs separate port numbers per environment and a documented default for developer sandboxes. There the relevant acceptance is: Plans show environment-specific port values while preserving the declared type constraint. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant acceptance is: The computed list contains each intended service name normalized consistently. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. There the relevant acceptance is: Invalid records with wrong attribute types fail validation rather than causing obscure downstream errors. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant acceptance is: The computed list contains each intended service name normalized consistently. It would therefore not resolve or assess the case as stated.
Question 278
Consider a proposed solution for this requirement: A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. The team plans to do the following: Use a for expression with lower() to derive normalized names from the input collection. Which limitation or operational caveat must remain in the review?
- Keys must exist and be stable; renaming a key may change addresses and induce replacement.
- Collision after normalization must be handled explicitly; lower() alone does not ensure uniqueness.
- Ephemeral values have context restrictions and cannot be inserted into arbitrary persistent expressions.
- A missing map key causes an expression error unless a default is explicitly handled.
Explanation
Correct Answer
B:The limitation is collision after normalization must be handled explicitly; lower() alone does not ensure uniqueness. The proposed change is use a for expression with lower() to derive normalized names from the input collection. Validate it by checking the computed list contains each intended service name normalized consistently. For expressions transform Terraform values during evaluation; functions supply operations such as case conversion.
Incorrect Answers
A:This is linked to a different situation: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. There the relevant limitation is: Keys must exist and be stable; renaming a key may change addresses and induce replacement. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant limitation is: Collision after normalization must be handled explicitly; lower() alone does not ensure uniqueness. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A short-lived token must be used during an operation, and auditors require that the token not be written to a plan file. There the relevant limitation is: Ephemeral values have context restrictions and cannot be inserted into arbitrary persistent expressions. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant limitation is: Collision after normalization must be handled explicitly; lower() alone does not ensure uniqueness. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A configuration needs a map from environment names to individually selected instance classes, with each value a string. There the relevant limitation is: A missing map key causes an expression error unless a default is explicitly handled. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant limitation is: Collision after normalization must be handled explicitly; lower() alone does not ensure uniqueness. It would therefore not resolve or assess the case as stated.
Question 279
The team is reviewing a Terraform implementation for this case: A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Treat a for expression as a command that modifies original remote resources in-place.
- Rewrite the variable block's default on every run as the required deployment interface.
- Assume prevent_destroy continues to protect an object after the containing resource block is deleted.
- Disable state refresh entirely as the permanent way to share control of a single attribute.
Explanation
Correct Answer
A:Reject the assumption: Treat a for expression as a command that modifies original remote resources in-place. Instead, use a for expression with lower() to derive normalized names from the input collection. For expressions transform Terraform values during evaluation; functions supply operations such as case conversion. Acceptance evidence: The computed list contains each intended service name normalized consistently.
Incorrect Answers
B:This is linked to a different situation: A deployment job must supply different nonsecret inputs for each pipeline run without editing source-controlled HCL. There the relevant misconception is: Rewrite the variable block's default on every run as the required deployment interface. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant misconception is: Treat a for expression as a command that modifies original remote resources in-place. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. There the relevant misconception is: Assume prevent_destroy continues to protect an object after the containing resource block is deleted. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant misconception is: Treat a for expression as a command that modifies original remote resources in-place. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. There the relevant misconception is: Disable state refresh entirely as the permanent way to share control of a single attribute. For the question's actual requirement — A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. — the specifically relevant misconception is: Treat a for expression as a command that modifies original remote resources in-place. It would therefore not resolve or assess the case as stated.
Question 280
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. and Workstream B: A company intentionally altered remote settings and wants Terraform state to reflect the real objects without proposing configuration-driven remediation yet. and Workstream C: An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. Select exactly 3 actions, one addressing each distinct workstream.
- Run a refresh-only plan, review its state changes, and apply refresh-only if the update is appropriate.
- Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias.
- Declare the input in the child and supply environment = var.environment in the root's module call.
- Select the correct workspace/backend state and run terraform destroy only after reviewing its destruction plan.
- Use a for expression with lower() to derive normalized names from the input collection.
- Use a valid git:: module source and an appropriate immutable reviewed ref, with the necessary credentials.
Explanation
Correct Answers
A:For the workstream in which a company intentionally altered remote settings and wants Terraform state to reflect the real objects without proposing configuration-driven remediation yet, use this action: Run a refresh-only plan, review its state changes, and apply refresh-only if the update is appropriate. Refresh-only updates Terraform's recorded understanding rather than enforcing desired configuration. Verify: State and root outputs synchronize with observed remote data without changing the cloud object itself. Limitation: Refresh-only does not make configuration match reality or prevent later normal plans from proposing remediation.
B:For the workstream in which an infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region, use this action: Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias. Multiple provider configurations allow one plugin to manage distinct endpoints or regions. Verify: The plan identifies primary and recovery resources using the intended regional provider instances. Limitation: Resources cannot infer an alias from a tag or name; it must be referenced by Terraform configuration.
E:For the workstream in which a pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels, use this action: Use a for expression with lower() to derive normalized names from the input collection. For expressions transform Terraform values during evaluation; functions supply operations such as case conversion. Verify: The computed list contains each intended service name normalized consistently. Limitation: Collision after normalization must be handled explicitly; lower() alone does not ensure uniqueness.
Incorrect Answers
C:This action is appropriate instead for a different, unlisted requirement: A child module uses var.environment but the root module declares an environment variable of the same name and passes nothing. It would be checked by: Planning resolves the child's environment value from the explicit module call. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
D:This action is appropriate instead for a different, unlisted requirement: A disposable integration environment must be removed without unintentionally deleting shared infrastructure in another state. It would be checked by: The destruction plan lists the managed objects targeted in that state, not arbitrary cloud resources. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
F:This action is appropriate instead for a different, unlisted requirement: An infrastructure module is checked out from a private Git repository at a reviewed branch or tag, not published as a registry module. It would be checked by: Initialization checks out the intended Git module revision and the plan uses its configuration. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests