-
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
config: Add support for lists to concat #1790
Conversation
Thanks! So we talked about this during our PR review Hangout and we decided that a better name for this would be Because of that, I think what we should do is actually rename this to To deprecate things further, I think we should jus remove And one day we can put a warning in there. |
e5d0897
to
213331a
Compare
@mitchellh Changed as requested. I also had to deal with cases like string+list - that can be an error or simply a list (i.e. string being one of the members of a new list). I decided to convert that into a list, but I'm open for suggestions. |
I can verify that this solves my use case in #2113 |
@radeksimko @mitchellh Any hope of getting this merged? I still have a use for it. Thanks. |
@rubbish heh, me too! making my way down the PRs for 0.6 but will pick this one up next for ya. |
LGTM - merging and I'll document the breaking change. |
config: Add support for lists to concat
Thanks @phinze @radeksimko |
Sorry, wanted to confirm that this means that the previous functionality of merging strings has been removed from concat? Is there a new alternative? |
|
Ok. So, just upgraded to 0.7 and I can't figure out how to get this to work without concat: WHERE aws_region, setup_level, and system_version are all strings. This worked in 0.6X. Perhaps I'm just being dense... |
Yep. Just being dense. figured it out. |
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. |
The original intention was to satisfy @EvanKrall in this comment: #1495 (comment)
but it turns out that lists are generally not a good idea for these cases as there's no way to uniquely identify each member of the list => when any member of the array is changed, many others will be changed too, because unique ID =
module.dns.dnsimple_record.foo.0
where0
is not unique identifier and resource with that ID will change when you may not expect it to be changed.In case of DNS records, it's a problem, because it will iterate over these resources
0..5
and try adding records that are already there.It will only work well when changing/removing members from the end of the final list.
Support for maps in variables +
zip(keys, vals)
would be probably the way forward for case like this one.So to sum it up, it probably won't solve that particular example, but I was thinking it may be useful elsewhere.
Example