pub struct InitCommand { /* private fields */ }Expand description
Command for initializing a Terraform working directory.
Downloads providers, initializes backend, and prepares the directory for other commands.
use terraform_wrapper::{Terraform, TerraformCommand};
use terraform_wrapper::commands::init::InitCommand;
let tf = Terraform::builder().working_dir("/tmp/infra").build()?;
InitCommand::new().execute(&tf).await?;Implementations§
Source§impl InitCommand
impl InitCommand
Sourcepub fn backend_config(self, key: &str, value: &str) -> Self
pub fn backend_config(self, key: &str, value: &str) -> Self
Add a backend configuration key-value pair (-backend-config=key=value).
Sourcepub fn backend_config_file(self, path: &str) -> Self
pub fn backend_config_file(self, path: &str) -> Self
Add a backend configuration file (-backend-config=<path>).
Sourcepub fn upgrade(self) -> Self
pub fn upgrade(self) -> Self
Update modules and plugins to the latest allowed versions (-upgrade).
Sourcepub fn reconfigure(self) -> Self
pub fn reconfigure(self) -> Self
Reconfigure backend, ignoring any saved configuration (-reconfigure).
Sourcepub fn migrate_state(self) -> Self
pub fn migrate_state(self) -> Self
Reconfigure backend and attempt to migrate state (-migrate-state).
Sourcepub fn plugin_dir(self, path: &str) -> Self
pub fn plugin_dir(self, path: &str) -> Self
Directory to search for provider plugins (-plugin-dir).
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 InitCommand
impl Clone for InitCommand
Source§fn clone(&self) -> InitCommand
fn clone(&self) -> InitCommand
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 InitCommand
impl Debug for InitCommand
Source§impl Default for InitCommand
impl Default for InitCommand
Source§fn default() -> InitCommand
fn default() -> InitCommand
Returns the “default value” for a type. Read more
Source§impl TerraformCommand for InitCommand
impl TerraformCommand for InitCommand
Auto Trait Implementations§
impl Freeze for InitCommand
impl RefUnwindSafe for InitCommand
impl Send for InitCommand
impl Sync for InitCommand
impl Unpin for InitCommand
impl UnsafeUnpin for InitCommand
impl UnwindSafe for InitCommand
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