This issue was originally opened by @kitforbes as hashicorp/terraform#16029. It was migrated here as a result of the provider split. The original body of the issue is below.
data "terraform_remote_state" "network" {
backend = "s3"
config {
region = "${var.remote_state["bucket_region"]}"
bucket = "${var.remote_state["bucket_name"]}"
key = "${var.environment}/${var.region}/network.tfstate"
}
}
# Spit out the value to check your sanity
output "test" {
value = "${data.terraform_remote_state.network.environment}"
}
Expected Behavior
The map should be displayed in the console as
test = {
name = Trevor
code = 42
}
Actual Behavior
test = default
Steps to Reproduce
Create a Terraform state file with the above output
Reference the terraform_remote_state in another Terraform configuration
Try to access the data.terraform_remote_state.network.environment as a map
Important Factoids
After investigating this, it turns out that Terraform includes an variable called environment. There is no warning that you can not create an additional variable of the same name.
This issue was originally opened by @kitforbes as hashicorp/terraform#16029. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform Configuration Files
Creating the object in Output of a state:
Consuming the object in another state:
Expected Behavior
The map should be displayed in the console as
Actual Behavior
Steps to Reproduce
terraform_remote_state
in another Terraform configurationdata.terraform_remote_state.network.environment
as a mapImportant Factoids
After investigating this, it turns out that Terraform includes an variable called
environment
. There is no warning that you can not create an additional variable of the same name.From the remote state file:
Attempting the same with user defined outputs of the same name results in an error.