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

Implement matchkeys interpolation function #13847

Merged
merged 2 commits into from
Apr 21, 2017
Merged

Implement matchkeys interpolation function #13847

merged 2 commits into from
Apr 21, 2017

Conversation

alvelcom
Copy link
Contributor

This is a followup for #12389. The PR implements matchkeys function:

matchkeys(values, keys, searchset) - For two lists values and keys of equal length, returns all elements from values where the corresponding element from keys exists in the searchset list. For example

matchkeys(aws_instance.example.*.id, 
          aws_instance.example.*.availability_zone,
          list("us-west-2a"))

will return a list of the instance IDs of the aws_instance.example instances in "us-west-2a". No match will result in empty list. Items of keys are processed sequentially, so the order of returned values is preserved.

- rename function to matchkeys
- take a list strings instead of a string as a last argument
- be able handle complex arguments as values
@apparentlymart apparentlymart merged commit f9fb601 into hashicorp:master Apr 21, 2017
@ghost
Copy link

ghost commented Apr 13, 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 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants