You can access state stored with the local backend by using the terraform_remote_state data source.

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

You can access state stored with the local backend by using the terraform_remote_state data source.

Explanation:
The main idea is that the terraform_remote_state data source is designed to read outputs from another Terraform state file, wherever that state is stored. That means you’re not limited to remote backends—you can read from a local state as well if you configure it to point at the local state file. So, if one configuration stores its state locally on disk, you can still access its outputs from another configuration by using terraform_remote_state and directing it to that local state file (for example, by using a local backend configuration that points to the path of the local terraform.tfstate). This lets you reuse values produced in one configuration, such as IDs or other outputs, in another configuration without duplicating logic. In short, you can access state stored with the local backend through the terraform_remote_state data source, which is why the statement is true.

The main idea is that the terraform_remote_state data source is designed to read outputs from another Terraform state file, wherever that state is stored. That means you’re not limited to remote backends—you can read from a local state as well if you configure it to point at the local state file.

So, if one configuration stores its state locally on disk, you can still access its outputs from another configuration by using terraform_remote_state and directing it to that local state file (for example, by using a local backend configuration that points to the path of the local terraform.tfstate). This lets you reuse values produced in one configuration, such as IDs or other outputs, in another configuration without duplicating logic.

In short, you can access state stored with the local backend through the terraform_remote_state data source, which is why the statement is true.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy