pub struct Terraform { /* private fields */ }Expand description
Terraform client configuration.
Holds the binary path, working directory, environment variables, and global
arguments shared across all command executions. Construct via
Terraform::builder().
Implementations§
Source§impl Terraform
impl Terraform
Sourcepub fn builder() -> TerraformBuilder
pub fn builder() -> TerraformBuilder
Create a new TerraformBuilder.
Sourcepub async fn version(&self) -> Result<VersionInfo>
pub async fn version(&self) -> Result<VersionInfo>
Verify terraform is installed and return version info.
Sourcepub fn with_working_dir(&self, path: impl AsRef<Path>) -> Self
pub fn with_working_dir(&self, path: impl AsRef<Path>) -> Self
Create a clone of this client with a different working directory.
Useful for running a single command against a different directory without modifying the original client:
let tf = Terraform::builder()
.working_dir("./infra/network")
.build()?;
// Run one command against a different directory
let compute = tf.with_working_dir("./infra/compute");
InitCommand::new().execute(&compute).await?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for Terraform
impl RefUnwindSafe for Terraform
impl Send for Terraform
impl Sync for Terraform
impl Unpin for Terraform
impl UnsafeUnpin for Terraform
impl UnwindSafe for Terraform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more