Changing display name of azuread_group resource for security groups causes terraform plan to fail · Issue #1634 · hashicorp/terraform-provider-azuread · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
AzureAD provider versions: Checked with both 3.0.2 and 3.1.0. Same result for both, regardless of version original group was created with.
Terraform version: 1.8.1. (But given the nature of the error message and the fact that there is no such problem with M365 groups, I don't think this is relevant.)
Affected Resource(s)
azuread_group
Terraform Configuration Files
Config for creating the group:
data "azuread_client_config" "current" {}
resource "azuread_group" "security_test" {
display_name = "Terraform bug test - Original group name"
description = "Some description"
security_enabled = true
mail_enabled = false
mail_nickname = "test_group_bug"
assignable_to_role = false
owners = [data.azuread_client_config.current.object_id]
prevent_duplicate_names = true
}
Config with display name changed:
data "azuread_client_config" "current" {}
resource "azuread_group" "security_test" {
display_name = "Terraform bug test - New group name"
description = "Some description"
security_enabled = true
mail_enabled = false
mail_nickname = "test_group_bug"
assignable_to_role = false
owners = [data.azuread_client_config.current.object_id]
prevent_duplicate_names = true
}
Display name of security group should be changed without recreating the resource.
Actual Behavior
Terraform plan fails with error message which clearly indicates that display name is being used to search for the existing group rather than an immutable id such as the group id or the mail nickname
Planning failed. Terraform encountered an error while generating this plan.
Error: could not check for existing group(s): unable to list Groups with filter "displayName eq 'Terraform bug test - New group name'": the context used must have a deadline attached for polling purposes, but got no deadline
with azuread_group.security_test,
on main.tf line 3, in resource "azuread_group" "security_test":
3: resource "azuread_group" "security_test" {
Steps to Reproduce
'terraform plan'
'terraform apply'
Change display name in the configuration
'terraform plan'
Important Factoids
For M365 groups, renaming is successful and this problem is not observed.
References
#0000
The text was updated successfully, but these errors were encountered:
Community Note
Terraform (and AzureAD Provider) Version
AzureAD provider versions: Checked with both 3.0.2 and 3.1.0. Same result for both, regardless of version original group was created with.
Terraform version: 1.8.1.
(But given the nature of the error message and the fact that there is no such problem with M365 groups, I don't think this is relevant.)
Affected Resource(s)
azuread_group
Terraform Configuration Files
Config for creating the group:
Config with display name changed:
Debug Output
https://gist.github.com/smarshie/b2c9286c8208b762208aa2fe137e423b
Panic Output
N/A
Expected Behavior
Display name of security group should be changed without recreating the resource.
Actual Behavior
Terraform plan fails with error message which clearly indicates that display name is being used to search for the existing group rather than an immutable id such as the group id or the mail nickname
Planning failed. Terraform encountered an error while generating this plan.
Steps to Reproduce
Important Factoids
For M365 groups, renaming is successful and this problem is not observed.
References
The text was updated successfully, but these errors were encountered: