1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[cloud] Bring return parameters for name/arn and subnet ID back to ec2_asg module (#33775)

* Readded vital return parameters to the ec2_asg that have been spared for no obvious reason

* Fix typo in ec2_asg docs

* Fixing another typo in ec2_asg docs.
This commit is contained in:
Stefan Horning 2017-12-13 16:45:34 +01:00 committed by Ryan Brown
parent dfb2f346d8
commit e55efc547c

View file

@ -246,6 +246,28 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
--- ---
auto_scaling_group_name:
description: The unique name of the auto scaling group
returned: success
type: str
sample: "myasg"
auto_scaling_group_arn:
description: The unique ARN of the autoscaling group
returned: success
type: str
sample: "arn:aws:autoscaling:us-east-1:123456789012:autoScalingGroup:6a09ad6d-eeee-1234-b987-ee123ced01ad:autoScalingGroupName/myasg"
availability_zones:
description: The availability zones for the auto scaling group
returned: success
type: list
sample: [
"us-east-1d"
]
created_time:
description: Timestamp of create time of the auto scaling group
returned: success
type: str
sample: "2017-11-08T14:41:48.272000+00:00"
default_cooldown: default_cooldown:
description: The default cooldown time in seconds. description: The default cooldown time in seconds.
returned: success returned: success
@ -372,6 +394,11 @@ viable_instances:
returned: success returned: success
type: int type: int
sample: 1 sample: 1
vpc_zone_identifier:
description: VPC zone ID / subnet id for the auto scaling group
returned: success
type: str
sample: "subnet-a31ef45f"
''' '''
import time import time
@ -537,6 +564,11 @@ def get_properties(autoscaling_group):
properties['pending_instances'] += 1 properties['pending_instances'] += 1
else: else:
properties['instances'] = [] properties['instances'] = []
properties['auto_scaling_group_name'] = autoscaling_group.get('AutoScalingGroupName')
properties['auto_scaling_group_arn'] = autoscaling_group.get('AutoScalingGroupARN')
properties['availability_zones'] = autoscaling_group.get('AvailabilityZones')
properties['created_time'] = autoscaling_group.get('CreatedTime')
properties['instance_facts'] = instance_facts properties['instance_facts'] = instance_facts
properties['load_balancers'] = autoscaling_group.get('LoadBalancerNames') properties['load_balancers'] = autoscaling_group.get('LoadBalancerNames')
properties['launch_config_name'] = autoscaling_group.get('LaunchConfigurationName') properties['launch_config_name'] = autoscaling_group.get('LaunchConfigurationName')
@ -550,6 +582,8 @@ def get_properties(autoscaling_group):
properties['default_cooldown'] = autoscaling_group.get('DefaultCooldown') properties['default_cooldown'] = autoscaling_group.get('DefaultCooldown')
properties['termination_policies'] = autoscaling_group.get('TerminationPolicies') properties['termination_policies'] = autoscaling_group.get('TerminationPolicies')
properties['target_group_arns'] = autoscaling_group.get('TargetGroupARNs') properties['target_group_arns'] = autoscaling_group.get('TargetGroupARNs')
properties['vpc_zone_identifier'] = autoscaling_group.get('VPCZoneIdentifier')
if properties['target_group_arns']: if properties['target_group_arns']:
region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True) region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True)
elbv2_connection = boto3_conn(module, elbv2_connection = boto3_conn(module,