Sha256: 40cf457cd01864d95056e42df8b917a9dfe388a4ff95efe036893fd9169bbefe
Contents?: true
Size: 691 Bytes
Versions: 28
Compression:
Stored size: 691 Bytes
Contents
require 'json' class Lono::Cfn class Download < 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 end
Version data entries
28 entries across 28 versions & 1 rubygems