Sha256: d90e7213085f9493671fae09c481e10b44040a2d7e5bdc8b0728b8d4e8c3ddb2
Contents?: true
Size: 643 Bytes
Versions: 23
Compression:
Stored size: 643 Bytes
Contents
require 'json' class Lono::Cfn::Download < Lono::Cfn::Base def run puts "Download existing template to: #{download_path}" return if @options[:noop] download_template end def download_template resp = cfn.get_template( stack_name: @stack_name, template_stage: "Original" ) body = convert_to_yaml(resp.template_body) IO.write(download_path, body) end def convert_to_yaml(body) json?(body) ? YAML.dump(JSON.parse(body)) : body end def json?(body) !!JSON.parse(body) rescue false end def download_path name = @options[:name] || @stack_name "/tmp/#{name}.yml" end end
Version data entries
23 entries across 23 versions & 1 rubygems