From 776eabe9abff62d1c492d901ef988cb68a75fa44 Mon Sep 17 00:00:00 2001 From: Matt DeBoer Date: Tue, 8 Aug 2017 11:25:42 -0700 Subject: [PATCH] better error message when no ASG found for name --- pkg/platform/aws/aws.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/platform/aws/aws.go b/pkg/platform/aws/aws.go index cac1fcc..ed2b016 100644 --- a/pkg/platform/aws/aws.go +++ b/pkg/platform/aws/aws.go @@ -119,6 +119,10 @@ func (a *AWS) getASGInstanceIDs(sess *session.Session, asgName string) ([]*strin return nil, err } + if resp.AutoScalingGroups == nil || len(resp.AutoScalingGroups) == 0 { + return nil, fmt.Errorf("No autoscaling groups were found matching the name '%s'", asgName) + } + instanceIDs := make([]*string, 0, len(resp.AutoScalingGroups[0].Instances)) for _, i := range resp.AutoScalingGroups[0].Instances { instanceIDs = append(instanceIDs, i.InstanceId)