pub struct PlanCommand { /* private fields */ }Expand description
Command for creating a Terraform execution plan.
Terraform plan uses exit code 2 to indicate “changes present” which
is treated as a success by this wrapper (not an error).
use terraform_wrapper::{Terraform, TerraformCommand};
use terraform_wrapper::commands::plan::PlanCommand;
let tf = Terraform::builder().working_dir("/tmp/infra").build()?;
let output = PlanCommand::new()
.var("region", "us-west-2")
.out("tfplan")
.execute(&tf)
.await?;Implementations§
Source§impl PlanCommand
impl PlanCommand
Sourcepub fn refresh_only(self) -> Self
pub fn refresh_only(self) -> Self
Create a plan that only refreshes state (-refresh-only).
Sourcepub fn refresh(self, enabled: bool) -> Self
pub fn refresh(self, enabled: bool) -> Self
Enable or disable refreshing state (-refresh).
Pass false to skip checking for external changes during planning.
Sourcepub fn compact_warnings(self) -> Self
pub fn compact_warnings(self) -> Self
Show warnings in compact form (-compact-warnings).
Sourcepub fn lock_timeout(self, timeout: &str) -> Self
pub fn lock_timeout(self, timeout: &str) -> Self
Duration to wait for state lock (-lock-timeout).
Sourcepub fn parallelism(self, n: u32) -> Self
pub fn parallelism(self, n: u32) -> Self
Limit the number of concurrent operations (-parallelism).
Sourcepub fn detailed_exitcode(self) -> Self
pub fn detailed_exitcode(self) -> Self
Return a detailed exit code (-detailed-exitcode).
When enabled, exit code 0 means no changes, exit code 2 means changes are present. Without this flag, exit code 0 means success regardless of whether changes are needed.
Trait Implementations§
Source§impl Clone for PlanCommand
impl Clone for PlanCommand
Source§fn clone(&self) -> PlanCommand
fn clone(&self) -> PlanCommand
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 PlanCommand
impl Debug for PlanCommand
Source§impl Default for PlanCommand
impl Default for PlanCommand
Source§fn default() -> PlanCommand
fn default() -> PlanCommand
Returns the “default value” for a type. Read more
Source§impl TerraformCommand for PlanCommand
impl TerraformCommand for PlanCommand
Source§type Output = CommandOutput
type Output = CommandOutput
The output type produced by this command.
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 PlanCommand
impl RefUnwindSafe for PlanCommand
impl Send for PlanCommand
impl Sync for PlanCommand
impl Unpin for PlanCommand
impl UnsafeUnpin for PlanCommand
impl UnwindSafe for PlanCommand
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