Class: Sfn::Planner::Aws

Inherits:
Sfn::Planner show all
Defined in:
lib/sfn/planner/aws.rb

Overview

AWS specific planner

Defined Under Namespace

Classes: Translator

Constant Summary collapse

REPLACE_ON_CFN_INIT_UPDATE =

Resources that will be replaced on metadata init updates

[
  'AWS::AutoScaling::LaunchConfiguration',
  'AWS::EC2::Instance'
]

Constants inherited from Sfn::Planner

RUNTIME_MODIFIED

Instance Attribute Summary collapse

Attributes inherited from Sfn::Planner

#arguments, #config, #options, #origin_stack, #ui

Instance Method Summary collapse

Constructor Details

#initialize(*_) ⇒ Aws

Simple overload to load in aws resource set from sparkleformation



124
125
126
127
128
# File 'lib/sfn/planner/aws.rb', line 124

def initialize(*_)
  super
  SfnAws.load!
  @translators = Smash.new
end

Instance Attribute Details

#translatorsSmash

Returns initialized translators.

Returns:

  • (Smash)

    initialized translators



120
121
122
# File 'lib/sfn/planner/aws.rb', line 120

def translators
  @translators
end

Instance Method Details

#generate_plan(template, parameters) ⇒ Hash

Generate update report

Parameters:

  • template (Hash)

    updated template

  • parameters (Hash)

    runtime parameters for update

Returns:

  • (Hash)

    report



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/sfn/planner/aws.rb', line 136

def generate_plan(template, parameters)
  parameters = Smash[parameters.map{|k,v| [k, v.to_s]}]
  result = Smash.new(
    :stacks => Smash.new(
      origin_stack.name => plan_stack(
        origin_stack,
        template,
        parameters
      )
    ),
    :added => Smash.new,
    :removed => Smash.new,
    :replace => Smash.new,
    :interrupt => Smash.new,
    :unavailable => Smash.new,
    :unknown => Smash.new
  )
  result
end