Class: Kitchen::Terraform::Command::WorkspaceNew

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/terraform/command/workspace_new.rb

Overview

The workspace is created by running a command like the following example:

terraform workspace new <name>

Instance Method Summary collapse

Constructor Details

#initialize(config:) ⇒ Kitchen::Terraform::Command::WorkspaceNew

#initialize prepares a new instance of the class.

Parameters:

  • config (Hash)

    the configuration of the driver.

Options Hash (config:):

  • :workspace_name (String)

    the name of the Terraform workspace.



28
29
30
# File 'lib/kitchen/terraform/command/workspace_new.rb', line 28

def initialize(config:)
  self.workspace_name = config.fetch :workspace_name
end

Instance Method Details

#to_sString

Returns the command.

Returns:

  • (String)

    the command.



33
34
35
# File 'lib/kitchen/terraform/command/workspace_new.rb', line 33

def to_s
  "workspace new #{workspace_name}"
end