Class: RubyTerraform::Commands::Show

Inherits:
Base
  • Object
show all
Includes:
Options::Global
Defined in:
lib/ruby_terraform/commands/show.rb

Overview

Wraps the terraform show command which reads and outputs a Terraform state or plan file in a human-readable form. If no path is specified, the current state will be shown.

For options accepted on construction, see Base#initialize.

When executing an instance of Show via Base#execute, the following options are supported:

  • :path: the path to a state file or plan to show.

  • :chdir: the path of a working directory to switch to before executing the given subcommand.

  • :no_color: whether or not the output from the command should be in color; defaults to false.

  • :json: if true, outputs the Terraform plan or state in a machine-readable form; defaults to false.

The Base#execute method accepts an optional second parameter which is a map of invocation options. Currently, the only supported option is :environment which is a map of environment variables to expose during invocation of the command.

Examples:

Basic Invocation

RubyTerraform::Commands::Show.new.execute

Method Summary

Methods inherited from Base

#execute, #initialize

Constructor Details

This class inherits a constructor from RubyTerraform::Commands::Base