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

google_compute_security_policy all rules getting recreated #8251

Closed
Assignees
Labels

Comments

@Sreerag74031
Copy link

While trying to add a new rule to an existing security policy, terraform plan shows all rules will be recreated. Is this an expected behaviour?

@venkykuberan
Copy link
Contributor

@Sreerag74031 can you please share your config & plan output to understand what's going on ?

@mrkaleslie
Copy link

mrkaleslie commented Jan 31, 2021

@Sreerag74031 i am getting a similar issue when i add a new rule, existing rules show they want to recreate

-     - rule {
-         - action      = "allow" -> null
-         - description = "description" -> null
-         - preview     = false -> null
-         - priority    = 100 -> null

-         - match {
-             - versioned_expr = "SRC_IPS_V1" -> null

-             - config {
-                 - src_ip_ranges = [
-                     - "x.x.x.x",
                    ] -> null
                }
            }
        }
+     + rule {
+         + action      = "allow"
+         + description = "description"
+         + priority    = 100

+         + match {
+             + versioned_expr = "SRC_IPS_V1"

+             + config {
+                 + src_ip_ranges = [
+                     + "x.x.x.x.x",
                    ]
                }
            }
        }

I found i was able to get around the issue by explicitly specifying preview = false


however in this example i am still seeing a false positive

-     - rule {
-         - action      = "allow" -> null
-         - description = "description" -> null
-         - preview     = false -> null
-         - priority    = 100 -> null

-         - match {

-             - expr {
-                 - expression = "request.path.matches('/some/path/')" -> null
               }
            }
        }
+     + rule {
+         + action      = "allow"
+         + description = "description"
+         + preview     = false
+         + priority    = 100
+         + match {

+             + expr {
+                 + expression = "request.path.matches('/some/path/')"
                }
            }
        }

@ghost ghost removed waiting-response labels Jan 31, 2021
@Sreerag74031
Copy link
Author

@mrkaleslie thanks, i think the preview option fixed the issue.

@mrkaleslie
Copy link

Hi @Sreerag74031 would you be able to reopen this issue, although there is a work around i don't think it constitutes as a fix

@Sreerag74031
Copy link
Author

Rule recreate issue for match -> config was resolved with including preview option, however for match -> expr the recreate issue is still there.
reopening the issue for rule match -> expr

@melinath
Copy link
Collaborator

melinath commented Feb 8, 2021

🤦 accidentally triggered linking between that PR and this ticket. @mrkaleslie to make things easier & because there's a different underlying cause, could you open a new issue for the false positive case you mentioned? Please @ me on it so I can claim it. :-) Thanks!

@ghost
Copy link

ghost commented Mar 11, 2021

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.