Class: Kitchen::Terraform::Command::Init::PostZeroFifteenZero
- Inherits:
-
Object
- Object
- Kitchen::Terraform::Command::Init::PostZeroFifteenZero
- Defined in:
- lib/kitchen/terraform/command/init/post_zero_fifteen_zero.rb
Overview
The working directory is initialized by running a command like the following example:
terraform init \
-backend=true \
[-backend-config=<backend_configurations[0]> ...] \
-force-copy \
-get=true \
-input=false \
[-no-color] \
[-plugin-dir=<plugin_directory>] \
[-upgrade=true] \
<root_module_directory>
Instance Method Summary collapse
-
#initialize(config:) ⇒ Kitchen::Terraform::Command::Init::PostZeroFifteenZero
constructor
#initialize prepares a new instance of the class.
-
#to_s ⇒ String
The command with flags.
Constructor Details
#initialize(config:) ⇒ Kitchen::Terraform::Command::Init::PostZeroFifteenZero
#initialize prepares a new instance of the class.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/kitchen/terraform/command/init/post_zero_fifteen_zero.rb', line 50 def initialize(config:) self.backend_config = ::Kitchen::Terraform::CommandFlag::BackendConfig.new arguments: config.fetch( :backend_configurations ) self.color = ::Kitchen::Terraform::CommandFlag::Color.new enabled: config.fetch(:color) self.plugin_dir = ::Kitchen::Terraform::CommandFlag::PluginDir.new pathname: config.fetch( :plugin_directory ) self.upgrade = ::Kitchen::Terraform::CommandFlag::Upgrade.new enabled: config.fetch(:upgrade_during_init) end |
Instance Method Details
#to_s ⇒ String
Returns the command with flags.
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/kitchen/terraform/command/init/post_zero_fifteen_zero.rb', line 62 def to_s "init " \ "-backend=true " \ "#{backend_config} " \ "-force-copy=true " \ "-get=true " \ "-input=false " \ "#{color} " \ "#{plugin_dir} " \ "#{upgrade}" end |