-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Hi,
if you have Null values in some "LaunchTemplateName" fields then you get the following error when trying to add Existing Auto-Scaling Groups to the monitoring:
jq: error (at <stdin>:6896): null (null) and string ("Batch-lt") cannot have their containment checked
A possible workaround could be:
aws autoscaling describe-auto-scaling-groups | jq -c '.AutoScalingGroups[] | select( .MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.LaunchTemplateName != null) |select(.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.LaunchTemplateName | contains("Batch-lt")) | .AutoScalingGroupName' | xargs -t -I {} aws autoscaling enable-metrics-collection --metrics GroupInServiceCapacity GroupDesiredCapacity GroupInServiceInstances --granularity "1Minute" --auto-scaling-group-name {}
(this command would replace the one in the readme.md)
Regards