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
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 acountvariable. - 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
Community Discussion
No community discussion yet for this question.