Skip to main content

TerraformCommand

Trait TerraformCommand 

Source
pub trait TerraformCommand: Send + Sync {
    type Output: Send;

    // Required methods
    fn args(&self) -> Vec<String>;
    fn execute(
        &self,
        tf: &Terraform,
    ) -> impl Future<Output = Result<Self::Output>> + Send;
}
Expand description

Trait implemented by all Terraform command builders.

Each command implements args to produce its CLI arguments and execute to run against a Terraform client.

Required Associated Types§

Source

type Output: Send

The output type produced by this command.

Required Methods§

Source

fn args(&self) -> Vec<String>

Build the argument list for this command.

Returns the subcommand name followed by all flags and options. For example: ["init", "-upgrade", "-backend-config=key=value"].

Source

fn execute( &self, tf: &Terraform, ) -> impl Future<Output = Result<Self::Output>> + Send

Execute this command against the given Terraform client.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§