When does terraform apply reflect changes in the cloud environment?
When does terraform apply reflect changes in the cloud environment?
Terraform apply reflects changes in the cloud environment as soon as the resource provider fulfills the request. This process involves Terraform submitting the change requests to the resource provider, and the time it takes can vary depending on the resources being modified. Therefore, the correct answer is that the changes are reflected based on however long it takes the resource provider to fulfill the request.
When you execute terraform apply, Terraform creates a new execution plan by comparing the current state file to the desired state declared in the configuration. After creating the execution plan, Terraform presents the proposed changes and asks for confirmation to apply them. Once you confirm the changes, Terraform updates the state file with the new state reflecting the changes that were made. Terraform then submits the change requests to the resource provider to make the desired changes in the cloud environment. The amount of time it takes for the resource provider to fulfill the requests can vary depending on the resources being modified.
yeah, B is not exactly correct, but the best one.
B for sure
From https://developer.hashicorp.com/terraform/tutorials/cli/apply When you apply this configuration, Terraform will: 1) Lock your project's state 2) Create a plan, and wait for you to approve it. 3) Execute the steps defined in the plan using the providers you installed when you initialized your configuration. Terraform executes steps in parallel when possible, and sequentially when one resource depends on another. 4) Update your project's state file with a snapshot of the current state of your resources. 5) Unlock the state file. 6) Print out a report of the changes it made, as well as any output values defined in your configuration. Changes in the cloud environment are made on step 3, before updating the state file
Why no B?
I think, the answer is B.
I vote for B. The difference between B and C is that we have to count on timeout cases in the real world, e.g. provision GCP DataProc cluster, MongoDB Atlas, etc. It's possible the provisioner timeout but the provider keeps going till the job finish. In this case the local terraform state file does not sync with the physical infra - terraform did try to update but timeout. Then we run `terraform apply` again and the state file reconciles with the physical infra.
BBBBBBBBBBB
Ans: C ("WHEN" is key in this question. Its not asking how long will it take but "WHEN"
If you are creating a new virtual machine using Terraform, it may take a few minutes for the virtual machine to be created and for it to become available for use. During this time, Terraform will continue to report on the progress of the creation process and will display any errors or issues that may arise. Once the virtual machine has been successfully created, the changes will be reflected in your cloud environment. I go with B
I vote C because the question is "When" and from the docs: Terraform plan and apply operations run an implicit in-memory refresh as part of their functionality, reconciling any drift from your state file before suggesting infrastructure changes.
B is the correct ans
Given it has more than 4 options, I think it should have multiple valid answers, and hence both B & C should be selected. Again, this is assumption based as this is missing in question.
B for sure
Why B? You have "when" not "how long" in the question.
When does terraform apply reflect changes in the cloud environment? Terraform will apply chnages to the cloud, then it will update the state file. After it updates the statefile only it "reflects" those changes to the screen
This is not what the question is asking. The question is not asking when it will reflect the changes in the "screen". It is asking when it will reflect the changes in the "cloud environment". And this will be whenever it finishes deploying the resources. "B" is the correct answer for sure.
B is correct answer.
B is correct
B is the correct answer.