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

Input walk improperly triggering errors on some computed resource attribute references #2987

Closed
phinze opened this issue Aug 12, 2015 · 1 comment · Fixed by #2988
Closed

Comments

@phinze
Copy link
Contributor

phinze commented Aug 12, 2015

This is a generalized problem during the "input walk" where Terraform searches for variables needing user input, but it's expressed by the following scenario:

Given:

# main.tf
resource "aws_instance" "foo" { }
resource "aws_instance" "bar" { }

module "child" {
  source = "./child"
  in = "one,${aws_instance.foo.id},${aws_instance.bar.id}"
}
# ./child/main.tf
variable "in" {}

resource "aws_instance" "mod" {
  value = "${var.in}"
}

Where aws_instance.foo and aws_instance.mod exist, but aws_instance.bar does not, a terraform plan will result in the following error:

1 error(s) occurred:

                * Resource 'aws_instance.bar' does not have attribute 'id' for variable 'aws_instance.bar.id'

We just need to add walkInput to the list of operations that can tolerate a computed resource attribute.

@ghost
Copy link

ghost commented Apr 30, 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 Apr 30, 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.

1 participant