Open kiriltdrv opened 2 years ago
probably it's related to similar issue https://github.com/hashicorp/terraform-provider-azurerm/issues/15281
got the same issue with azurerm 2.99 and terraform 1.1.9
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to module.apim_custom_product.azurerm_api_management_product_group.group_association["Developers"], provider
│ "provider[\"registry.terraform.io/hashicorp/azurerm\"].abc" produced an unexpected new value: Root resource was present, but now absent.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
Using this declaration :
resource "azurerm_api_management_product_group" "group_association" {
provider = azurerm.abc
for_each = toset(var.groups)
product_id = azurerm_api_management_product.product.product_id
group_name = each.key
api_management_name = var.apim_name
resource_group_name = var.apim_rg_name
}
we are facing same issue. any update ?
Hi Same error happened to me. Any Updates?
resource "azurerm_api_management_product_group" "portal_guest" { product_id = azurerm_api_management_product.product["pro"].product_id group_name = "Guests" -- > "guests" api_management_name = azurerm_api_management.apim.name resource_group_name = var.resource_group_name }
Updating group_name to "guests" resolved my issue
@kiriltdrv Thank you for opening this issue. Were you able to try @arunrajsb's solution of updating the group_name to "guests" instead of "Guests"?
@kiriltdrv Thank you for opening this issue. Were you able to try @arunrajsb's solution of updating the group_name to "guests" instead of "Guests"?
Yes, issue has been resolved
Thanks @arunrajsb solved my issue also do not use data block to read the display name otherwise it will change it back to "Guest" hardcode or get the id of group from the data block instead of name.
I would still consider this an issue to be fixed in the documentation because it uses the ID instead on the NAME of the product. I had the same issue adding Developers group and when I changed it to all lower caps which is the ID, the issue got resolved.
resource "azurerm_api_management_product_group" "portal_guest" { product_id = azurerm_api_management_product.product["pro"].product_id group_name = "Guests" -- > "guests" api_management_name = azurerm_api_management.apim.name resource_group_name = var.resource_group_name }
Updating group_name to "guests" resolved my issue
I tried lowercasing the 'Guests' string, but got a 'Resource already exists' error --> see details in #25648
Is there an existing issue for this?
Community Note
Terraform Version
1.2.4
AzureRM Provider Version
3.13.0
Affected Resource(s)/Data Source(s)
azurerm_api_management_product_group
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
When executing Terraform task in Azure DevOps Release Pipeline I was trying assign one of the default API Management User Groups (Administrators, Developers and Guests) to a product I have created. When defining the group name in group_name = "Guests" (same behavior for Developers and Administrators) - Terraform task apply ended with error.
Actual Behaviour
Even though the Terraform task "apply" ended with error - the group was correctly assigned to the APIM Product.
Steps to Reproduce
this happened on terraform apply step
Important Factoids
No response
References
No response