-
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
Fix Management Group CreateUpdate Function #6668
Fix Management Group CreateUpdate Function #6668
Conversation
@katbyte Let me know if you have any feedback on this PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @wsf11! These changes look great. We can get this in once the merge conflicts are sorted.
azurerm/utils/response.go
Outdated
@@ -36,3 +36,7 @@ func ResponseWasStatusCode(resp autorest.Response, statusCode int) bool { // nol | |||
|
|||
return false | |||
} | |||
|
|||
func ResponseWasForbidden(resp autorest.Response) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this was added recently so we can remove it.
Quick update - Our CI System still being worked on to be able to run the suite there to be able to merge/release this, but we're getting there... When running locally: Tests Pass
|
I've looped back around to this now I can test review it properly. There's also the name update bug as mentioned by @ArcturusZhang - But I think that will need some careful thought and probably separating the Create and Update functions, as the change of name appears to change the resource ID of the group also. |
@jackofallops no worries. Glad I could help with this! |
This has been released in version 2.11.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.11.0"
}
# ... other configuration ... |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Addresses issue #6091
Issue: The Azure REST API returns a 403 if either you do not have access to a management group or a management group cannot be found. When creating a new management group, a check is always performed to see if the management group exists already, causing a 403, and an error.
Fix: Change response not found to response forbidden and log message. In addition, there was a regression in PR #6276 that did not check for the name, rather it was checking for the group_name