Terraform Associate Practice Exam

Question: 1 / 400

You just scaled your VM infrastructure and realized you set the count variable to the wrong value. You correct the value and save your change. What do you do next to make your infrastructure match your configuration?

Run a refresh and check for differences

Run an apply and confirm the planned changes

When correcting the count variable in your Terraform configuration, the next step is to run an apply. This action instructs Terraform to reconcile the actual state of your infrastructure with the desired state defined in your configuration files. By running an apply, Terraform will create or destroy the virtual machines as necessary to match the updated count variable.

During the apply process, Terraform will present a plan detailing the changes that will be made, allowing you to confirm that the updates align with your expectations before proceeding. This step is crucial because it ensures you are aware of the modifications that will occur and provides an opportunity to vet the planned actions before implementation.

Running a refresh would only update the state file with the current state but would not apply any changes based on the new count value. Deploying a new environment may be unnecessary since the goal is to adjust the existing infrastructure, and restarting the Terraform service does not affect the state of the resources you manage. Thus, applying the changes is the appropriate approach in this scenario.

Get further explanation with Examzify DeepDiveBeta

Deploy a new environment to test

Restart the Terraform service

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy