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

formatlist() should be able to take empty list but cant #9908

Closed
gtmtech opened this issue Nov 7, 2016 · 2 comments
Closed

formatlist() should be able to take empty list but cant #9908

gtmtech opened this issue Nov 7, 2016 · 2 comments

Comments

@gtmtech
Copy link

gtmtech commented Nov 7, 2016

terraform 0.7.5

formatlist(string, list) should be able to take an empty list. The functionality in this case should be obvious, it outputs an empty list.

Instead, it prints this error:

template = "${join(",", formatlist("example%s", list()))}"

* formatlist: no lists in arguments to formatlist in:

${join(",", formatlist("example%s", list()))}

This really shouldn't be an error, there is no reason why it shouldn't be able to cope with this just fine. I've worked up this example for you, but the real usecase is using aws_instance.example.*.private_ip, as the list parameter to a formatlist when the count of the example aws_instance is 0. Terraform should cope with this just fine, and doesnt >.<

@stack72
Copy link
Contributor

stack72 commented Nov 7, 2016

Hi @gtmtech

Thanks for the request here - this was added in #9795 which was part of the 0.7.8 release

Thanks

Paul

@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

2 participants