microsoft / terraform-provider-power-platform

Power Platform Terraform Provider
https://registry.terraform.io/providers/microsoft/power-platform/latest/docs
MIT License
35 stars 14 forks source link

Power Platform Export to Terraform Utility #42

Open leighatami opened 1 year ago

leighatami commented 1 year ago

As an IT Pro, I want the ability to export my current Power Platform infrastructure into Terraform modules so that I can manage my existing infrastructure using Terraform.

leighatami commented 1 year ago

Example from Azure terraform https://github.com/Azure/aztfexport

rpothin commented 4 months ago

Hi @leighatami,

I hope you are doing well.

I just bumped into this issue and thought it could be interesting to share with you something I worked on for DLP policies.

  1. Export of DLP policies: Terraform configuration + GitHub workflow
  2. Conversion of existing DLP policies into Terraform variable definition files (I have made the choice to have 1 Terraform variable definition file per DLP policy but it is definitely something that will depend the preferences of each team): PowerShell code in Polyglot Notebook
  3. Generate state file with existing DLP policy: GitHub workflow

[!WARNING] Step 3 is really important because if skipped it will generate a duplicate of the considered DLP policy.

  1. Management of "converted" DLP policies with Terraform: Terraform configuration + GitHub workflow

I hope you will find these resources interesting and I am available to help if needed.

Have a great day. Raphael