elb_target_group: use port parameter as default for target port (#38578) (#38992)

The docs suggest that `port` parameter is the default port upon
which targets listen. As such, a target need only provide a `Port`
key to override the default.

(cherry picked from commit dc09ddfbd5)
pull/39086/head
Will Thames 7 years ago committed by Sloane Hertel
parent 2b985137d7
commit 4d95f467f5

@ -502,7 +502,7 @@ def create_or_update_target_group(connection, module):
instances_to_add = []
for target in params['Targets']:
if target['Id'] in add_instances:
instances_to_add.append({'Id': target['Id'], 'Port': int(target['Port'])})
instances_to_add.append({'Id': target['Id'], 'Port': int(target.get('Port', module.params.get('port')))})
changed = True
try:

Loading…
Cancel
Save