pub struct ImportCommand { /* private fields */ }Expand description
Command for importing existing infrastructure into Terraform state.
Associates an existing resource with a Terraform resource address.
use terraform_wrapper::{Terraform, TerraformCommand};
use terraform_wrapper::commands::import::ImportCommand;
let tf = Terraform::builder().working_dir("/tmp/infra").build()?;
ImportCommand::new("aws_instance.web", "i-1234567890abcdef0")
.execute(&tf)
.await?;Implementations§
Source§impl ImportCommand
impl ImportCommand
Sourcepub fn new(address: &str, id: &str) -> Self
pub fn new(address: &str, id: &str) -> Self
Create a new import command.
address: The Terraform resource address (e.g., “aws_instance.web”)id: The provider-specific resource ID (e.g., “i-1234567890abcdef0”)
Sourcepub fn lock_timeout(self, timeout: &str) -> Self
pub fn lock_timeout(self, timeout: &str) -> Self
Duration to wait for state lock (-lock-timeout).
Trait Implementations§
Source§impl Clone for ImportCommand
impl Clone for ImportCommand
Source§fn clone(&self) -> ImportCommand
fn clone(&self) -> ImportCommand
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 ImportCommand
impl Debug for ImportCommand
Source§impl TerraformCommand for ImportCommand
impl TerraformCommand for ImportCommand
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 ImportCommand
impl RefUnwindSafe for ImportCommand
impl Send for ImportCommand
impl Sync for ImportCommand
impl Unpin for ImportCommand
impl UnsafeUnpin for ImportCommand
impl UnwindSafe for ImportCommand
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