-
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
New Resource: azurerm_maintenance_assignment_dynamic_scope
#25467
New Resource: azurerm_maintenance_assignment_dynamic_scope
#25467
Conversation
Hi Rhys, not sure if this helps but I can also reproduce the issue in the portal if I create a dynamic scope on a Subscription. However, if I apply a further filter and filter by resource group the dynamic scope creates successfully. Dynamic scopes created at the same time as the maintenance configuration also create without error I don't know why this makes a difference but hopefully gives you a clue! |
From further testing via Powershell it appears to you must apply a filter of some kind. Anything seems to be acceptable.
|
Hi @phil-bevan, thank you for your input! I built a dynamic scope via the Portal and AzApi by amending the filters as you mentioned. The other error I'm seeing occurs when Terraform verifies whether there is an existing resource in Azure; specifically the 'Get' method. |
Hi @ASHR4 , Not a Go expert, but doesn't NewScopedConfigurationAssignmentID expect a ConfigurationAssignmentName rather than a MaintenanceConfigurationName? |
Hi @phil-bevan, the other configuration assignments do something similar, however, I have a stashed commit that takes a name argument as if we require multiple dynamic scopes the configuration assignment requires a unique resource ID as they're all assigned at the subscription level This still didn't resolve my issue. The NewScopeConfigurationAssignmentID creates a struct that can be used to build the resource ID and check if a configuration assignment already exists. |
@ASHR4 I think I understand why it's not working. The current code will generate a resource ID similar to which I guess works fine for the other config assignment types, but dynamic scopes are assigned at the subscription level so you need to access them with a resource ID such as I think you need to find a different method to build that resource ID. I have a working sample in C# if that helps you at all:
I ran Fiddler in the background to identify the resource IDs in use |
Hi @phil-bevan, You were spot on, the I'll try and work on finishing this over the weekend :) Appreciate the help! |
@katbyte unsure if this being in draft, for a while, has effected this being reviewed. The associated issues have over 20+ votes and so I was hoping if this could be reviewed? Let me know if this is already on your radar :) Thanks |
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.
Hi @ASHR4 - Thanks for this PR. There's some design and schema changes noted below, sorry if it looks like a lot, I've tried to cover everything in one pass rather than go in cycles, but if you can take a look at and address the changes, I think we'll be in good shape!
Thanks!
internal/services/maintenance/maintenance_assignment_dynamic_scope_resource.go
Outdated
Show resolved
Hide resolved
internal/services/maintenance/maintenance_assignment_dynamic_scope_resource.go
Outdated
Show resolved
Hide resolved
internal/services/maintenance/maintenance_assignment_dynamic_scope_resource.go
Outdated
Show resolved
Hide resolved
internal/services/maintenance/maintenance_assignment_dynamic_scope_resource.go
Outdated
Show resolved
Hide resolved
internal/services/maintenance/maintenance_assignment_dynamic_scope_resource.go
Outdated
Show resolved
Hide resolved
website/docs/r/maintenance_assignment_dynamic_scope.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/r/maintenance_assignment_dynamic_scope.html.markdown
Outdated
Show resolved
Hide resolved
internal/services/maintenance/maintenance_assignment_dynamic_scope_resource.go
Outdated
Show resolved
Hide resolved
internal/services/maintenance/maintenance_assignment_dynamic_scope_resource.go
Outdated
Show resolved
Hide resolved
internal/services/maintenance/maintenance_assignment_dynamic_scope_resource.go
Outdated
Show resolved
Hide resolved
Hi @jackofallops, appreciate your time on this. I hope this is now in better shape :) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi @jackofallops, I requested a re-review last week, is there any chance you have any capacity for this, this week? Thanks |
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.
Thanks @ASHR4 - LGTM now ⛵
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Community Note
Description
Adding support to configure dynamic scopes on maintenance configuration resources.
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_maintenance_assignment_dynamic_scope
- support for assigning dynamic scopes on maintenance configurationsThis is a (please select all that apply):
Related Issue(s)
Fixes #24411, fixes #23336
Note
If this PR changes meaningfully during the course of review please update the title and description as required.