Crates.io | terraform-parser |
lib.rs | terraform-parser |
version | 0.1.0 |
source | src |
created_at | 2022-04-08 21:18:57.488154 |
updated_at | 2022-04-08 21:18:57.488154 |
description | Strictly typed terraform plan and state files parser written in Rust. |
homepage | https://github.com/semanser/terraform-parser |
repository | https://github.com/semanser/terraform-parser |
max_upload_size | |
id | 564438 |
size | 8,563 |
Incredibly fast, strictly typed terraform files parser written in Rust. Based on serde.
use std::fs;
use terraform_parser::TerraformParser;
fn main() {
let state =
fs::read_to_string("./state.json").expect("Something went wrong reading the state file");
let plan =
fs::read_to_string("./plan.json").expect("Something went wrong reading the plan file");
let parsed_state = TerraformParser::parse_state(&state);
let parsed_plan = TerraformParser::parse_plan(&plan);
println!("{}", parsed_state.unwrap().terraform_version);
println!("{}", parsed_plan.unwrap().format_version);
}