I’m working on an issue where I want to utilize Terraform to manage my Azure Policy. I’d like to utilize modularization to complete this but am facing some issues with importing all of the policy definitions/initiatives. I have over 2800 assignments and have used the az definition show
and az assignment show
commands to export these. The JSON that’s exported is over 200k LOC. While a step forward it’s a daunting and laborious task. I’d like to find some way to automate this if possible. I’m using two Built-in initiatives that span over several subscriptions which include sub definition references. I’m not entirely sure how to structure the HCL at this time but am working through that. If anyone has suggestions to complete this task more quickly, it would be helpful.
Thank you if you happen to have some response or feedback.