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

Outputted map does not contain all expected keys #9549

Closed
moio opened this issue Oct 24, 2016 · 6 comments
Closed

Outputted map does not contain all expected keys #9549

moio opened this issue Oct 24, 2016 · 6 comments

Comments

@moio
Copy link
Contributor

moio commented Oct 24, 2016

Terraform Version

Latest 0.7.8

Affected Resource(s)

Core issue. Reproduced with either:

Terraform Configuration Files

Please add proper AWS credentials in https://github.com/moio/terraform_output_map_issue_example/blob/master/main.tf#L2

Debug Output

https://gist.github.com/moio/2a980e348bccde29be8d13e47821e218

Expected Behavior

terraform_output_map_issue_example$ terraform plan
Refreshing Terraform state in-memory prior to plan...
...
+ module.base.aws_instance.example
...
+ module.extension.aws_instance.example

Plan: 2 to add, 0 to change, 0 to destroy

Actual Behavior

terraform_output_map_issue_example$ terraform plan
There are warnings and/or errors related to your configuration. Please
fix these before continuing.

Errors:

  * key "base_instance_id" does not exist in map var.configuration in:

Extension of ${var.configuration["base_instance_id"]}

Steps to Reproduce

  • clone repo above
  • add AWS credentials
  • terraform plan

Important Factoids

I am trying to use a variable from an output of a module in another module.

Note that this does work in case of literals (param1 in the sample).

Also note that this does work using the hacky interpolated map literal syntax.

References

@flypenguin
Copy link

this is a major blocker in my current efforts to automate our whole vpc setup and I went pretty much crazy debugging my system until I found this. any ideas of when this is fixed?

@flypenguin
Copy link

BTW #6524 is also applicable to this - the map contents get indented every time I (in that case my editor) uses fmt before saving. pretty annoying :)

@mitchellh
Copy link
Contributor

Fixed in master!

mitchellh added a commit that referenced this issue Nov 9, 2016
Fix for missing computed map entries disappearing
@moio
Copy link
Contributor Author

moio commented Nov 15, 2016

Thanks everybody, great job!

@moio
Copy link
Contributor Author

moio commented Nov 17, 2016

@mitchellh, @jbardin: JFYI while testing this I found several possibly related failures reported in #10187. Thanks again!

@ghost
Copy link

ghost commented Apr 20, 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 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants