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

Greatly increased plan time between 2.53.1 and 3.0.2 when used with time_rotating #1611

Open
katbyte opened this issue Jan 7, 2025 · 1 comment

Comments

@katbyte
Copy link
Collaborator

katbyte commented Jan 7, 2025

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritise this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritise the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureAD Provider) Version

3.0.2

Affected Resource(s)

  • azuread_application_password

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

Panic Output

Expected Behavior

no significant change in plan time when updating from 2.x to 3.x

Actual Behavior

When trying to delete ~2000 resources mostly azuread_application_password combined with time_rotating the time that takes to produce the plan is greatly increased. The provider is producing rows for each element that has stored dependency for each element of the other resource. there are 5 times more rows with version 3.0.2 compared to 2.53.1 and DestroyEdgeTransformer appears 700 000+ times while in the log with 2.53.1 only 4 times.

this led to an increase of over 2.5 hours

Steps to Reproduce

terraform {
  required_providers {
    azuread = {
      # version = "2.53.1"
      version = "3.0.2"
    }
  }
}

provider "azuread" {
  use_cli = true
}

resource "azuread_application_registration" "example" {
  for_each    = local.test_map
  display_name = each.key
}

resource "time_rotating" "example" {
  for_each      = local.test_map
  rotation_days = 7
}

resource "azuread_application_password" "example" {
  for_each           = local.test_map
  application_id     = azuread_application_registration.example[each.key].id
  rotate_when_changed = {
    rotation = time_rotating.example[each.key].id
  }
  # depends_on = [
  #   time_rotating.example[each.key]
  # ]
}

locals {
  test_map = { for i in range(1, 1001) : "test${i}" => "test${i}" }
  # test_map = { for i in range(1, 201) : "test${i}" => "test${i}" }
}

resource "null_resource" "test" {}
  1. terraform apply

Important Factoids

References

  • #0000
@katbyte
Copy link
Collaborator Author

katbyte commented Jan 8, 2025

this tool might be useful to benchmarking: https://github.com/magodo/pipeform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant