Expand description
A type-safe Terraform CLI wrapper for Rust.
terraform-wrapper provides builder-pattern command structs for driving the
Terraform CLI programmatically. Each command produces typed output and runs
asynchronously via tokio.
§Quick Start
use terraform_wrapper::{Terraform, TerraformCommand};
use terraform_wrapper::commands::init::InitCommand;
use terraform_wrapper::commands::apply::ApplyCommand;
use terraform_wrapper::commands::output::{OutputCommand, OutputResult};
let tf = Terraform::builder()
.working_dir("/tmp/my-infra")
.build()?;
InitCommand::new().execute(&tf).await?;
ApplyCommand::new()
.auto_approve()
.var("region", "us-west-2")
.execute(&tf)
.await?;
let result = OutputCommand::new()
.name("public_ip")
.raw()
.execute(&tf)
.await?;Re-exports§
pub use command::TerraformCommand;pub use error::Error;pub use error::Result;pub use exec::CommandOutput;
Modules§
Structs§
- Terraform
- Terraform client configuration.
- Terraform
Builder - Builder for constructing a
Terraformclient.