-
Notifications
You must be signed in to change notification settings - Fork 89
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
Cache Azure Policy Aliases #1277
Comments
@ArmaanMcleod Let's be aware of any performance cost of the index. We don't really want to do any iteration down resource types to find the aliases. |
@BernieWhite I think performance cost should be fine, since we can get namespace & resource type from the alias, then index the full alias to get the path. This should be a constant time lookup since no iteration is involved. Another idea is not even caring about the namespace and resource types, and just dumping What do you think? |
@ArmaanMcleod Yes, that might reduce memory and allocations. |
@BernieWhite The issue with it is some aliases like I think I will keep the first approach for now and think of a better way down the line. |
I guess another thing to consider is if we should replace the aliases with the path when assignments are exported, or if the aliases should be expanded when the assignments are being visited. To me it would be easier to just convert them when JSON rules are being emitted after the policy rule is visited. |
Agreed. |
Will also add a github actions workflow for this. |
Related to #181, we should cache Azure Policy Aliases in a JSON file
The format could be something like below:
Which would allow us to quickly lookup property paths for a given alias.
The other option was to use
Get-AzPolicyAlias
, but this would require an API call everytime an alias is needed, which would lead to slower performance.The text was updated successfully, but these errors were encountered: