Terraform

Is there a way to obtain information from a remote backend/state using Terraform?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

Yes, using the concept of data sources. There is a data source for a remote state called "terraform_remote_state".

You can use it the following syntax data.terraform_remote_state..outputs.