-
Notifications
You must be signed in to change notification settings - Fork 342
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
elbv2 - Fix KeyError when passing two TGs #929
elbv2 - Fix KeyError when passing two TGs #929
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
regate |
Backport to stable-3: 💚 backport PR created✅ Backport PR branch: Backported as #932 🤖 @patchback |
elbv2 - Fix KeyError when passing two TGs SUMMARY Fixes: ansible-collections/community.aws#1089 ISSUE TYPE Bugfix Pull Request COMPONENT NAME plugins/module_utils/elbv2.py ADDITIONAL INFORMATION Based on the docs, if you want to balance across multiple TGs you shouldn't pass a TargetGroupArn, and instead just the ForwardConfig. (https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/elbv2.html#ElasticLoadBalancingv2.Client.create_listener) The Amazon Resource Name (ARN) of the target group. Specify only when Type is forward and you want to route to a single target group. To route to one or more target groups, use ForwardConfig instead. However, it is also valid (but redundant) to Pass the ARN and a ForwardConfig If you specify both ForwardConfig and TargetGroupArn, you can specify only one target group using ForwardConfig and it must be the same target group specified in TargetGroupArn. Original Error: The full traceback is: Traceback (most recent call last): File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 102, in <module> _ansiballz_main() File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 94, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 40, in invoke_module runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.elb_application_lb', init_globals=None, run_name='__main__', alter_sys=True) File "/usr/lib/python3.10/runpy.py", line 209, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 821, in <module> File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 815, in main File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 653, in create_or_update_alb File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 928, in compare_rules File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 894, in _compare_rule File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 894, in <listcomp> File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 29, in _prune_ForwardConfig KeyError: 'TargetGroupArn' Reviewed-by: Alina Buzachis <None> (cherry picked from commit 0b97186)
Backport to stable-4: 💚 backport PR created✅ Backport PR branch: Backported as #933 🤖 @patchback |
elbv2 - Fix KeyError when passing two TGs SUMMARY Fixes: ansible-collections/community.aws#1089 ISSUE TYPE Bugfix Pull Request COMPONENT NAME plugins/module_utils/elbv2.py ADDITIONAL INFORMATION Based on the docs, if you want to balance across multiple TGs you shouldn't pass a TargetGroupArn, and instead just the ForwardConfig. (https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/elbv2.html#ElasticLoadBalancingv2.Client.create_listener) The Amazon Resource Name (ARN) of the target group. Specify only when Type is forward and you want to route to a single target group. To route to one or more target groups, use ForwardConfig instead. However, it is also valid (but redundant) to Pass the ARN and a ForwardConfig If you specify both ForwardConfig and TargetGroupArn, you can specify only one target group using ForwardConfig and it must be the same target group specified in TargetGroupArn. Original Error: The full traceback is: Traceback (most recent call last): File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 102, in <module> _ansiballz_main() File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 94, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 40, in invoke_module runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.elb_application_lb', init_globals=None, run_name='__main__', alter_sys=True) File "/usr/lib/python3.10/runpy.py", line 209, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 821, in <module> File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 815, in main File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 653, in create_or_update_alb File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 928, in compare_rules File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 894, in _compare_rule File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 894, in <listcomp> File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 29, in _prune_ForwardConfig KeyError: 'TargetGroupArn' Reviewed-by: Alina Buzachis <None> (cherry picked from commit 0b97186)
[PR #929/0b97186c backport][stable-3] elbv2 - Fix KeyError when passing two TGs This is a backport of PR #929 as merged into main (0b97186). SUMMARY Fixes: ansible-collections/community.aws#1089 ISSUE TYPE Bugfix Pull Request COMPONENT NAME plugins/module_utils/elbv2.py ADDITIONAL INFORMATION Based on the docs, if you want to balance across multiple TGs you shouldn't pass a TargetGroupArn, and instead just the ForwardConfig. (https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/elbv2.html#ElasticLoadBalancingv2.Client.create_listener) The Amazon Resource Name (ARN) of the target group. Specify only when Type is forward and you want to route to a single target group. To route to one or more target groups, use ForwardConfig instead. However, it is also valid (but redundant) to Pass the ARN and a ForwardConfig If you specify both ForwardConfig and TargetGroupArn, you can specify only one target group using ForwardConfig and it must be the same target group specified in TargetGroupArn. Original Error: The full traceback is: Traceback (most recent call last): File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 102, in <module> _ansiballz_main() File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 94, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 40, in invoke_module runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.elb_application_lb', init_globals=None, run_name='__main__', alter_sys=True) File "/usr/lib/python3.10/runpy.py", line 209, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 821, in <module> File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 815, in main File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 653, in create_or_update_alb File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 928, in compare_rules File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 894, in _compare_rule File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 894, in <listcomp> File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 29, in _prune_ForwardConfig KeyError: 'TargetGroupArn' Reviewed-by: Mark Chappell <None>
[PR #929/0b97186c backport][stable-4] elbv2 - Fix KeyError when passing two TGs This is a backport of PR #929 as merged into main (0b97186). SUMMARY Fixes: ansible-collections/community.aws#1089 ISSUE TYPE Bugfix Pull Request COMPONENT NAME plugins/module_utils/elbv2.py ADDITIONAL INFORMATION Based on the docs, if you want to balance across multiple TGs you shouldn't pass a TargetGroupArn, and instead just the ForwardConfig. (https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/elbv2.html#ElasticLoadBalancingv2.Client.create_listener) The Amazon Resource Name (ARN) of the target group. Specify only when Type is forward and you want to route to a single target group. To route to one or more target groups, use ForwardConfig instead. However, it is also valid (but redundant) to Pass the ARN and a ForwardConfig If you specify both ForwardConfig and TargetGroupArn, you can specify only one target group using ForwardConfig and it must be the same target group specified in TargetGroupArn. Original Error: The full traceback is: Traceback (most recent call last): File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 102, in <module> _ansiballz_main() File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 94, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/alex/.ansible/tmp/ansible-tmp-1650531340.4967074-29141-25081229266719/AnsiballZ_elb_application_lb.py", line 40, in invoke_module runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.elb_application_lb', init_globals=None, run_name='__main__', alter_sys=True) File "/usr/lib/python3.10/runpy.py", line 209, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 821, in <module> File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 815, in main File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/community/aws/plugins/modules/elb_application_lb.py", line 653, in create_or_update_alb File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 928, in compare_rules File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 894, in _compare_rule File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 894, in <listcomp> File "/tmp/ansible_community.aws.elb_application_lb_payload_dy92ctf5/ansible_community.aws.elb_application_lb_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/elbv2.py", line 29, in _prune_ForwardConfig KeyError: 'TargetGroupArn' Reviewed-by: Mark Chappell <None>
SUMMARY
Fixes: ansible-collections/community.aws#1089
ISSUE TYPE
COMPONENT NAME
plugins/module_utils/elbv2.py
ADDITIONAL INFORMATION
Based on the docs, if you want to balance across multiple TGs you shouldn't pass a TargetGroupArn, and instead just the ForwardConfig. (https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/elbv2.html#ElasticLoadBalancingv2.Client.create_listener)
However, it is also valid (but redundant) to Pass the ARN and a ForwardConfig
Original Error: