Skip to content

google_compute_security_policy - no error message when rule has same priority #5804

@valtos

Description

@valtos

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 me too comments, 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.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.12.18

Affected Resource(s)

  • google_compute_security_policy

Terraform Configuration Files

  project = my_project_id

  name = "my-policy"

  rule {
    action   = "allow"
    priority = "1000"
    match {
      expr {
        expression = "inIpRange(origin.ip, 'my_first_ip/32') && request.path.startsWith('/admin')"
      }
    }
    description = "a"
  }

  rule {
    action   = "allow"
    priority = "1000"
    match {
      expr {
        expression = "inIpRange(origin.ip, 'my_second_ip/32') && request.path.startsWith('/')"
      }
    }
    description = "b"
  }

  rule {
    action   = "deny(404)"
    priority = "9999"
    match {
      versioned_expr = "SRC_IPS_V1"
      config {
        src_ip_ranges = ["*"]
      }
    }
    description = "default rule : deny all"
  }

}

Debug Output

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Expected Behavior

Well it should have indicates that two rules with same priority isn't possible, and indicate the rule that didn't create

Actual Behavior

"Apply complete!" No error messages, looks like everything is ok with terraform apply ! => but in google console, only one rule was created

Steps to Reproduce

  1. Create a security policy with 2 rules with the same priority
  2. terraform apply

Important Factoids

This error happen with the security policy using the custom rules:
https://cloud.google.com/armor/docs/rules-language-reference

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions