nerdexam
HashiCorp

TA-002-P · Question #56

When does terraform apply reflect changes in the cloud environment?

The correct answer is E. None of the above. Terraform applies changes to the cloud environment when the resource provider successfully fulfills the provisioning requests, which is a process that takes variable amounts of time.

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

When does terraform apply reflect changes in the cloud environment?

Options

  • AImmediately
  • BHowever long it takes the resource provider to fulfill the request
  • CAfter updating the state file
  • DBased on the value provided to the -refresh command line argument
  • ENone of the above

How the community answered

(19 responses)
  • A
    5% (1)
  • B
    11% (2)
  • E
    84% (16)

Why each option

Terraform applies changes to the cloud environment when the resource provider successfully fulfills the provisioning requests, which is a process that takes variable amounts of time.

AImmediately

Changes are rarely `Immediately` reflected in cloud environments as provisioning operations typically involve network latency and processing time by the cloud provider.

BHowever long it takes the resource provider to fulfill the request

While changes are reflected after the resource provider fulfills the request, this option can be considered insufficient because Terraform often waits for resources to reach a stable, desired state, which might be a longer process than just the initial request fulfillment.

CAfter updating the state file

The state file is updated *after* Terraform has confirmed the changes are reflected and stable in the cloud environment, not as the trigger for the changes themselves.

DBased on the value provided to the -refresh command line argument

The `-refresh` command-line argument causes Terraform to re-read the current state of resources from the cloud, but it does not directly cause or reflect *changes* initiated by `terraform apply` in the cloud.

ENone of the aboveCorrect

None of the provided options accurately or fully capture when `terraform apply` reflects changes in the cloud environment, as it depends on the asynchronous completion of actions by the cloud provider, which can involve waiting for resources to transition to a desired stable state beyond mere immediate fulfillment.

Concept tested: Terraform apply lifecycle and resource provisioning

Source: https://developer.hashicorp.com/terraform/cli/commands/apply

Topics

#terraform apply#resource provisioning#cloud provider interaction#Terraform lifecycle

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice