Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/palantir/tfjson
Terraform plan file to JSON
https://github.com/palantir/tfjson
octo-correct-managed
Last synced: about 1 month ago
JSON representation
Terraform plan file to JSON
- Host: GitHub
- URL: https://github.com/palantir/tfjson
- Owner: palantir
- License: mit
- Archived: true
- Created: 2016-11-02T16:06:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-09T18:14:04.000Z (over 5 years ago)
- Last Synced: 2024-04-13T22:56:26.029Z (8 months ago)
- Topics: octo-correct-managed
- Language: Go
- Homepage:
- Size: 497 KB
- Stars: 182
- Watchers: 17
- Forks: 62
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-terraform - tfjson - Utility to read in a Terraform plan file and dump it out in JSON. (Tools / Miscellaneous)
- awesome-tf - tfjson - Utility to read in a Terraform plan file and dump it out in JSON. :skull: (Tools / Community providers)
README
tfjson
======Utility to read in a Terraform plan file and dump it out in JSON. Standalone
version of [Terraform PR #3170](https://github.com/hashicorp/terraform/pull/3170).## Installation
```
$ go get github.com/palantir/tfjson
```## Usage
Given the following Terraform resources:
```hcl
provider "aws" {
region = "us-east-1"
}resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
}module "inner" {
source = "./inner"
}// in inner module:
resource "aws_vpc" "inner" {
cidr_block = "10.0.0.0/8"
}
```Running `terraform plan -out=terraform.tfplan` produces a Terraform plan file.
The JSON representation produced by `tfjson` looks like:```json
$ tfjson terraform.tfplan
{
"aws_vpc.main": {
"cidr_block": "10.0.0.0/16",
"default_network_acl_id": "",
"default_route_table_id": "",
"default_security_group_id": "",
"destroy": false,
"destroy_tainted": false,
"dhcp_options_id": "",
"enable_classiclink": "",
"enable_dns_hostnames": "",
"enable_dns_support": "",
"id": "",
"instance_tenancy": "",
"main_route_table_id": ""
},
"destroy": false,
"inner": {
"aws_vpc.inner": {
"cidr_block": "10.0.0.0/8",
"default_network_acl_id": "",
"default_route_table_id": "",
"default_security_group_id": "",
"destroy": false,
"destroy_tainted": false,
"dhcp_options_id": "",
"enable_classiclink": "",
"enable_dns_hostnames": "",
"enable_dns_support": "",
"id": "",
"instance_tenancy": "",
"main_route_table_id": ""
},
"destroy": false
}
}
```## License
This project is made available under the [MIT License](http://opensource.org/licenses/MIT).