diff --git a/controllers/provisioners/eks/cloud.go b/controllers/provisioners/eks/cloud.go index f14b4690..1131041c 100644 --- a/controllers/provisioners/eks/cloud.go +++ b/controllers/provisioners/eks/cloud.go @@ -171,6 +171,12 @@ func (ctx *EksInstanceGroupContext) CloudDiscovery() error { vpcID := aws.StringValue(cluster.ResourcesVpcConfig.VpcId) state.SetVPCId(vpcID) + instanceTypes, err := ctx.AwsWorker.DescribeInstanceTypes() + if err != nil { + return errors.Wrap(err, "failed to discover instance types") + } + state.SetInstanceTypeInfo(instanceTypes) + // find all owned scaling groups ownedScalingGroups := ctx.findOwnedScalingGroups(scalingGroups) state.SetOwnedScalingGroups(ownedScalingGroups) @@ -206,12 +212,6 @@ func (ctx *EksInstanceGroupContext) CloudDiscovery() error { status.SetCurrentMin(int(aws.Int64Value(targetScalingGroup.MinSize))) status.SetCurrentMax(int(aws.Int64Value(targetScalingGroup.MaxSize))) - instanceTypes, err := ctx.AwsWorker.DescribeInstanceTypes() - if err != nil { - return errors.Wrap(err, "failed to discover instance types") - } - state.SetInstanceTypeInfo(instanceTypes) - if spec.IsLaunchConfiguration() { state.ScalingConfiguration, err = scaling.NewLaunchConfiguration(instanceGroup.NamespacedName(), ctx.AwsWorker, &scaling.DiscoverConfigurationInput{