Sha256: b4d54401086b3cfe3351f902a1d803b7e80c71014d0db66cd620fa147619414f
Contents?: true
Size: 1.31 KB
Versions: 42
Compression:
Stored size: 1.31 KB
Contents
require 'aws-sdk' require_relative '../../util' module Builderator module Model # :nodoc: module Cleaner def self.launch_configs @launch_configs ||= LaunchConfigs.new end ## # ASG LaunchConfiguration Resources ## class LaunchConfigs < Model::Cleaner::Base PROPERTIES = %w(launch_configuration_arn key_name security_groups user_data instance_type spot_price iam_instance_profile ebs_optimized associate_public_ip_address placement_tenancy) def fetch @resources = {}.tap do |i| Util.asg.describe_launch_configurations.each do |page| page.launch_configurations.each do |l| properties = { 'creation_date' => l.created_time.to_datetime } PROPERTIES.each { |pp| properties[pp] = l[pp.to_sym] } i[l.launch_configuration_name] = { :id => l.launch_configuration_name, :properties => properties, :image => l.image_id } end end end end def images resources.values.map { |l| l[:image] } end def in_use select(Cleaner.scaling_groups.launch_configs) end end end end end
Version data entries
42 entries across 42 versions & 1 rubygems