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



236
237
238
239
240
# File 'lib/sfn/planner/aws.rb', line 236

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

Instance Attribute Details

#translatorsSmash

Returns initialized translators

Returns:

  • (Smash)

    initialized translators



232
233
234
# File 'lib/sfn/planner/aws.rb', line 232

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



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/sfn/planner/aws.rb', line 248

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,
  )
  convert_to_plan(result)
end