pub struct TerraformBuilder { /* private fields */ }Expand description
Builder for constructing a Terraform client.
Defaults:
- Binary: resolved via
TERRAFORM_PATHenv var, orterraformonPATH -no-colorenabled (disable with.color(true))-input=falseenabled (disable with.input(true))
Implementations§
Source§impl TerraformBuilder
impl TerraformBuilder
Sourcepub fn binary(self, path: impl Into<PathBuf>) -> Self
pub fn binary(self, path: impl Into<PathBuf>) -> Self
Set an explicit path to the terraform binary.
Sourcepub fn working_dir(self, path: impl AsRef<Path>) -> Self
pub fn working_dir(self, path: impl AsRef<Path>) -> Self
Set the default working directory for all commands.
This is passed as -chdir=<path> to terraform.
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Set an environment variable for all terraform subprocesses.
Sourcepub fn env_var(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn env_var(self, name: impl Into<String>, value: impl Into<String>) -> Self
Set a Terraform variable via environment (TF_VAR_<name>).
Sourcepub fn color(self, enable: bool) -> Self
pub fn color(self, enable: bool) -> Self
Enable or disable color output (default: disabled for programmatic use).
Sourcepub fn input(self, enable: bool) -> Self
pub fn input(self, enable: bool) -> Self
Enable or disable interactive input prompts (default: disabled).
Sourcepub fn timeout(self, duration: Duration) -> Self
pub fn timeout(self, duration: Duration) -> Self
Set a default timeout for all command executions.
Commands that exceed this duration will be terminated and return
Error::Timeout. No timeout is set by default.
Sourcepub fn timeout_secs(self, seconds: u64) -> Self
pub fn timeout_secs(self, seconds: u64) -> Self
Set a default timeout in seconds for all command executions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TerraformBuilder
impl RefUnwindSafe for TerraformBuilder
impl Send for TerraformBuilder
impl Sync for TerraformBuilder
impl Unpin for TerraformBuilder
impl UnsafeUnpin for TerraformBuilder
impl UnwindSafe for TerraformBuilder
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