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

Bad output value silently ignored #5334

Closed
brainsik opened this issue Feb 25, 2016 · 9 comments
Closed

Bad output value silently ignored #5334

brainsik opened this issue Feb 25, 2016 · 9 comments
Assignees

Comments

@brainsik
Copy link

Naïvely one might expect to be able to use a list as an output (instead of the required string). Doing this produces no error:

output "subnets" {
    value = "${aws_subnet.example.*}"
}

Nor this:

output "subnets" {
    value = "${join(",", aws_subnet.example.*)}"
}

Nor this:

output "subnets" {
    value = "${aws_vpc.example.this-no-exist}"
}

Basically, you end up stumbling around confused why your output isn't showing up. It would be great to get some sort of error message instead of silently dropping the output.

Appears related to #4369.

@eedwardsdisco
Copy link

I also got bit by this one.

Out of curiosity, why does your second example fail?

I've successfully used the following, the variable is a list:

output "name_servers" {
    value = "${join(",", aws_route53_zone.domain.name_servers)}"
}

@brainsik
Copy link
Author

The second one fails because it's not specifying a field to return. Should be something like aws_subnet.example.*.id to return a list of IDs (that are then converted into a comma separated string).

@eedwardsdisco
Copy link

Ah, that's clear now, thanks!

@jen20
Copy link
Contributor

jen20 commented Mar 3, 2016

Thanks for reporting this - I agree this should give an error rather than silently dropping the output.

@jen20 jen20 self-assigned this Mar 4, 2016
jen20 added a commit that referenced this issue Mar 4, 2016
Currently outputs with bad interpolation paths are silently ignored at
plan and apply, rather than giving an error message. This (currently
failing) test reproduces that.
@wr0ngway
Copy link

wr0ngway commented Jul 1, 2016

This also happens for bad interpolation function calls, e.g. passing the wrong type or number of args to a interpolation function, e.g. compact("x", "y")

@mitchellh
Copy link
Contributor

This is actually tracked as "core+bug" issue #4975. I'm centralizing there!

@rhettg
Copy link

rhettg commented Dec 7, 2016

@mitchellh you centralized #4975 to this issue, forming a frustrating cycle.

Is there a more canonical issue that could be linked?

@mitchellh
Copy link
Contributor

Oh Hah. I made a mistake, #9080 is the open one.

@ghost
Copy link

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

6 participants