pub struct RawCommand { /* private fields */ }Expand description
Escape-hatch command for running any Terraform subcommand.
Use this when you need a subcommand that doesn’t have a dedicated type,
while still benefiting from the Terraform client’s binary resolution,
working directory, environment variables, and global arguments.
use terraform_wrapper::{Terraform, TerraformCommand};
use terraform_wrapper::commands::raw::RawCommand;
let tf = Terraform::builder().working_dir("/tmp/infra").build()?;
// Run any subcommand with arbitrary flags
let output = RawCommand::new("console")
.arg("-var=region=us-west-2")
.execute(&tf)
.await?;Implementations§
Source§impl RawCommand
impl RawCommand
Sourcepub fn with_args(
self,
args: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_args( self, args: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Add multiple arguments to the command.
Trait Implementations§
Source§impl Clone for RawCommand
impl Clone for RawCommand
Source§fn clone(&self) -> RawCommand
fn clone(&self) -> RawCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RawCommand
impl Debug for RawCommand
Source§impl TerraformCommand for RawCommand
impl TerraformCommand for RawCommand
Source§type Output = CommandOutput
type Output = CommandOutput
The output type produced by this command.
Source§async fn execute(&self, tf: &Terraform) -> Result<CommandOutput>
async fn execute(&self, tf: &Terraform) -> Result<CommandOutput>
Execute this command against the given Terraform client.
Source§fn supports_input(&self) -> bool
fn supports_input(&self) -> bool
Whether this command supports the
-input=false flag. Read moreAuto Trait Implementations§
impl Freeze for RawCommand
impl RefUnwindSafe for RawCommand
impl Send for RawCommand
impl Sync for RawCommand
impl Unpin for RawCommand
impl UnsafeUnpin for RawCommand
impl UnwindSafe for RawCommand
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