-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Unable to use output variable as list #8048
Comments
Hi @nusnewob! Thank you for the detailed description - I can reproduce this from the configuration you gave. I'll be working on a reduction and fix for this over the course of today. |
Any updates on this issue? |
Workaround: "serialize" to string and then "deserialize"
|
If you change the output to a
|
I have problems with this too even in terraform v0.8. If I output a literal list as in @fmasuhr example everything works fine, but if instead I use something like this:
then terraform doesn't seem to work in few places, example the |
I have the same problem with @jfromaniello. It says aws_elb.ELB: ValidationError: Only one of SubnetIds or AvailabilityZones may be specified. |
@jfromaniello are you interpolating length in a count? @osalkk the ELB validation error is separate - can you post the configuration for that resource? |
Hi @jen20. Thanks in advance. This is the output: and the result for the output : When I use it for my elb module it says "aws_elb.ELB: ValidationError: Only one of SubnetIds or AvailabilityZones may be specified." resource "aws_elb" "ELB" { name = "${var.name}" Ok I found it, I was using both availability_zones and subnets. By removing availability_zones ( which is only used for ec2-classic elb ) it is resolved. |
I'm also currently experiencing this problem with Terraform v0.8.5. Although I'm also seeing this behaviour even when implicitly attempting to create a list from several outputs. Take for example the following outputs:
And then creating a list of these outputs:
Which eventually fails with:
If I change those output definitions to refer to the modules input variables for instance, or some fixed string, etc, they work without issue. It's only a problem when they refer to the resource outputs. |
I believe this has been fixed ( |
I am using v 0.8.7, have set the time and passing brackets - and have the same issue. |
@tomdavidson Have you tried to wrap all places where your list used with brackets? I had a similar problem and I managed to solve it by adding brackets in all below:
I am using |
@gruzewski my problem ended up related to hashicorp/hil#50 - HIL evaluates both branches of a condition. |
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. |
Terraform Version
Terraform v0.7.0
Affected Resource(s)
Terraform Configuration Files
main.tf
or
modules/test/module.tf
Debug Output
https://gist.github.com/nusnewob/b3230d0d83c40917516a068b3532092f
Expected Behavior
Should be able to pass the module output as list variable
Actual Behavior
Steps to Reproduce
terraform apply
orterraform plan
The text was updated successfully, but these errors were encountered: