Skip to main content

Module parser

Module parser 

Source
Expand description

High-level Parser facade — the recommended consumption surface.

The pipeline, evaluator, terragrunt resolver, provider resolver, graph builder and exporter compose into a long argument list of typed structs. For library consumers that’s flexible but noisy; Parser bundles the common shape behind one ergonomic builder and two execution methods.

// One-shot: parse a workspace with all defaults.
let workspace = tfparser_core::parse("./my-tf-repo")?;
println!("{} components", workspace.components.len());
use tfparser_core::{Parser, EnvVarMode};

// Builder for full control. Every option is optional except
// `workspace_root`; the rest defer to spec defaults.
let workspace = Parser::builder()
    .workspace_root("./my-tf-repo")
    .environment("production")
    .default_region("us-west-2")?
    .env_var_mode(EnvVarMode::Passthrough)
    .allow_env("TF_VAR_environment")
    .var("region", "us-east-1")
    .strict_providers(true)
    .build()?
    .parse()?;

Add .parse_and_export(&opts) to write the four canonical Parquet tables in the same call.

Structs§

Parser
High-level wrapper around DefaultPipeline + ParquetExporter.
ParserBuilder
Builder for Parser. Every method consumes and returns self so configuration reads top-to-bottom.

Functions§

parse
Parse a workspace with all defaults. Convenience over Parser::builder when you don’t need to tune anything.