2
votes

I'm using Ansible to configure AWS Auto Scaling Groups (ASG). Looking at the ec2_asg_module options, there's none for enabling Monitoring in cloudWatch. However, that option can be enabled either form the AWS CLI or the AWS Console.

In the Console, it is labeled as "Group Metric Collection". Keep in mind that I do not want to monitor the EC2 instances, but the Auto Scaling Group itself.

Thank you.

1

1 Answers

2
votes

I submitted a PR last year to add 2 AWS modules : boto3 and boto3_wait.

These 2 modules allow you to interact with AWS API using boto3.

For instance, you could enable group metrics on the ASG by calling enable_metrics_collection method on AutoScaling service :

- name: Enable group metrics
  boto3:
    service: autoscaling
    region: us-east-1
    operation: enable_metrics_collection
    parameters:
      AutoScalingGroupName: my-auto-scaling-group
      Granularity: 1Minute

Feel free to give the PR a thumbs-up if you like it! ;)