terraform-parser

Crates.ioterraform-parser
lib.rsterraform-parser
version0.1.0
sourcesrc
created_at2022-04-08 21:18:57.488154
updated_at2022-04-08 21:18:57.488154
descriptionStrictly typed terraform plan and state files parser written in Rust.
homepagehttps://github.com/semanser/terraform-parser
repositoryhttps://github.com/semanser/terraform-parser
max_upload_size
id564438
size8,563
Andriy Semenets (semanser)

documentation

README

terraform-parser

Incredibly fast, strictly typed terraform files parser written in Rust. Based on serde.

Usage

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);
}
Commit count: 8

cargo fmt