private AutoScalingGroup retrieveAutoScalingGroup ( String asgName ) { if ( Strings . isNullOrEmpty ( asgName ) ) { logger . warn ( "null asgName specified, not attempting to retrieve AutoScalingGroup from AWS" ) ; return null ; } // You can pass one name or a list of names in the request DescribeAutoScalingGroupsRequest request = new DescribeAutoScalingGroupsRequest ( ) . withAutoScalingGroupNames ( asgName ) ; DescribeAutoScalingGroupsResult result = awsClient . describeAutoScalingGroups ( request ) ; List < AutoScalingGroup > asgs = result . getAutoScalingGroups ( ) ; if ( asgs . isEmpty ( ) ) { return null ; } else { return asgs . get ( 0 ) ; } }
Queries AWS to get the autoscaling information given the asgName .