HPE Morpheus Enterprise
1830071 Members
14190 Online
109998 Solutions
New Discussion

How to get Terraform plan for a existing Terraform app through API?

 
SOLVED
Go to solution
rajmartha
Regular Advisor

How to get Terraform plan for a existing Terraform app through API?

Hi All

i am not able to find any API documentation to get a Terraform plan for an existing Terraform APP through API, is there any other ways to get a terraform plan?

1 REPLY 1
rbmorph
HPE Pro
Solution

Re: How to get Terraform plan for a existing Terraform app through API?

The TF plan should come back as part of the app state endpoint return. /api/apps/{appid}/state

You should see “planData”: in the return. Something similar to this.

“planData”:“\nNo changes. Your infrastructure matches the configuration.\n\nTerraform has compared your real infrastructure against your configuration\nand found no differences, so no changes are needed.\n\nWarnings:\n\n- Value for undeclared variable\n- Value for undeclared variable\n\nTo see the full warning notes, run Terraform without -compact-warnings.\n”,