-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
When applying azurerm_role_assignment with terraform resource is created but terraform state file is not updated #12113
Comments
I am experiencing this issue as well. |
Hi @pawel-akonom @gregbarkerdcsg I believe this is a duplicate of #12057, at least seven other issues covering this bug are opened the last few days. The PR fixing this problem is ready to released as a hotfix version, v2.62.1 Most information how to solve your troubles can be found under #12060 |
I'm gonna close this issue as it is fixed by #12076, which is delivered in v2.62.1. Please feel free to reopen if the issue remains. |
I confirm that issue has been fixed in provider registry.terraform.io/hashicorp/azurerm: v2.62.1 |
@pawel-akonom @magodo I updated to v2.62.1 and I'm still getting
Did I miss something? Thank you for your help :) |
Have you tried to Remove the role assignment from the resource in Azure? Although Terraform failed, the role assignment itself is created. You could try to import it as well, but the ID is a bit harder to come by than the average resource. |
@aristosvo Sorry I should have been more specific. It did create the role assignment with no issues but now just shows the error. I will delete the role assignments tonight and try a terraform apply when we have some down time. Thank you again for getting this fixed! EDIT:
This import command worked for me. found the resource ID with this one:
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform (and AzureRM Provider) Version
Terraform version: 0.13.7
provider registry.terraform.io/hashicorp/azurerm: v2.62.0
Affected Resource(s)
azurerm_role_assignment
Terraform Configuration Files
Debug Output
Panic Output
Expected Behaviour
All roles assignments which are defined in terraform code are created and newly created resources are added to terraform state file. When trying to apply same terraform code second time terraform is not trying to create them because they are already exist.
Actual Behaviour
All roles assignments which are defined in terraform code are created but and newly created resources are not added to terraform state file. When trying to apply same terraform code second time terraform is trying to create them again even they are already exist.
Following Error appears when trying to create same terraform code second time:
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: