hashicorp / terraform-provider-azuread

Terraform provider for Azure Active Directory
https://registry.terraform.io/providers/hashicorp/azuread/latest/docs
Mozilla Public License 2.0
431 stars 300 forks source link

Terraform Refresh State of Groups returns could not check for existing group(s) #1541

Open DevopsMercenary opened 3 weeks ago

DevopsMercenary commented 3 weeks ago

Is there an existing issue for this?

Community Note

Terraform Version

1.9.8

AzureAD Provider Version

3.0.2

I manually deleted the groups and downgraded the provider to 2.53.1 and did not experience this issue

Affected Resource(s)/Data Source(s)

azuread_group

Terraform Configuration Files

resource "azuread_group" "aad-role" {

  for_each = toset( ["admin", "analyst", "delivery", "developer", "etl", "read-only", "solutions", "security-reader"] )

  display_name = format("%s-%s-%s", var.cm-region, "databricks", each.value)

  security_enabled        = "true"
  prevent_duplicate_names = true

}

### Debug Output/Panic Output

```shell
https://gist.github.com/DevopsMercenary/b93ff28402ea15ad1030ec59e0721e66

Expected Behaviour

Updated the names of my groups

Actual Behaviour

│ Error: could not check for existing group(s): unable to list Groups with filter "displayName eq 'read-only'": the context used must have a deadline attached for polling purposes, but got no deadline
│
│   with azuread_group.aad-role["read-only"],
│   on rbac.tf line 20, in resource "azuread_group" "aad-role":
│   20: resource "azuread_group" "aad-role" {
│
╵
╷
│ Error: could not check for existing group(s): unable to list Groups with filter "displayName eq 'delivery'": the context used must have a deadline attached for polling purposes, but got no deadline
│
│   with azuread_group.aad-role["delivery"],
│   on rbac.tf line 20, in resource "azuread_group" "aad-role":
│   20: resource "azuread_group" "aad-role" {
│
╵
╷
│ Error: could not check for existing group(s): unable to list Groups with filter "displayName eq 'developer'": the context used must have a deadline attached for polling purposes, but got no deadline
│
│   with azuread_group.aad-role["developer"],
│   on rbac.tf line 20, in resource "azuread_group" "aad-role":
│   20: resource "azuread_group" "aad-role" {
│
╵

Steps to Reproduce

No response

Important Factoids

No response

References

No response

DevopsMercenary commented 5 days ago

HI, any updates on this?

I've run into this issue again today as well.

Terraform v1.9.8
on darwin_arm64
+ provider registry.terraform.io/hashicorp/azuread v3.0.2
+ provider registry.terraform.io/hashicorp/azurerm v4.8.0
+ provider registry.terraform.io/hashicorp/random v3.6.3

I would guess that this is being caused by prevent_duplicate_names = true

resource "azuread_group" "blob-read-write" {

  display_name            = "sales-blob-read-write"
  prevent_duplicate_names = true

  description = "Allow group members to read and modify all containers in the storage account ${local.storage-account-resource-map.resource_name}"

  security_enabled = true
}