-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
API to retrieve plan output #1039
Comments
Hello @igorbrites You could see where the binary terraform plan is saved in the backend storage using:
Write some script to download the file locally and just run:
Maybe this can help you |
I guess in the future we could add some endpoint similar to this to download the json terraform plan result https://developer.hashicorp.com/terraform/cloud-docs/api-docs/plans#retrieve-the-json-execution-plan |
Other option could be to use this request:
Once you get the property "output" you could download it using The above is what the UI is using the print the result |
Using curl will print something like this:
|
Awesome! I'll give it a shot, thanks! |
IMHO we could have one to get the JSON and another to get the actual plan file. In my case, I use the plan file to create a comment on GitHub PRs, so I'm going to use the first option you provided. |
Feature description 💡
When running plans on Terrakube remote executors, we can't save the plan on local files, as it shows the error below:
There are issues opened on Terraform and Opentofu to have this working on the client side, though Terraform Cloud has an API that allows us to retrieve the JSON plan just like
terraform show -json planfile
.Is there any API call on Terrakube to do the same? Or is there another way to get the plan body? I could get the command output, though when it has errors it can be messy.
Anything else?
No response
The text was updated successfully, but these errors were encountered: