From 1a29b57538a788f4456f265f27376bb7381d9bcb Mon Sep 17 00:00:00 2001 From: worm Date: Fri, 30 Dec 2022 17:23:32 -0800 Subject: [PATCH] Added readme with general design document --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..df98271 --- /dev/null +++ b/README.md @@ -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