HashiCorp Terraform IaC Practice Test 2025 – Your Comprehensive All-in-One Guide to Master Infrastructure as Code!

Question: 1 / 400

What is the effect of the 'terraform taint' command?

It displays the current state of all resources

It marks a resource for recreation during the next apply

The 'terraform taint' command is used to mark a resource so that Terraform knows it should be recreated during the next apply operation. This is particularly useful when you suspect that the resource is in a bad state or if changes have occurred externally that are not reflected in the Terraform state.

When you taint a resource, Terraform will treat it as needing replacement the next time you run the apply command. This means that upon execution, Terraform will destroy the current instance of that resource and create a new one according to the specified configuration.

This capability is powerful for managing infrastructure as it allows for recovery from issues that might arise with resources, ensuring that they are in an optimal state as defined by the latest configuration.

The other choices relate to different functions that Terraform performs but do not align with the specific purpose of the taint command. For instance, displaying the current state, importing resources, or outputting a dependency graph are all distinct operations serving different needs in the infrastructure management workflow.

Get further explanation with Examzify DeepDiveBeta

It imports an existing resource into the state file

It outputs the dependency graph

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy