Class: CloudFormationTool::CLI::Compile
- Inherits:
-
Clamp::Command
- Object
- Clamp::Command
- CloudFormationTool::CLI::Compile
- Includes:
- ParamSupport
- Defined in:
- lib/cloud_formation_tool/cli/compile.rb
Instance Method Summary collapse
Methods included from ParamSupport
#get_params, included, #read_param_file
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cloud_formation_tool/cli/compile.rb', line 11 def execute if file.end_with? '.init' puts CloudInit.new(file).encode(false) # make sure cloud-init files obey AWS user-data restrictions, but are also printable else tpl = CloudFormation.parse(file) params = get_params data = tpl.compile(params); data['Parameters'].each do |name,param| param['Default'] = params[name] if params.has_key? name end puts data.to_yaml end end |