-
Notifications
You must be signed in to change notification settings - Fork 51
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
PIM RoleManagementPolicy Expiration_Admin_Assignment missing on create #2737
Comments
Hi @dimitar-dimitrow thanks for getting in touch. It's not immediately obvious at which stage this information might be being dropped. I don't see any issues in the upstream TF provider repo, but it might just have not been spotted. The next state will likely be to have to run the provider under a debugger to step through the transformations. For reference, here's the implementation of the create in the version you're using (6.11.0): One thing that does stand out is that the implementation of the update does have a lot more code around handling aspects like the activeAssignmentRules directly compared to the create. Though the create seems to call through to this code here: |
Here's what the values look like in the debugger after getting deserialized in the TF provider in the Create() method. |
Looking closer at the upstream code, the codepaths for the create and the update are identical. |
I'm going to have to park this for now. As far as I can see, the transformation from the values in the SDK is accurate to what we pass to the upstream provider. What's not clear is how the upstream provider turns that model into the go-azure-sdk update model. This is done in the |
Here's the source for deciding if to add the When evaluating The It's most likely also an issue in the upstream provider. Alternatively, there could be a subtle difference between how the default value is populated by the |
@danielrbradley, thanks for the investigation! Indeed the culprit is the terraform provider. Those policies are generated by azure and filled with default values. As they are not really created by pulumi(terraform) provider, my suggestion was that on create they are loaded(read) from azure and than checked for changes. However, this is not the case and the default/empty golang values are used for initial comparison. Should I proceed with raising the issue to the terraform repo? A workaround is to specify a non empty |
I think the next step will be to confirm if it's actually a bug when running the provider via Terraform as the bridging process for Pulumi sometimes has slightly different behaviour. If the same bug appears when running via Terraform then we can log this with the provider, otherwise we can log it as an issue in the pulumi-terraform-bridge. |
Describe what happened
When I create a RoleManagementPolicy resource the expirationRequired: false configuration of the activeAssignmentRules is not forwarded to azure. This happens only on initial pulumi up.
The HTTP PATCH request content does not contain a rule with id - Expiration_Admin_Assignment, while it contains a rule with id - Expiration_Admin_Eligibility, which is set in similar way.
On a second pulumi up the Expiration_Admin_Assignment is included in the request and is properly updated.
Sample program
Log output
Affected Resource(s)
RoleManagementPolicy
Output of
pulumi about
CLI
Version 3.130.0
Go Version go1.22.6
Go Compiler gc
Plugins
KIND NAME VERSION
resource azure 6.11.0
resource azure-native 2.65.0
resource azure-native 2.58.0
resource command 1.0.1
language nodejs unknown
Host
OS ubuntu
Version 22.04
Arch x86_64
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: