pub struct GraphCommand { /* private fields */ }Expand description
Command for generating a visual dependency graph in DOT format.
Produces a representation of the dependency graph between Terraform resources, suitable for rendering with Graphviz.
use terraform_wrapper::{Terraform, TerraformCommand};
use terraform_wrapper::commands::graph::GraphCommand;
let tf = Terraform::builder().working_dir("/tmp/infra").build()?;
let output = GraphCommand::new()
.draw_cycles()
.execute(&tf)
.await?;
// output.stdout contains DOT format graphImplementations§
Source§impl GraphCommand
impl GraphCommand
Sourcepub fn graph_type(self, graph_type: &str) -> Self
pub fn graph_type(self, graph_type: &str) -> Self
Set the graph type (-type=plan|plan-refresh-only|plan-destroy|apply).
Sourcepub fn plan_file(self, path: &str) -> Self
pub fn plan_file(self, path: &str) -> Self
Use a saved plan file (-plan=<file>).
Automatically sets the graph type to apply.
Sourcepub fn draw_cycles(self) -> Self
pub fn draw_cycles(self) -> Self
Highlight circular dependencies (-draw-cycles).
Trait Implementations§
Source§impl Clone for GraphCommand
impl Clone for GraphCommand
Source§fn clone(&self) -> GraphCommand
fn clone(&self) -> GraphCommand
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 GraphCommand
impl Debug for GraphCommand
Source§impl Default for GraphCommand
impl Default for GraphCommand
Source§fn default() -> GraphCommand
fn default() -> GraphCommand
Returns the “default value” for a type. Read more
Source§impl TerraformCommand for GraphCommand
impl TerraformCommand for GraphCommand
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 GraphCommand
impl RefUnwindSafe for GraphCommand
impl Send for GraphCommand
impl Sync for GraphCommand
impl Unpin for GraphCommand
impl UnsafeUnpin for GraphCommand
impl UnwindSafe for GraphCommand
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