Sha256: 9ac88e72da60a9ed3a12d14876002fca5b666b566bc12c85ccd5b9237e28b12f
Contents?: true
Size: 1.16 KB
Versions: 19
Compression:
Stored size: 1.16 KB
Contents
require 'aws_pocketknife' require 'base64' require 'openssl' module AwsPocketknife module Asg class << self include AwsPocketknife::Common::Utils def describe_asg_by_name(name: "") asg_list = name.split(";") asg_client.describe_auto_scaling_groups({auto_scaling_group_names: asg_list, }) end def list(max_records: 100) asgs = [] resp = asg_client.describe_auto_scaling_groups({ max_records: max_records, }) asgs << resp.auto_scaling_groups next_token = resp.next_token while true break if next_token.nil? or next_token.empty? resp = get_asgs(next_token: next_token, max_records: max_records) asgs << resp.auto_scaling_groups next_token = resp.next_token end asgs.flatten! end private def get_asgs(next_token: "", max_records: 100) asg_client.describe_auto_scaling_groups({ max_records: max_records, next_token: next_token, }) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems