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

dependency resolution broken #1540

Closed
MerlinDMC opened this issue Apr 15, 2015 · 2 comments · Fixed by #1587
Closed

dependency resolution broken #1540

MerlinDMC opened this issue Apr 15, 2015 · 2 comments · Fixed by #1587
Assignees

Comments

@MerlinDMC
Copy link
Contributor

Given the following config:

resource "null_resource" "foo" {
  count = 2
  provisioner "local-exec" {
    command = "echo ${null_resource.foo.1.id}"
  }
}

Expected order of creation would be:

  • null_resource.foo.1
  • null_resource.foo.0

Current computed order is:

  • null_resource.foo.0
  • null_resource.foo.1

(it creates both resources in parallel)

which makes it fail during the provisioning step:

null_resource.foo.0: Creating...
null_resource.foo.1: Creating...
null_resource.foo.0: Error: 1 error(s) occurred:

* Resource 'null_resource.foo.1' not found for variable 'null_resource.foo.1.id'
null_resource.foo.1: Provisioning with 'local-exec'...
null_resource.foo.1 (local-exec): Executing: /bin/sh -c "echo 3030871191733529834"
null_resource.foo.1 (local-exec): 3030871191733529834
null_resource.foo.1: Creation complete
Error applying plan:

1 error(s) occurred:

* 1 error(s) occurred:

* 1 error(s) occurred:

* Resource 'null_resource.foo.1' not found for variable 'null_resource.foo.1.id'

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
@mitchellh
Copy link
Contributor

This is indeed a problem. Thanks. Tagged.

@ghost
Copy link

ghost commented May 3, 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 3, 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