[cloud][aws] Add metrics_collection options to ec2_asg module (#35180)

* Added metrics_collection management to ec2_asg module to switch ASG metrics on and off.

* Fixed typo in documentation of ec2_asg module

* Removed extra blank line in ec2_asg.py

* Docs fixes for ec2_asg module

* Added integration test for ec2_asg metrics flag

* Trying different syntax for ec2_asg test
This commit is contained in:
Stefan Horning 2018-02-12 16:22:18 +01:00 committed by Ryan Brown
commit 404f9260d9
2 changed files with 84 additions and 1 deletions

View file

@ -208,6 +208,31 @@
that:
- "output.viable_instances == 0"
- name: kill asg
ec2_asg:
name: "{{ resource_prefix }}-asg"
state: absent
<<: *aws_connection_info
async: 300
# ============================================================
- name: create asg with asg metrics enabled
ec2_asg:
name: "{{ resource_prefix }}-asg"
metrics_collection: true
launch_config_name: "{{ resource_prefix }}-lc"
desired_capacity: 0
min_size: 0
max_size: 0
vpc_zone_identifier: "{{ testing_subnet.subnet.id }}"
state: present
<<: *aws_connection_info
register: output
- assert:
that:
- "'Group' in output.metrics_collection.0.Metric"
- name: kill asg
ec2_asg:
name: "{{ resource_prefix }}-asg"