Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform_remote_state output unavailable for module during destroy phase #2766

Closed
radeksimko opened this issue Jul 17, 2015 · 1 comment · Fixed by #2775
Closed

terraform_remote_state output unavailable for module during destroy phase #2766

radeksimko opened this issue Jul 17, 2015 · 1 comment · Fixed by #2775
Assignees

Comments

@radeksimko
Copy link
Member

Steps to reproduce:

shared/main.tf

output "env_name" {
  value = "test"
}
$ terraform remote config -backend=S3 -backend-config="bucket=terraform-test-bucket" -backend-config="key=terraform.tfstate" -backend-config="region=us-east-1"
$ terraform apply

my_module/main.tf

variable "environment" {}

example.tf

resource "terraform_remote_state" "shared" {
  backend = "s3"

  config {
    bucket = "terraform-test-bucket"
    key = "terraform.tfstate"
    region = "us-east-1"
  }
}

module "example" {
  source = "./my_module/"
  environment = "${terraform_remote_state.shared.output.env_name}"
}
$ terraform apply # OK
$ terraform destroy
Error applying plan:

1 error(s) occurred:

* Resource 'terraform_remote_state.shared' does not have attribute 'output.env_name' for variable 'terraform_remote_state.shared.output.env_name'
@ghost
Copy link

ghost commented May 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants