From 126d15cc4345dc2f6c1e1f3a4a39c8c288553cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?= Date: Mon, 23 Jun 2014 10:47:22 +0200 Subject: [PATCH] Adds support for Cloudwatch detailled monitoring in ec2_lc module. Enabling detailled monitoring in the launch config is mandatory to be able to activate cloudwatch in the to be created autoscaling group. --- library/cloud/ec2_lc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/cloud/ec2_lc b/library/cloud/ec2_lc index 14d9f83bfd6..2fe0e471f63 100755 --- a/library/cloud/ec2_lc +++ b/library/cloud/ec2_lc @@ -73,6 +73,11 @@ options: - The spot price you are bidding. Only applies for an autoscaling group with spot instances. required: false default: null + instance_monitoring: + description: + - whether instances in group are launched with detailed monitoring. + required: false + default: false aliases: [] extends_documentation_fragment: aws """ @@ -133,6 +138,7 @@ def create_launch_config(connection, module): volumes = module.params['volumes'] instance_type = module.params.get('instance_type') spot_price = module.params.get('spot_price') + instance_monitoring = module.params.get('instance_monitoring') bdm = BlockDeviceMapping() if volumes: @@ -152,7 +158,8 @@ def create_launch_config(connection, module): user_data=user_data, block_device_mappings=[bdm], instance_type=instance_type, - spot_price=spot_price) + spot_price=spot_price, + instance_monitoring=instance_monitoring) launch_configs = connection.get_all_launch_configurations(names=[name]) changed = False @@ -193,6 +200,7 @@ def main(): instance_type=dict(type='str'), state=dict(default='present', choices=['present', 'absent']), spot_price=dict(type='float'), + instance_monitoring=dict(default=False, type='bool'), ) )