azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

Feature request: Support execution of Terraform plan

Open markwragg opened this issue 1 year ago • 1 comments

When performing azd provision --preview with Terraform as the infrastructure provider (via an Azure DevOps pipeline), I can see that the Terraform plan file is saved, per this entry in the log:

Plan: 0 to add, 1 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: /agent/_work/1/s/.azure/<env>/infra/main.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "/agent/_work/1/s/.azure/<env>/infra/main.tfplan"

It would be good if we could then use the plan when performing azd provision, as without being able to do that there's a risk some other change is introduced when you perform azd provision (i.e terraform apply) because someone else could have merged some changes to the Terraform code in the interim.

I would imagine it working like this:

azd provision --tfplan <path to plan>

This would then execute Terraform like this

terraform apply <path to plan>

markwragg avatar Oct 21 '24 16:10 markwragg

This is a good feedback @markwragg , thank you. There's no plans in the near future for Terraform, but we'll review with the team. Thank you for your patient.

vhvb1989 avatar Oct 25 '24 05:10 vhvb1989