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

outputting maps not working #8384

Closed
rbuels opened this issue Aug 22, 2016 · 4 comments
Closed

outputting maps not working #8384

rbuels opened this issue Aug 22, 2016 · 4 comments

Comments

@rbuels
Copy link

rbuels commented Aug 22, 2016

Terraform Version

0.7.0

Affected Resource(s)

Please list the resources as a list, for example:

  • output

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

output "test_map" {
    value = {
        foo = "bar"
    }
}

Debug Output

https://gist.github.com/rbuels/2832e49a256199f857037fda3a2b58ed

Expected Behavior

Terraform plan should at least have run without error

Actual Behavior

Terraform plan emitted the error: output test_map is not a valid type ([]map[string]interface {})'

Steps to Reproduce

  1. Make a file with a map output, as shown above.
  2. Run terraform plan on it.

References

Wasn't support for this supposed to be added by #5841?
#5841

@catsby catsby added the core label Aug 22, 2016
@rcha86
Copy link

rcha86 commented Aug 23, 2016

Also seeing this problem. What is the correct syntax/formatting for this?

@rcha86
Copy link

rcha86 commented Aug 25, 2016

After digging around some more, I figured out how to create maps in output. You have to use the map function. See here

output "test-map" { 
  value = "${map(
    "test-value-1", "map-value-1"
    "test-value-2", "map-value-2"
  )}"
}

However, terraform still does not support nested maps. #2114

@jbardin
Copy link
Member

jbardin commented Oct 13, 2016

Closed via #9268

@ghost
Copy link

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