Which action does not affect the Terraform state?

Prepare for the HashiCorp Terraform Associate Exam. Utilize flashcards and multiple-choice questions with detailed hints and explanations. Boost your confidence and be ready for success!

Multiple Choice

Which action does not affect the Terraform state?

Explanation:
Formatting the configuration is the action that never touches Terraform’s state. The state is a record of the real infrastructure Terraform manages, stored in a state file. Running the formatting command only adjusts the text in your configuration files, not any resources, and it does not read or write the state. It doesn’t interact with providers, plans, or resource changes, so the state remains exactly as it is. In contrast, adding a new resource updates the state to include that resource, changing or updating attributes in the config leads to planned and applied changes that modify the state, and running a plan only shows what would change without actually applying anything to reach that desired state.

Formatting the configuration is the action that never touches Terraform’s state. The state is a record of the real infrastructure Terraform manages, stored in a state file. Running the formatting command only adjusts the text in your configuration files, not any resources, and it does not read or write the state. It doesn’t interact with providers, plans, or resource changes, so the state remains exactly as it is. In contrast, adding a new resource updates the state to include that resource, changing or updating attributes in the config leads to planned and applied changes that modify the state, and running a plan only shows what would change without actually applying anything to reach that desired state.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy