Skip to content

Commit

Permalink
Only return mixed_instances_policy_full if set
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHenner committed Sep 21, 2020
1 parent 63faea0 commit 8898aa1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/modules/ec2_asg.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,12 @@
type: int
sample: 1
mixed_instances_policy:
description: Returns the list of instance types if a mixed instance policy is set.
description: Returns the list of instance types if a mixed instances policy is set.
returned: success
type: list
sample: ["t3.micro", "t3a.micro"]
mixed_instances_policy_full:
description: Returns the full dictionary representation of the mixed instances policy.
description: Returns the full dictionary representation of the mixed instances policy if a mixed instances policy is set.
returned: success
type: dict
sample: {
Expand Down Expand Up @@ -828,8 +828,8 @@ def get_properties(autoscaling_group):
properties['target_group_arns'] = autoscaling_group.get('TargetGroupARNs')
properties['vpc_zone_identifier'] = autoscaling_group.get('VPCZoneIdentifier')
raw_mixed_instance_object = autoscaling_group.get('MixedInstancesPolicy')
properties['mixed_instances_policy_full'] = camel_dict_to_snake_dict(autoscaling_group.get('MixedInstancesPolicy'))
if raw_mixed_instance_object:
properties['mixed_instances_policy_full'] = camel_dict_to_snake_dict(raw_mixed_instance_object)
properties['mixed_instances_policy'] = [x['InstanceType'] for x in raw_mixed_instance_object.get('LaunchTemplate').get('Overrides')]

metrics = autoscaling_group.get('EnabledMetrics')
Expand Down

0 comments on commit 8898aa1

Please sign in to comment.