Added readme with general design document

This commit is contained in:
worm 2022-12-30 17:23:32 -08:00
parent fb55bdcf8e
commit 1a29b57538

22
README.md Normal file
View file

@ -0,0 +1,22 @@
This tool will accept a run ID and a token, and optionally a directory to store things. The directory and token(and base_url in case it's needed for TFE) can be stored in a config file.
It will get the plan ID
from the response object
of the 'get run details' API call:
https://developer.hashicorp.com/terraform/cloud-docs/api-docs/run#get-run-details
Then, it will make a request to plan exports.
First, it will create a plan export:
https://developer.hashicorp.com/terraform/cloud-docs/api-docs/plan-exports#download-exported-plan-data
The response will contain a plan export ID, something like "pe-1jasfkl4lads86f"
You can then monitor the `data.attributes.status` for when it is `finished`
The response will contain a link to the download URL:
`data.attributes.links`
Then, the exported data will be downloaded (either in the current directory or wherever specified):
https://developer.hashicorp.com/terraform/cloud-docs/api-docs/plan-exports#download-exported-plan-data