A Rust library for parsing, editing, and encoding HashiCorp Configuration Language (HCL) with serde support.
hcl-rs is a Rust library for parsing, editing, and encoding HashiCorp Configuration Language (HCL) documents. It solves the problem of integrating HCL, a language commonly used in infrastructure-as-code tools like Terraform, into Rust applications by providing serde-compatible data structures and manipulation utilities.
Rust developers working with HCL-based configurations, such as those building tools around Terraform, Packer, or other HashiCorp products, or anyone needing to programmatically process HCL files in Rust.
Developers choose hcl-rs for its close adherence to HashiCorp's HCL specifications, serde integration for easy serialization, and the ability to preserve formatting when editing HCL documents, which is essential for maintaining configuration readability.
HCL parsing and encoding libraries for rust with serde support
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports serialization and deserialization with serde, enabling easy conversion between HCL and Rust data structures, as highlighted in the README for seamless data handling.
Aims for feature parity with HashiCorp's Go HCL implementation, ensuring compatibility with standard HCL syntax used by tools like Terraform, as per the specification documents.
The hcl-edit crate allows parsing and modifying HCL documents while preserving whitespace and comments, essential for maintaining config readability during edits.
Includes hcl2json for converting HCL files to JSON, useful for interoperability and data processing, as mentioned in the key features.
Expression evaluation is relatively basic and not as powerful as in HashiCorp's implementation, limiting advanced use cases, as admitted in the README.
Lacks HCL schema validation, making it difficult to enforce configuration correctness or handle complex custom types, which the README notes is not included yet.
Handling complex configurations with serde can be cumbersome due to limitations in the model, requiring workarounds for advanced serialization needs.