Skip to content

Commit

Permalink
elb_target_group: do not modify module.params structure
Browse files Browse the repository at this point in the history
Adjust the logic to avoid the modification of `module.params` structure.
  • Loading branch information
goneri committed Oct 25, 2022
1 parent fa58965 commit d108aaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- "elb_target_group - Document the fact target_type default value is ``instance`` (https://github.com/ansible-collections/community.aws/pull/1567)."
6 changes: 2 additions & 4 deletions plugins/modules/elb_target_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
- The default behavior is C(instance).
required: false
choices: ['instance', 'ip', 'lambda', 'alb']
default: instance
type: str
targets:
description:
Expand Down Expand Up @@ -923,7 +924,7 @@ def main():
state=dict(required=True, choices=['present', 'absent']),
successful_response_codes=dict(),
tags=dict(type='dict', aliases=['resource_tags']),
target_type=dict(choices=['instance', 'ip', 'lambda', 'alb']),
target_type=dict(choices=['instance', 'ip', 'lambda', 'alb'], default="instance"),
targets=dict(type='list', elements='dict'),
unhealthy_threshold_count=dict(type='int'),
vpc_id=dict(),
Expand All @@ -944,9 +945,6 @@ def main():

module = AnsibleAWSModule(argument_spec=argument_spec, required_by=required_by, required_if=required_if)

if module.params.get('target_type') is None:
module.params['target_type'] = 'instance'

connection = module.client('elbv2', retry_decorator=AWSRetry.jittered_backoff(retries=10))

if module.params.get('state') == 'present':
Expand Down

0 comments on commit d108aaa

Please sign in to comment.