-
Notifications
You must be signed in to change notification settings - Fork 41
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
Custom resource for Azure PIM role management policies #3663
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
New functions:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3663 +/- ##
==========================================
+ Coverage 57.03% 57.24% +0.21%
==========================================
Files 79 80 +1
Lines 12548 12732 +184
==========================================
+ Hits 7157 7289 +132
- Misses 4840 4883 +43
- Partials 551 560 +9 ☔ View full report in Codecov by Sentry. |
e75e3f2
to
5c2b57a
Compare
5c2b57a
to
5cba82d
Compare
Looks reasonable, except that the Delete operation in the spec isn't actually implemented. Sigh.
…rnal validation via azure SDK
…oesn't know about path properties
a2a6d62
to
2843ac9
Compare
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.
Let's open a follow up issue to expand this to capture initial states for all resources to be able to remove the need to manually curate a list of default resource states where there's no delete operation in the spec.
|
This PR has been shipped in release v2.87.0. |
About
This PR adds support for Role Management Policies, part of Privileged Identity Management (PIM) in the Microsoft.Authentication namespace. It's one part of #2455.
Note that this is about the ARM part of PIM; there's also a Microsoft Graph API part which is not covered by this provider.
This resource wasn't automatically included because it supports only GET and PATCH. The policies are singletons that cannot be created or deleted, only modified via PATCH.
Implementation
Role Management Policies essentially consist of a name which is actually a GUID, and a list of ~20 rules.
Using our existing singleton support
defaults.GetDefaultResourceState
was tricky becauseSo instead, I've implemented a custom resource that captures the original state of a policy when it's first "created", i.e., added to Pulumi state. When a rule or the whole policy is removed from Pulumi, we look up the original state and re-apply it.
Testing
The e2e/integration test for this resource is special because using PIM requires a paid Entra ID P2 license. We have one that you can see here.