https://github.com/rdbartram/PSTerraformParser
https://github.com/rdbartram/PSTerraformParser
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rdbartram/PSTerraformParser
- Owner: rdbartram
- License: mit
- Created: 2019-04-05T14:57:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-10T09:54:35.000Z (about 6 years ago)
- Last Synced: 2024-08-13T07:05:51.024Z (8 months ago)
- Language: PowerShell
- Size: 26.4 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - rdbartram/PSTerraformParser - (PowerShell)
README
# PSTerraformParser
> I hope someday this functionality ends up native in Terraform, but for now, we have PowerShell.
PSTerraformParser is a module designed to take the string output from your terraform plans and return them in a standardised json format.
🐱💻 PSTerraformParser is built and tested in Azure DevOps and is distributed via the PowerShell gallery.
[](https://dev.azure.com/rdbartram/GithubPipelines/_build/latest?definitionId=8?branchName=master)
[](https://www.powershellgallery.com/packages/PSTerraformParser)
[](https://www.powershellgallery.com/packages/PSTerraformParser)## Installation
PSTerraformParser is compatible with Windows PowerShell 5.x and PowerShell Core 6.x.
```powershell
Install-Module -Name PSTerraformParser -Scope CurrentUser -Force
```## Features
### Terraform Plan Parsing
Since the output from Terraform plan is just plan text and not easily readable for automation, I've done the hard work and provided it in
json format for you. Just use the following command```powershell
terraform plan -no-color >> .\MyPlan.txtRead-TerraformPlan -Path .\MyPlan.txt
```> IMPORTANT: I can't parse the file produced by the -out=path argument for terraform plan which is a binary file. There is not a stable specification for this binary file format so, at this time, it is safer to parse the somewhat structured textual output that gets written to stdout.
## Further reading
For more information pertaining to Terraform, head to their website [terraform](https://terraform.io).
## Got questions?
Got questions or you just want to get in touch? Use our issues page or one of these channels:
[](https://twitter.com/rd_bartram)