Getting AutoScaling Groups using resource_arns

I’m using the CloudWatch datasource and attempting to use the resource_arns query to get a list of autoscaling groups but I can’t seem to get the syntax right.

image

Has anyone successfully done this?

Do you need to use resource_arns and then regexp? Try dimension_values, e.g.:

dimension_values($region, AWS/AutoScaling, GroupTotalInstances, AutoScalingGroupName, [filters])

I’m attempting to use resource_arns because I can then get a list of scaling groups based on a tag.
That way I can get groups that only our team look after, and not all groups in the same account.

Filters are also supported in dimension_values, so you can filter by tag Team.

I tried every syntax I could think of but still couldn’t get it to return any results.

Did you try this syntax?:

dimension_values($region, AWS/AutoScaling, GroupTotalInstances, AutoScalingGroupName,{\"tag:Team\": [\"myteam\"]}

dimension_values($region, AWS/AutoScaling, GroupTotalInstances, AutoScalingGroupName, {“tag:Team”: [“myteam”]})

Gives me the error
Template variables could not be initialized: Unexpected token \ in JSON at position 1

dimension_values($region, AWS/AutoScaling, GroupTotalInstances, AutoScalingGroupName, {“tag:Team”: [“myteam”]})

Gives me the error
Template variables could not be initialized: e.replace is not a function

I’ve also tried the following but get no results or errors.

dimension_values($region, AWS/AutoScaling, GroupTotalInstances, AutoScalingGroupName, {“tag:Team”: “myteam”})
dimension_values($region, AWS/AutoScaling, GroupTotalInstances, AutoScalingGroupName, {“Team”: [“myteam”]})
dimension_values($region, AWS/AutoScaling, GroupTotalInstances, AutoScalingGroupName, {“Team”: “myteam”})