Sha256: 4918c76fea429e51d891a7d87c8463956fc71f66ca93ff521c12cedcc9e1266a
Contents?: true
Size: 1.12 KB
Versions: 18
Compression:
Stored size: 1.12 KB
Contents
class Ufo::Cfn::Stack class Builder < Ufo::Cfn::Base include Ufo::Utils::Logging def initialize(options={}) super @vars = options[:vars] @template = {Description: "UFO ECS stack #{@vars[:stack_name]}"} end def build logger.info "Building template" @template[:Parameters] = Parameters.build(@options) @template[:Conditions] = Conditions.build(@options) @template[:Resources] = Resources.build(@options) @template[:Outputs] = Outputs.build(@options) @template.deep_stringify_keys! @template = Ufo::Utils::Squeezer.new(@template).squeeze @template = CustomProperties.new(@template, @vars[:stack_name]).apply write(@template) end def write(template) text = YAML.dump(template) path = ".ufo/output/template.yml" IO.write("#{Ufo.root}/#{path}", text) logger.info " #{path}" # Only basic YAML validation. Doesnt check for everything CloudFormation checks. # For CloudFormation checks handled with an exception handler in Cfn::Stack#print_code(exception) Ufo::Yaml.validate!(path) text end end end
Version data entries
18 entries across 18 versions & 1 rubygems