A tool for building Terraform stacks in Rust, offering an alternative to the CDK with static type safety and pre-generated bindings.
Terrars is a Rust library for generating Terraform configurations programmatically. It allows developers to define cloud infrastructure using Rust's type system, producing Terraform JSON files that can be applied with the standard Terraform CLI. It solves the problem of managing complex Terraform stacks with the safety and tooling of a statically-typed language.
Rust developers and DevOps engineers who are already using Terraform and want to integrate infrastructure definitions into their Rust codebases with better type safety and autocompletion.
Developers choose Terrars over alternatives like the CDK because it offers a simpler, Rust-native workflow with stronger static typing, pre-generated provider bindings, and a toolchain that only requires Terraform itself, avoiding JavaScript dependencies and complex code generation pipelines.
Terraform in Rust
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Ensures compile-time validation of resource definitions using Rust's type system, reducing runtime errors compared to CDK's optional type handling.
Leverages Rust tooling and autocompletion directly, avoiding the multi-language complexity and JavaScript dependencies of Terraform CDK.
Offers ready-to-use crates for popular providers like AWS and Cloudflare, speeding up development without manual schema generation.
Requires only the Terraform CLI, eliminating CDK's layered code generation pipeline and external package managers.
Admits missing Terraform features like resource provisioning and has limited static type checking for variables and outputs, per the README's 'Current limitations'.
Developers must create their own build scripts and integration wrappers, unlike CDK's managed workflows, adding initial setup complexity.
Uses sentinel-based escaping for Terraform templates, which can lead to double-escaping errors if .raw() calls are missed, as warned in the README.
Described as 'usable but with rough edges,' potentially involving breaking changes and a limited provider ecosystem compared to mature alternatives.
terrars is an open-source alternative to the following products: