diff --git a/lib/ansible/modules/cloud/amazon/elb_target_group.py b/lib/ansible/modules/cloud/amazon/elb_target_group.py index eb5918e259..26a0407f0f 100644 --- a/lib/ansible/modules/cloud/amazon/elb_target_group.py +++ b/lib/ansible/modules/cloud/amazon/elb_target_group.py @@ -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: