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

Please add support to alltrue function #13073

Closed
luckeyca opened this issue Jun 25, 2024 · 1 comment · Fixed by #13237
Closed

Please add support to alltrue function #13073

luckeyca opened this issue Jun 25, 2024 · 1 comment · Fixed by #13237

Comments

@luckeyca
Copy link

Community Note

  • 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

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

In HCL2 syntax template, please support alltrue function

Use Case(s)

This is the same as in terraform to be used for variable validation.

Potential configuration

  validation {
    condition = alltrue([for k, v in var.base_image_filter :
      (k == "base_image_compartment_id" && startswith(v, "ocid1.tenancy.oc1..")) ||
      (k == "operating_system" && contains(["Canonical Ubuntu", "Oracle Linux", "Windows"], v)) ||
      (k == "operating_system_version" && contains(["22.04", "8", "9", "Server 2019 Standard", "Server 2022 Standard"], v)) ||
      (k == "display_name_search" && can(regex("^Canonical-Ubuntu-22\\.04-2[0-9][0-9][0-9]\\.\\d+", v))) ||
      (k == "display_name_search" && can(regex("^Oracle-Linux-8\\.\\d-2[0-9][0-9][0-9]\\.\\d+", v))) ||
      (k == "display_name_search" && can(regex("^Oracle-Linux-9\\.\\d-2[0-9][0-9][0-9]\\.\\d+", v))) ||
      (k == "display_name_search" && can(regex("^Windows-Server-2019-Standard-Edition-VM-2[0-9][0-9][0-9]\\.\\d+", v))) ||
      (k == "display_name_search" && can(regex("^Windows-Server-2022-Standard-Edition-VM-2[0-9][0-9][0-9]\\.\\d+", v)))
    ])
    error_message = "Source image search criteria must have the correct keys and values. See base_image_filter variable definition for details."
  }

Potential References

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants