https://github.com/relusc/hclconv
Simple tool to convert JSON files to HCL2 files and vice versa
https://github.com/relusc/hclconv
convert converter hcl hcl2 json
Last synced: 4 months ago
JSON representation
Simple tool to convert JSON files to HCL2 files and vice versa
- Host: GitHub
- URL: https://github.com/relusc/hclconv
- Owner: relusc
- License: apache-2.0
- Created: 2022-05-03T15:09:51.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-22T14:01:53.000Z (about 3 years ago)
- Last Synced: 2026-01-14T14:06:44.107Z (6 months ago)
- Topics: convert, converter, hcl, hcl2, json
- Language: Go
- Homepage: https://github.com/relusc/hclconv
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# hclconv
Simple tool to convert JSON files to HCL2 files and vice versa. It was intended for personal use and therefore its implementation might have a few flaws (I'm not a Go expert, but I have been using it for a while and I really like it).
## Installation
Download the binary fitting your platform from the [releases](https://github.com/rescDev/hclconv/releases) page.
## Usage
## Convert HCL file to JSON
```bash
hclconv --in sample.tfvars --out sample.tfvars.json
```
## Convert JSON file to HCL
```bash
hclconv --in sample.tfvars.json --out sample.tfvars
```
## Convert JSON file to HCL and format its content
**NOTE**: This requires the [`terraform`](https://github.com/hashicorp/terraform) CLI tool to be installed as the format is done by running `terraform fmt `.
```bash
hclconv --format --in sample.tfvars.json --out sample.tfvars
```
## Contributing
Contributions are very welcome ! As written initially, there might be a few things that can be improved. So if you stumble across this project and want to add things or improve the implementation, feel free to propose your changes :)
## Maintainers
Rene Schach - [@relusc](https://github.com/relusc)