-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
community.aws.elb_target_group ignoring targets.AvailabilityZone 'all' param #1736
Comments
The property this might be a hotfix diff --git a/plugins/modules/elb_target_group.py b/plugins/modules/elb_target_group.py
index 784fa143..cd2f4162 100644
--- a/plugins/modules/elb_target_group.py
+++ b/plugins/modules/elb_target_group.py
@@ -731,7 +731,10 @@ 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': target['Port']})
+ tmp = {'Id': target['Id'], 'Port': target['Port']}
+ if target.get('AvailabilityZone'):
+ tmp['AvailabilityZone'] = target['AvailabilityZone']
+ instances_to_add.append(tmp)
changed = True
try: @octavian2204 do you have some time to test this hotfix or to work on this bug and contribute a proper fix? |
@markuman thx a lot for your effort. Unfortunately, will not be able to do it today. Maybe tomorrow. Will keep you in touch. |
Hi @markuman, your hotfix worked like a charm! Thank you! |
elb_target_group: fix lost property AvailabilityZone SUMMARY Closes #1736 ISSUE TYPE Bugfix Pull Request COMPONENT NAME elb_target_group Reviewed-by: Mark Chappell Reviewed-by: Alina Buzachis Reviewed-by: Markus Bergholz <[email protected]>
elb_target_group: fix lost property AvailabilityZone SUMMARY Closes #1736 ISSUE TYPE Bugfix Pull Request COMPONENT NAME elb_target_group Reviewed-by: Mark Chappell Reviewed-by: Alina Buzachis Reviewed-by: Markus Bergholz <[email protected]> (cherry picked from commit d8362a0)
[PR #1767/d8362a0e backport][stable-5] elb_target_group: fix lost property AvailabilityZone This is a backport of PR #1767 as merged into main (d8362a0). SUMMARY Closes #1736 ISSUE TYPE Bugfix Pull Request COMPONENT NAME elb_target_group Reviewed-by: Markus Bergholz <[email protected]>
Summary
Having ALB in vpc-1 and targets in vpc-2 I am getting the error (despite that the targets.AvailabilityZone is set to 'all'):
"Couldn't register targets: An error occurred (ValidationError) when calling the RegisterTargets operation: You must specify a valid Availability Zone or select 'all' for all enabled Availability zones, since the IP address '192.168.112.221' is outside the VPC"
The ALB has Cross-zone load balancing enabled (On).
Despite that the module is failing, the TG is being created with no targets. If register the target manually (from AWS console) the module will report OK:
ok: [lvt00] => {
"changed": false,
...
}
Issue Type
Bug Report
Component Name
elb_target_group
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
ProductName: macOS
ProductVersion: 13.1
BuildVersion: 22C65
Steps to Reproduce
Expected Results
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: