nerdexam
HashiCorpHashiCorp

TA-002-P · Question #86

TA-002-P Question #86: Real Exam Question with Answer & Explanation

The correct answer is D: Inspect all Terraform outputs to make sure they are correct. After correcting a configuration value, the next step to update the infrastructure is to run terraform apply. This command will first generate a plan of changes based on the updated configuration and then prompt for confirmation to execute those changes, aligning the infrastructu

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

Question

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?

Options

  • ARun an apply and confirm the planned changes
  • BInspect your Terraform state because you want to change it
  • CReinitialize because your configuration has changed
  • DInspect all Terraform outputs to make sure they are correct

Explanation

After correcting a configuration value, the next step to update the infrastructure is to run terraform apply. This command will first generate a plan of changes based on the updated configuration and then prompt for confirmation to execute those changes, aligning the infrastructure with the desired state.

Common mistakes.

  • B. Inspecting the Terraform state is usually done for debugging or advanced state manipulation, not as a primary step to apply configuration changes.
  • C. Reinitializing (terraform init) is only needed when providers, modules, or backend configurations are added or changed, not typically for simple value changes like a count variable.
  • D. Inspecting Terraform outputs is done to retrieve information about the deployed infrastructure, not to initiate or apply changes to it.

Concept tested. Applying configuration changes in Terraform

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

Topics

#Terraform CLI#Outputs#Configuration Changes#Verification

Community Discussion

No community discussion yet for this question.

Full TA-002-P PracticeBrowse All TA-002-P Questions