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

v3.0.1 consuming huge amount of memory with pre-existing v.2.53.1 tfstate #1514

Open
javespru opened this issue Oct 3, 2024 · 4 comments
Open

Comments

@javespru
Copy link

javespru commented Oct 3, 2024

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

Affected Resource(s)

  • azuread_3.0.1
  • terraform 1.9.7

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

My terraform configuration files consist of 181 groups with an average of 30 users per group.
It worked ok with v.2.53.1 of the provider in a VM with 16 GB.

Debug Output

N/A

Panic Output

N/A

Expected Behavior

After upgrading to provider 3.0.1 I added up just 1 user to any group, run

  1. terraform init --upgrade
  2. terraform apply

And the user should be provisioned.

Actual Behavior

With my original VM where I ran previously (v.2.53.1) the given configuration I got a gRPC error related to lack of memory (I verified with the top command)
If I increase the VM RAM to 128 GB, it takes a while, but in the end, the VM's memory is exhausted.

Steps to Reproduce

Having a huge configuration of groups and users 180+, migrate the provider from v.2.53.1 to v.3.0.1

  1. terraform apply

Important Factoids

N/A

References

@javespru
Copy link
Author

javespru commented Oct 3, 2024

My provider file is case is relevant
_terraform {
required_version = ">= 1.5.1, <= 1.9.9"

required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.3"
}
azuread = {
source = "hashicorp/azuread"
version = "3.0.1"
}

}

backend "azurerm" {
subscription_id = "XXXXXX"
resource_group_name = "easa-comm-rgp-01-seed"
storage_account_name = "tfseedcom22uqwswrh"
container_name = "d4s-seed-common"
key = "d4s-infra/011-group-users.tfstate"
}

}

provider "azurerm" {
features {}
subscription_id = "XXXXXX"
resource_provider_registrations = "none"
}

provider "azuread" {
tenant_id = "YYYYYYYY"
}_

@javespru
Copy link
Author

javespru commented Oct 3, 2024

I tested with a fresh new tfstate v3.0.1 and 1 group with 2 users, and it exhausted 16 GB RAM

test.tf

resource "azuread_group" "group-test-01" {
  display_name = "delete-group-test-1212"

  security_enabled = true

  owners = ["27478bc9-e081-4144-9063-xxxx"]
  members = [
    "27478bc9-e081-4144-9063-yyy",
    "250a11b2-0b4b-4b24-adf2-yyy"
  ]
}

error message

Error: Request cancelled
│ 
│   with azuread_group.group-test-01,
│   on test.tf line 1, in resource "azuread_group" "group-test-01":
│    1: resource "azuread_group" "group-test-01" {
│ 
│ The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.

@cohendiego
Copy link

We are noticing this exact same behavior with this latest version of azure_ad provider.

@donjuanmon
Copy link

Same here, only azuread_group is displaying this behavior for us.

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

3 participants