You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
I would love to see the Packer HCL2 syntax support the strcontains function similar to what is currently supported over in Terraform. This function is a really nice quick helper to do a contains comparison.
Use Case(s)
The primary use case is writing conditionals that depend on if a string is within another. For example if the source_ami name contains "test" or not.
I see you had a chat with @apparentlymart over on CTY, he pretty much nailed it; I don't think we want to deal with potential legal issues between licenses, so do feel free to adapt Terraform's code for the function in Packer itself, no need to upstream that in a MIT project, even if it seems the better option from a technical standpoint, I don't want us to get dragged into a legal argument.
I can probably do it also later this week, your call ultimately, but if you do implement it, I'll make sure to review the PR ASAP, thanks!
Community Note
Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.
Description
I would love to see the Packer HCL2 syntax support the
strcontains
function similar to what is currently supported over in Terraform. This function is a really nice quick helper to do a contains comparison.Use Case(s)
The primary use case is writing conditionals that depend on if a string is within another. For example if the source_ami name contains "test" or not.
Potential configuration
Potential References
https://developer.hashicorp.com/terraform/language/functions/strcontains
The text was updated successfully, but these errors were encountered: