Class: CloudFormationTool::CloudFormation::NestedStack

Inherits:
Object
  • Object
show all
Includes:
Storable
Defined in:
lib/cloud_formation_tool/cloud_formation/nested_stack.rb

Constant Summary

Constants included from CloudFormationTool

VERSION

Instance Method Summary collapse

Methods included from Storable

#cached_object, #make_filename, #prefix, #upload

Methods included from CloudFormationTool

#aws_config, #awsas, #awscdn, #awscf, #awscreds, #awsec2, #awsecs, #awss3, #cf_bucket_name, #find_profile, #profile, #region, #s3_bucket_name

Constructor Details

#initialize(props, tpl) ⇒ NestedStack

Returns a new instance of NestedStack.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/cloud_formation_tool/cloud_formation/nested_stack.rb', line 7

def initialize(props, tpl)
  @tpl = tpl
  @data = props
  if props.key?('Template')
    path = props['Template']
    path = if path.start_with? "/" then path else "#{@tpl.basedir}/#{path}" end
    @content = CloudFormation.new(path).to_yaml
    @data['TemplateURL'] = upload(make_filename('yaml'), @content, mime_type: 'text/yaml', gzip: false)
    @data.delete('Template')
  end
end

Instance Method Details

#to_cloudformationObject



19
20
21
# File 'lib/cloud_formation_tool/cloud_formation/nested_stack.rb', line 19

def to_cloudformation
  @data
end