Module: AwsCftTools::Runbooks::Retract::Templates

Includes:
Common::Templates
Included in:
AwsCftTools::Runbooks::Retract
Defined in:
lib/aws_cft_tools/runbooks/retract/templates.rb

Overview

module with methods to manage ordering of templates

Instance Method Summary collapse

Instance Method Details

#free_templatesAwsCftTools::TemplateSet

List the templates that are available for deletion.

Templates with known dependents that are not in the set will be removed. Note that this does not capture dependencies between environments.



30
31
32
33
# File 'lib/aws_cft_tools/runbooks/retract/templates.rb', line 30

def free_templates
  set = AwsCftTools::TemplateSet.new(templates.in_folder_order(template_folder_order))
  client.templates.closed_subset(set).reverse
end

#template_folder_orderArray<String>

Returns:

  • (Array<String>)


38
39
40
# File 'lib/aws_cft_tools/runbooks/retract/templates.rb', line 38

def template_folder_order
  options[:template_folder_priorities] || []
end

#templatesAwsCftTools::TemplateSet

list the templates in-scope for this retraction



19
20
21
# File 'lib/aws_cft_tools/runbooks/retract/templates.rb', line 19

def templates
  @templates ||= filtered_templates(client.templates)
end