Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 56


When does terraform apply reflect changes in the cloud environment?

Show Answer
Correct Answer: B

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.

Discussion

17 comments
Sign in to comment
NunyabiznesOption: B
Mar 20, 2023

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.

liuyomz
Apr 24, 2024

yeah, B is not exactly correct, but the best one.

vitasacOption: B
May 3, 2022

B for sure

foreverlearnerOption: B
Jul 6, 2023

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

Ipergorta
Apr 30, 2022

Why no B?

temp111Option: B
May 6, 2022

I think, the answer is B.

nhatneOption: C
Jul 10, 2022

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.

InformationOverloadOption: B
Jan 2, 2023

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

Chaks1985Option: C
Jan 6, 2023

Ans: C ("WHEN" is key in this question. Its not asking how long will it take but "WHEN"

Ni33Option: B
May 9, 2023

BBBBBBBBBBB

zanhsiehOption: B
May 10, 2023

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.

AzureGurlOption: B
Jun 7, 2022

B is the correct answer.

Zam88Option: B
Jun 19, 2022

B is correct

EltoothOption: B
Jul 6, 2022

B is correct answer.

RVivekOption: C
Sep 23, 2022

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

pas77
Nov 6, 2022

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.

faltu1985Option: B
Sep 26, 2022

B for sure

Nightducky
Oct 13, 2022

Why B? You have "when" not "how long" in the question.

FarziWaliMarzi
Dec 23, 2022

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.

Power123Option: B
Mar 30, 2023

B is the correct ans