-
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
"azurerm_role_assignment" supports property "delegated_managed_identity_resource_id" #11848
Conversation
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 @njuCZ - LGTM 👍
@@ -197,19 +222,19 @@ func resourceArmRoleAssignmentCreate(d *pluginsdk.ResourceData, meta interface{} | |||
properties.RoleAssignmentProperties.PrincipalType = authorization.ServicePrincipal | |||
} | |||
|
|||
if err := pluginsdk.Retry(d.Timeout(pluginsdk.TimeoutCreate), retryRoleAssignmentsClient(d, scope, name, properties, meta)); err != nil { | |||
if err := pluginsdk.Retry(d.Timeout(schema.TimeoutCreate), retryRoleAssignmentsClient(d, scope, name, properties, meta, tenantId)); err != nil { |
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.
this should be pluginsdk.TimeoutCreate
, I will submit a PR to fix it soon
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.
ty i was trying to resolve it via github - didn't go as well as i'd hoped 😓
This has been released in version 2.62.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.62.0"
}
# ... other configuration ... |
Is it possible this causes #12060? |
The problem seems to be surfacing when the scope is on resource level instead of subscription, resource group etc. Unfortunately this is not a scenario covered in the Acceptance Tests as far as I can see. |
@w0ut0, @HarleyB123, @aristosvo sorry for causing the problem. I am glad to see that PR #12076 could fix it. |
Can this be patched? It is causing state corruption for existing role assignments. |
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. |
fix #9348
docs: https://docs.microsoft.com/en-us/azure/lighthouse/how-to/deploy-policy-remediation
this property does not mean the managed identity resource id, but the resource which contains a managed identity.
It's used for a cross tenant scenario. assume there are two tenants and two service principals in each tenant:
By this new property, userA in tenantA could do role assignment in subscriptionB.
specific test step:
notes, there is an api limitation:
for cross tenant role assignment, we should pass the tenantId in the request, otherwise it could not read the resource.
But in normal cases, we could not pass the tenantId property, otherwise it will report error.
changes in this PR:
to fix the above limitation, in normal case, I don't change the id format. For cross tenant scenario, I append the tenantId into the id. This is not breaking change.