Class: SsmUtils::GetParamsCommand
- Inherits:
-
Object
- Object
- SsmUtils::GetParamsCommand
- Defined in:
- lib/ssm_utils/get_params_command.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options) ⇒ GetParamsCommand
constructor
A new instance of GetParamsCommand.
Constructor Details
#initialize(options) ⇒ GetParamsCommand
Returns a new instance of GetParamsCommand.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ssm_utils/get_params_command.rb', line 6 def initialize() opt = { decrypt: true, ssm_root: '/', }.merge() raise ArgumentError.new("No file path specified") if !opt.key?(:file_out) @file_out = opt[:file_out] @decrypt = opt[:decrypt] @ssm_root = opt[:ssm_root] end |
Instance Method Details
#execute ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/ssm_utils/get_params_command.rb', line 18 def execute ssm = SsmUtils::SsmReaderDriver.new(decrypt: @decrypt, ssm_root: @ssm_root) params = ssm.account_params File.open(@file_out, 'w') do |f| YAML.dump(params, f, line_width: -1) end end |