Method: Sfn::CommandModule::Stack::InstanceMethods#apply_nested_stacks!

Defined in:
lib/sfn/command_module/stack.rb

#apply_nested_stacks!(remote_stack, stack) ⇒ Miasma::Models::Orchestration::Stack

Detect nested stacks and apply

Parameters:

  • remote_stack (Miasma::Models::Orchestration::Stack)

    stack to inspect for nested stacks

  • stack (Miasma::Models::Orchestration::Stack)

    current stack

Returns:

  • (Miasma::Models::Orchestration::Stack)


49
50
51
52
53
54
55
56
57
58
59
# File 'lib/sfn/command_module/stack.rb', line 49

def apply_nested_stacks!(remote_stack, stack)
  remote_stack.resources.all.each do |resource|
    if valid_stack_types.include?(resource.type)
      nested_stack = resource.expand
      apply_nested_stacks!(nested_stack, stack)
      mappings = generate_custom_apply_mappings(nested_stack)
      execute_apply_stack(nested_stack, stack, mappings)
    end
  end
  stack
end