Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

be-any-of Pattern Issue #113

@y-matsutomo

Description

@y-matsutomo

Description of the bug

be-any-of constraint in HCL does not recognize the strings properly.

Steps to Reproduce

target code

resource "google_container_cluster" "bad_example" {
  logging_service = "none"
}

rule

version: '1'
rules:
  - id: 'example'
    title: example
    language: hcl
    patterns:
      - pattern: |
          resource  "google_container_cluster" :[NAME] {
            example_service = :[SETTINGS]
          }
        constraints:
          - target: SETTINGS
            should: be-any-of 
            strings:
              - "none"
              - "example.com"
    rewrite: |
      resource "google_container_cluster" :[NAME] {
        example_service = "example-service"
      }

Expected Behaviour

The pattern should match but it does not.

Additional Materials

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions