Question 330
In a planned migration, the requested result is to request creation of a replacement before deleting the old instance. What should the engineer select?
- Use graph parallelism for independent resources
- Use
replace_triggered_by for resource change coupling
- Use
create_before_destroy = true
- Use
replace_triggered_by rather than depends_on for forced rebuilding
Explanation
Correct Answer
C:This lifecycle rule can reduce service interruption where unique names and quotas allow coexistence; it cannot guarantee an API permits two simultaneous objects; this behavior should be assessed against the concrete need to request creation of a replacement before deleting the old instance. This directly supports the task to request creation of a replacement before deleting the old instance during a deployment checklist.
Incorrect Answers
A:Terraform can schedule independent graph nodes in parallel within its configured limit; artificial dependencies reduce parallel execution; this behavior should be assessed against the concrete need to request creation of a replacement before deleting the old instance. The distinction matters here: using that mechanism to allow unrelated operations to proceed concurrently would still leave the objective to request creation of a replacement before deleting the old instance unmet.
B:The rule ties replacement to planned actions on managed resources; plain local values do not themselves have planned resource actions; this behavior should be assessed against the concrete need to request creation of a replacement before deleting the old instance. It may support a related workflow, but the question specifically requires the mechanism for request creation of a replacement before deleting the old instance rather than replace a resource when another managed resource or attribute changes.
D:A dependency establishes when work runs; it does not by itself demand a replacement of an unchanged dependent object; this behavior should be assessed against the concrete need to request creation of a replacement before deleting the old instance. That can be useful when the aim is to differentiate operation ordering from replacement semantics, but it does not directly deliver the requested ability to request creation of a replacement before deleting the old instance.
Question 331
An engineer needs to test a string against a pattern without crashing on a nonmatch as part of a planned migration. Which option is the best fit?
- Use
try for optional nested values
- Use
can(regex(...)) in validation
- Use an output
precondition
- Use a resource
postcondition
Explanation
Correct Answer
B:Regex can raise an error when no match exists; can converts that evaluability into a Boolean; it makes a precise input-validation rule possible; this behavior should be assessed against the concrete need to test a string against a pattern without crashing on a nonmatch. This directly supports the task to test a string against a pattern without crashing on a nonmatch during a maintenance request.
Incorrect Answers
A:Try handles dynamic evaluation failures in expressions and can help normalize inputs; it does not itself fail the configuration when the fallback is used; this behavior should be assessed against the concrete need to test a string against a pattern without crashing on a nonmatch. That can be useful when the aim is to provide a fallback when a dynamic attribute path is absent, but it does not directly deliver the requested ability to test a string against a pattern without crashing on a nonmatch.
C:Output preconditions can check values or dependencies before the output is finalized; they keep exported data subject to explicit guarantees; this behavior should be assessed against the concrete need to test a string against a pattern without crashing on a nonmatch. It may support a related workflow, but the question specifically requires the mechanism for test a string against a pattern without crashing on a nonmatch rather than ensure a module only exposes results that satisfy a contract.
D:A lifecycle postcondition checks an expected guarantee and can prevent dependent operations when it fails; it differs from a pre-operation assumption; this behavior should be assessed against the concrete need to test a string against a pattern without crashing on a nonmatch. The stated requirement is to test a string against a pattern without crashing on a nonmatch, not to verify a property after the relevant resource or data evaluation; this alternative addresses a different control or phase.
Question 332
An infrastructure repository handles database passwords and tokens. The requirement is to secure resource attributes and possibly persisted secrets. Which Terraform mechanism directly meets this requirement?
- Protect access to remote state
- Use a provider-supported write-only argument
- Use short-lived cloud identities for automation
- Use an
ephemeral resource to retrieve supported temporary secrets
Explanation
Correct Answer
A:A remote backend may encrypt stored state and enforce access controls; terraform sensitive annotations do not replace backend security; this behavior should be assessed against the concrete need to secure resource attributes and possibly persisted secrets. This directly supports the task to secure resource attributes and possibly persisted secrets during an automated release.
Incorrect Answers
B:Write-only arguments exist only where the provider schema supports them; they are available in Terraform 1.11+, including the tested 1.12 release; this behavior should be assessed against the concrete need to secure resource attributes and possibly persisted secrets. That can be useful when the aim is to send a secret to a managed resource without storing its value in plan or state, but it does not directly deliver the requested ability to secure resource attributes and possibly persisted secrets.
C:Dynamic provider credentials or workload federation can issue bounded run-specific authorization; this limits blast radius while still requiring correct API permissions; this behavior should be assessed against the concrete need to secure resource attributes and possibly persisted secrets. The distinction matters here: using that mechanism to reduce dependence on hardcoded long-lived API keys would still leave the objective to secure resource attributes and possibly persisted secrets unmet.
D:Ephemeral resources avoid persisting their results in Terraform's normal state and plan artifacts; their values cannot be used in arbitrary persistent resource fields; this behavior should be assessed against the concrete need to secure resource attributes and possibly persisted secrets. It may support a related workflow, but the question specifically requires the mechanism for secure resource attributes and possibly persisted secrets rather than obtain runtime-only data through an ephemeral provider operation.
Question 333
An engineer is deciding whether Terraform should own an existing object. The team must both compute reusable expression results without creating an API object and obtain a short-lived value without persisting it in state or plan. Which paired choice implements those distinct goals?
- Distinguish
locals from remote resource declarations + Declare a managed object with resource
- Query an existing object with
data + Reference aws_instance.web.id for a managed resource
- Use provider selection on both resource and data blocks + Use an
ephemeral resource for supported temporary data
- Distinguish
locals from remote resource declarations + Use an ephemeral resource for supported temporary data
Explanation
Correct Answer
D:For the first criterion, local values are named expressions evaluated inside a module; they neither invoke resource creation nor bind a remote object into state; this behavior should be assessed against the concrete need to compute reusable expression results without creating an API object and obtain a short-lived value without persisting it in state or plan; this directly addresses the need to compute reusable expression results without creating an API object. For the separate second criterion, ephemeral resources are available for supported providers and valid contexts; they are not ordinary managed resources with persistent state identity; this behavior should be assessed against the concrete need to compute reusable expression results without creating an API object and obtain a short-lived value without persisting it in state or plan; this fulfills the need to obtain a short-lived value without persisting it in state or plan. Together they cover the independent tasks of compute reusable expression results without creating an API object and obtain a short-lived value without persisting it in state or plan without exchanging the responsibilities of these features.
Incorrect Answers
A:The first measure meets the requirement to compute reusable expression results without creating an API object, but its partner serves a different role: A resource block is part of the desired managed infrastructure; terraform tracks its remote identity in state and may create, update, replace, or destroy it; this behavior should be assessed against the concrete need to compute reusable expression results without creating an API object and obtain a short-lived value without persisting it in state or plan. That second component is designed to ask Terraform to own the lifecycle of a remote object, so the still-missing criterion is to obtain a short-lived value without persisting it in state or plan, while the first criterion remains compute reusable expression results without creating an API object.
B:The first measure is intended to read an object without asking Terraform to create or manage it: Data sources ask providers to fetch properties; they do not make Terraform responsible for deleting or updating the queried object; this behavior should be assessed against the concrete need to compute reusable expression results without creating an API object and obtain a short-lived value without persisting it in state or plan. The second measure is intended to consume the ID of an object declared through a resource block: A managed resource reference omits the data. prefix; terraform derives a dependency when an argument uses its computed attributes; this behavior should be assessed against the concrete need to compute reusable expression results without creating an API object and obtain a short-lived value without persisting it in state or plan. Neither is the directly designated method for the separate goals of compute reusable expression results without creating an API object and obtain a short-lived value without persisting it in state or plan in this review.
C:The second measure does meet the obtain a short-lived value without persisting it in state or plan requirement, but the first is designed for another concern: Provider aliases control where the relevant API call is sent; a data source without an explicit alias may query the default context even when a nearby resource uses an alternate one; this behavior should be assessed against the concrete need to compute reusable expression results without creating an API object and obtain a short-lived value without persisting it in state or plan. That first component is designed to direct API operations and lookups to the intended account or region, which does not accomplish the requested task to compute reusable expression results without creating an API object, even though the other measure satisfies obtain a short-lived value without persisting it in state or plan.
Question 334
A module consumer must reference attributes from other blocks. Two independent changes are requested: first, reference a computed local value in the same module; second, identify the stable key of the current map or set instance. Which pair of measures fulfills both?
- Use
resource_type.name.attribute + Use each.key in for_each blocks
- Use
module.network.subnet_id + Understand values unknown until apply
- Use
local.prefix + Use each.key in for_each blocks
- Use
local.prefix + Use direct attribute references to create implicit dependencies
Explanation
Correct Answer
C:For the first criterion, local expressions help avoid repeating calculations; each module has its own local namespace; callers cannot directly inspect a child's locals; this behavior should be assessed against the concrete need to reference a computed local value in the same module and identify the stable key of the current map or set instance; this directly addresses the need to reference a computed local value in the same module. For the separate second criterion, keys form instance addresses such as resource.name["blue"]; the key is not the same as a numeric count.index; this behavior should be assessed against the concrete need to reference a computed local value in the same module and identify the stable key of the current map or set instance; this fulfills the need to identify the stable key of the current map or set instance. Together they cover the independent tasks of reference a computed local value in the same module and identify the stable key of the current map or set instance without exchanging the responsibilities of these features.
Incorrect Answers
A:The second measure does meet the identify the stable key of the current map or set instance requirement, but the first is designed for another concern: The expression resolves through the address and provider schema; terraform sees the dependency and can wait for an unknown computed value until apply; this behavior should be assessed against the concrete need to reference a computed local value in the same module and identify the stable key of the current map or set instance. That first component is designed to read a named attribute from a managed resource, which does not accomplish the requested task to reference a computed local value in the same module, even though the other measure satisfies identify the stable key of the current map or set instance.
B:The first measure is intended to consume a value explicitly exposed by a child module: A caller sees child-module outputs rather than arbitrary internal resources; the output also communicates dependencies and can serve as an interface contract; this behavior should be assessed against the concrete need to reference a computed local value in the same module and identify the stable key of the current map or set instance. The second measure is intended to avoid assuming every computed attribute is fixed during planning: Terraform can propagate unknown values through expressions and defer dependent evaluations; unknown does not necessarily mean the configuration is invalid; this behavior should be assessed against the concrete need to reference a computed local value in the same module and identify the stable key of the current map or set instance. Neither is the directly designated method for the separate goals of reference a computed local value in the same module and identify the stable key of the current map or set instance in this review.
D:The first measure meets the requirement to reference a computed local value in the same module, but its partner serves a different role: A resource that consumes another's attribute implicitly depends on it; explicit depends_on is unnecessary when the reference already captures the ordering need; this behavior should be assessed against the concrete need to reference a computed local value in the same module and identify the stable key of the current map or set instance. That second component is designed to let Terraform infer safe operation order through data flow, so the still-missing criterion is to identify the stable key of the current map or set instance, while the first criterion remains reference a computed local value in the same module.
Question 335
A reviewer is auditing variable scopes and disclosure behavior. A reviewer must determine how to expose a selected computed value after provisioning. Which action is the appropriate choice?
- Use
terraform output -raw NAME for a string result
- Set
nullable = false for a required non-null variable
- Use
terraform output -json for machine-readable results
- Define
output for a root result
- Omit
default to require a variable value
Explanation
Correct Answer
D:Outputs provide a documented interface for command output and automation; they can be inspected with terraform output when recorded in state; this behavior should be assessed against the concrete need to expose a selected computed value after provisioning. This directly supports the task to expose a selected computed value after provisioning during a cross-team handoff.
Incorrect Answers
A:Raw output formats a supported string, number, or Boolean directly without extra Terraform representation; complex objects require another output format; this behavior should be assessed against the concrete need to expose a selected computed value after provisioning. The distinction matters here: using that mechanism to retrieve a plain scalar output for shell integration would still leave the objective to expose a selected computed value after provisioning unmet.
B:The nullable setting controls whether null can be supplied; it is different from a missing default and distinct from sensitive output masking; this behavior should be assessed against the concrete need to expose a selected computed value after provisioning. It may support a related workflow, but the question specifically requires the mechanism for expose a selected computed value after provisioning rather than reject explicit null values instead of treating them as ordinary accepted inputs.
C:JSON mode includes values and sensitivity metadata; downstream tooling must treat sensitive data carefully; this command reads recorded outputs, not arbitrary provider API properties; this behavior should be assessed against the concrete need to expose a selected computed value after provisioning. The stated requirement is to expose a selected computed value after provisioning, not to obtain structured output values in scripts; this alternative addresses a different control or phase.
E:A variable without a default is required; terraform prompts when interactive input is allowed or reports missing input otherwise; this behavior should be assessed against the concrete need to expose a selected computed value after provisioning. The distinction matters here: using that mechanism to make callers supply a necessary input during planning or applying would still leave the objective to expose a selected computed value after provisioning unmet.
Question 336
The immediate Terraform task is to read a string-keyed collection value. Which method handles that task most directly?
- Access a map with
var.tags["owner"]
- Convert values with
toset(...)
- Use
set(string) for unique unordered strings
- Use structural object attributes in module interfaces
- Use
flatten(...) for nested lists
Explanation
Correct Answer
A:Bracket indexing selects an entry by key; a numeric list index such as [0] is not a substitute for a map key; this behavior should be assessed against the concrete need to read a string-keyed collection value. This directly supports the task to read a string-keyed collection value during a platform review.
Incorrect Answers
B:Conversion is useful for stable for_each string keys; it is not equivalent to preserving the original list order; this behavior should be assessed against the concrete need to read a string-keyed collection value. The distinction matters here: using that mechanism to remove duplicates and produce set semantics for iteration would still leave the objective to read a string-keyed collection value unmet.
C:Sets discard duplicate elements and are not an ordered sequence; this changes instance-key considerations if used with for_each; this behavior should be assessed against the concrete need to read a string-keyed collection value. It may support a related workflow, but the question specifically requires the mechanism for read a string-keyed collection value rather than enforce uniqueness without relying on list positions.
D:A typed object can express nested requirements clearly; it improves errors when a caller omits a field or supplies an incompatible value; this behavior should be assessed against the concrete need to read a string-keyed collection value. The stated requirement is to read a string-keyed collection value, not to validate required properties rather than accepting arbitrary untyped maps; this alternative addresses a different control or phase.
E:Flatten recursively reduces nested list/tuple containers while preserving the flattened order; it does not merge map attributes; this behavior should be assessed against the concrete need to read a string-keyed collection value. That can be useful when the aim is to collapse a list of lists into one sequence, but it does not directly deliver the requested ability to read a string-keyed collection value.
Question 337
A developer is transforming collection values. The checklist contains independent tasks: (1) assemble a map from paired key and value lists; (2) build a string using a controlled formatting pattern. Which two options directly correspond to the respective tasks? Choose TWO.
- Use
for_each with a map or set of strings
- Use
count for numbered resource instances
- Use
zipmap(keys, values)
- Use
format("%s-%d", name, number)
- Use a conditional
condition ? yes : no
Explanation
Correct Answers
C:Zipmap associates entries positionally and expects compatible list lengths; it is different from merging two already formed maps; this behavior should be assessed against the concrete need to assemble a map from paired key and value lists and build a string using a controlled formatting pattern. This matches the distinct objective to assemble a map from paired key and value lists; the remaining chosen features address build a string using a controlled formatting pattern.
D:Format substitutes values into placeholders; it does not validate whether the resulting identifier is accepted by a cloud provider; this behavior should be assessed against the concrete need to assemble a map from paired key and value lists and build a string using a controlled formatting pattern. This matches the distinct objective to build a string using a controlled formatting pattern; the remaining chosen features address assemble a map from paired key and value lists.
Incorrect Answers
A:For-each instances use map or set keys in addresses, helping avoid index churn; values must be known before Terraform can choose instance identities; this behavior should be assessed against the concrete need to assemble a map from paired key and value lists and build a string using a controlled formatting pattern. Its main application is to create instances keyed by stable identifiers; the checklist instead asks for assemble a map from paired key and value lists; and build a string using a controlled formatting pattern. None of those distinct criteria specifically calls for this alternative.
B:Count produces addresses indexed by integers; changing list order may shift how items map to instances when coupled with positional inputs; this behavior should be assessed against the concrete need to assemble a map from paired key and value lists and build a string using a controlled formatting pattern. Its main application is to create a known number of repeated managed resource instances; the checklist instead asks for assemble a map from paired key and value lists; and build a string using a controlled formatting pattern. None of those distinct criteria specifically calls for this alternative.
E:The conditional expression evaluates a condition to choose a result; its two result arms must have compatible types for Terraform to infer a usable value; this behavior should be assessed against the concrete need to assemble a map from paired key and value lists and build a string using a controlled formatting pattern. Its main application is to select between two expression results based on a Boolean test; the checklist instead asks for assemble a map from paired key and value lists; and build a string using a controlled formatting pattern. None of those distinct criteria specifically calls for this alternative.
Question 338
A Terraform review distinguishes lifecycle safeguards from graph edges. The team must both order resources when the second consumes a value from the first and request creation of a replacement before deleting the old instance. Which paired choice implements those distinct goals?
- Use explicit dependencies on module calls carefully + Use
ignore_changes = [tags]
- Use an attribute reference for an implicit edge + Avoid a circular dependency graph
- Use an attribute reference for an implicit edge + Recognize propagated
create_before_destroy behavior
- Recognize lifecycle arguments are evaluated early + Use
create_before_destroy = true
- Use
prevent_destroy = true on a configured resource + Use create_before_destroy = true
- Use an attribute reference for an implicit edge + Use
create_before_destroy = true
Explanation
Correct Answer
F:For the first criterion, terraform builds a dependency from the expression reference; a separate explicit ordering rule is unnecessary when data flow already expresses the relationship; this behavior should be assessed against the concrete need to order resources when the second consumes a value from the first and request creation of a replacement before deleting the old instance; this directly addresses the need to order resources when the second consumes a value from the first. For the separate second criterion, this lifecycle rule can reduce service interruption where unique names and quotas allow coexistence; it cannot guarantee an API permits two simultaneous objects; this behavior should be assessed against the concrete need to order resources when the second consumes a value from the first and request creation of a replacement before deleting the old instance; this fulfills the need to request creation of a replacement before deleting the old instance. Together they cover the independent tasks of order resources when the second consumes a value from the first and request creation of a replacement before deleting the old instance without exchanging the responsibilities of these features.
Incorrect Answers
A:The first measure is intended to delay all operations in a child module until required prerequisites complete: depends_on on a module applies to the module's relevant actions, not just one output; it may be broader than a targeted output reference; this behavior should be assessed against the concrete need to order resources when the second consumes a value from the first and request creation of a replacement before deleting the old instance. The second measure is intended to exclude selected post-creation attribute differences from update planning: Ignore-changes permits another process to adjust specified fields without Terraform constantly reverting them; it does not ignore creation-time arguments; this behavior should be assessed against the concrete need to order resources when the second consumes a value from the first and request creation of a replacement before deleting the old instance. Neither is the directly designated method for the separate goals of order resources when the second consumes a value from the first and request creation of a replacement before deleting the old instance in this review.
B:The first measure meets the requirement to order resources when the second consumes a value from the first, but its partner serves a different role: Terraform cannot schedule a true cycle in its directed acyclic graph; rearranging references or splitting resource responsibilities can remove the cycle; this behavior should be assessed against the concrete need to order resources when the second consumes a value from the first and request creation of a replacement before deleting the old instance. That second component is designed to break mutual dependencies that prevent Terraform from ordering operations, so the still-missing criterion is to request creation of a replacement before deleting the old instance, while the first criterion remains order resources when the second consumes a value from the first.
C:The first measure meets the requirement to order resources when the second consumes a value from the first, but its partner serves a different role: Terraform may propagate create-before-destroy to dependencies and preserve that decision in state; a downstream replacement can therefore affect upstream lifecycle ordering; this behavior should be assessed against the concrete need to order resources when the second consumes a value from the first and request creation of a replacement before deleting the old instance. That second component is designed to understand why a dependency may also be retained during a replacement, so the still-missing criterion is to request creation of a replacement before deleting the old instance, while the first criterion remains order resources when the second consumes a value from the first.
D:The second measure does meet the request creation of a replacement before deleting the old instance requirement, but the first is designed for another concern: These lifecycle settings shape the graph construction stage and typically require literal values; a runtime input cannot freely toggle them as ordinary arguments; this behavior should be assessed against the concrete need to order resources when the second consumes a value from the first and request creation of a replacement before deleting the old instance. That first component is designed to avoid dynamic expressions for create_before_destroy and similar rules, which does not accomplish the requested task to order resources when the second consumes a value from the first, even though the other measure satisfies request creation of a replacement before deleting the old instance.
E:The second measure does meet the request creation of a replacement before deleting the old instance requirement, but the first is designed for another concern: This is a lifecycle safety check, not a remote deletion-protection feature; removing the resource block also removes the rule from consideration; this behavior should be assessed against the concrete need to order resources when the second consumes a value from the first and request creation of a replacement before deleting the old instance. That first component is designed to fail a plan that would destroy the protected resource while its block remains, which does not accomplish the requested task to order resources when the second consumes a value from the first, even though the other measure satisfies request creation of a replacement before deleting the old instance.
Question 339
A module needs configuration guardrails. The requirement is to test a guarantee only after the remote result is known. Which Terraform mechanism directly meets this requirement?
- Use a variable
validation block
- Use an output
precondition
- Use a postcondition for a provider-computed result
- Use a
check block with assertions
Explanation
Correct Answer
C:A computed attribute might be unknown during planning; postconditions evaluate when sufficient data exists, rather than fabricating a preliminary value; this behavior should be assessed against the concrete need to test a guarantee only after the remote result is known. This directly supports the task to test a guarantee only after the remote result is known during an automated release.
Incorrect Answers
A:A variable validation condition evaluates to a Boolean and reports the specified error when false; it sets the input contract independently of provider API permissions; this behavior should be assessed against the concrete need to test a guarantee only after the remote result is known. The distinction matters here: using that mechanism to reject a malformed module input with a custom message would still leave the objective to test a guarantee only after the remote result is known unmet.
B:Output preconditions can check values or dependencies before the output is finalized; they keep exported data subject to explicit guarantees; this behavior should be assessed against the concrete need to test a guarantee only after the remote result is known. It may support a related workflow, but the question specifically requires the mechanism for test a guarantee only after the remote result is known rather than ensure a module only exposes results that satisfy a contract.
D:Checks are designed for nonblocking validation and can report warnings during plan/apply; critical prerequisites belong in blocking custom conditions; this behavior should be assessed against the concrete need to test a guarantee only after the remote result is known. That can be useful when the aim is to monitor an infrastructure invariant and report failed checks without blocking the whole operation, but it does not directly deliver the requested ability to test a guarantee only after the remote result is known.
Question 340
During a deployment checklist, one task is to omit short-lived input values from state and plan artifacts, while another is to obtain runtime-only data through an ephemeral provider operation. Select the matching pair of techniques.
- Use Vault to centralize secret access + Avoid unnecessary
nonsensitive(...) calls
- Mark a variable
ephemeral = true + Use an ephemeral resource to retrieve supported temporary secrets
- Rotate credentials after suspected disclosure + Use an
ephemeral resource to retrieve supported temporary secrets
- Mark a variable
ephemeral = true + Avoid committing secret .tfvars values
Explanation
Correct Answer
B:For the first criterion, ephemeral values have restricted usable contexts such as provider configuration and write-only arguments; they are appropriate for transient tokens that must not be persisted; this behavior should be assessed against the concrete need to omit short-lived input values from state and plan artifacts and obtain runtime-only data through an ephemeral provider operation; this directly addresses the need to omit short-lived input values from state and plan artifacts. For the separate second criterion, ephemeral resources avoid persisting their results in Terraform's normal state and plan artifacts; their values cannot be used in arbitrary persistent resource fields; this behavior should be assessed against the concrete need to omit short-lived input values from state and plan artifacts and obtain runtime-only data through an ephemeral provider operation; this fulfills the need to obtain runtime-only data through an ephemeral provider operation. Together they cover the independent tasks of omit short-lived input values from state and plan artifacts and obtain runtime-only data through an ephemeral provider operation without exchanging the responsibilities of these features.
Incorrect Answers
A:The first measure is intended to retrieve or distribute sensitive credentials under explicit access policy: Vault provides secret-management and credential capabilities; its Terraform provider can integrate with Vault APIs, but ordinary read results may still be recorded unless ephemeral patterns are used; this behavior should be assessed against the concrete need to omit short-lived input values from state and plan artifacts and obtain runtime-only data through an ephemeral provider operation. The second measure is intended to preserve Terraform's safety indicator for secret-bearing expressions: Nonsensitive removes the sensitivity mark from a value; it does not erase the underlying secret and can expose it in outputs or logs; this behavior should be assessed against the concrete need to omit short-lived input values from state and plan artifacts and obtain runtime-only data through an ephemeral provider operation. Neither is the directly designated method for the separate goals of omit short-lived input values from state and plan artifacts and obtain runtime-only data through an ephemeral provider operation in this review.
C:The second measure does meet the obtain runtime-only data through an ephemeral provider operation requirement, but the first is designed for another concern: Removing a line from code does not revoke already exposed tokens; credential rotation and cleanup of historical artifacts are separate security steps; this behavior should be assessed against the concrete need to omit short-lived input values from state and plan artifacts and obtain runtime-only data through an ephemeral provider operation. That first component is designed to reduce risk when secrets were written to state or repository history, which does not accomplish the requested task to omit short-lived input values from state and plan artifacts, even though the other measure satisfies obtain runtime-only data through an ephemeral provider operation.
D:The first measure meets the requirement to omit short-lived input values from state and plan artifacts, but its partner serves a different role: Input files can contain plaintext and are often copied to laptops and CI systems; store sensitive values in a managed secret store or protected execution environment instead; this behavior should be assessed against the concrete need to omit short-lived input values from state and plan artifacts and obtain runtime-only data through an ephemeral provider operation. That second component is designed to prevent credentials from entering source history, so the still-missing criterion is to obtain runtime-only data through an ephemeral provider operation, while the first criterion remains omit short-lived input values from state and plan artifacts.