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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

google_compute_security_policy very slow #18466

Open
fawaf opened this issue Jun 18, 2024 · 6 comments
Open

google_compute_security_policy very slow #18466

fawaf opened this issue Jun 18, 2024 · 6 comments

Comments

@fawaf
Copy link

fawaf commented Jun 18, 2024

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 a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v1.5.7
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v5.34.0
  • provider registry.terraform.io/hashicorp/http v3.4.3

Affected Resource(s)

google_compute_security_policy

Terraform Configuration

resource "google_compute_security_policy" "blah" {
  name        = "blahh-policy"
  description = "Security policy for"
  project     = 123456

  lifecycle {
    ignore_changes = [
      rule,
    ]
  }
}

Debug Output

https://gist.github.com/fawaf/c9fdfaa2a3a53cca043f1a036b3971b5

Expected Behavior

run to completion

Actual Behavior

hangs on pulling all rules

Steps to reproduce

  1. terraform apply

Important Factoids

this tf is run on an existing security policy that contains 2000 rules

References

No response

b/348530015

@fawaf fawaf added the bug label Jun 18, 2024
@github-actions github-actions bot added forward/review In review; remove label to forward service/compute-security-policy labels Jun 18, 2024
@ggtisc ggtisc self-assigned this Jun 20, 2024
@ggtisc
Copy link
Collaborator

ggtisc commented Jun 20, 2024

Hi @fawaf!

After some tries creating this simple resource the result was the same, successfully without errors and it never takes more than one min to be created, I suggest you to check external factors like your OS, RAM, Processor, Capacity of your server, available memory and other involved applications. Also if you are running a terraform apply and this involves more than this resource you could try to execute this resource alone.

@fawaf
Copy link
Author

fawaf commented Jun 20, 2024

oh, forgot to mention that the security policy itself contains 2000 rules already. basically, running tf on an and existing security policy causes this issue.

@fawaf
Copy link
Author

fawaf commented Jun 20, 2024

updated ticket description to reflect that.

@ggtisc
Copy link
Collaborator

ggtisc commented Jun 20, 2024

Well this is definitively the issue, you could decouple your policy in different rules if you want to have a faster creation or wait until it finishes.

@fawaf
Copy link
Author

fawaf commented Jun 21, 2024

it succeeded a few times before, but then just started hanging after a few usages. we also are running into a quota issue in that project. i'll report back once we get that solved.

@ggtisc
Copy link
Collaborator

ggtisc commented Jun 21, 2024

Yes, this is because you are overcharging the policy. For this reason it is a good practice to decouple your resources as much as possible when you work in cloud engineering. With this you ensure to have a clear code, it is easier to give maintenance, reuse your code (in this case if you need to reuse some policy rules) and avoid overcharge API calls.

In the end you could do that, but this increases the timeout.

@ggtisc ggtisc removed the forward/review In review; remove label to forward label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants