From b43b1bdaaf46303fd4006802266d515bb5ba6a73 Mon Sep 17 00:00:00 2001 From: Mandar Kulkarni Date: Fri, 3 Jun 2022 00:15:10 -0700 Subject: [PATCH] [WIP] elb_classic_lb: fix return value _format_listener method to include SSLCertificateId (#860) [WIP] elb_classic_lb: fix return value _format_listener method to include SSLCertificateId SUMMARY Fixes #686. Current return value of _format_listener method does not include SSLCertificateId even if it is provided in the playbook, causing the failure as reported in above mentioned issue. Sample return value: {'InstancePort': 8080, 'InstanceProtocol': 'HTTP', 'LoadBalancerPort': 443, 'Protocol': 'HTTPS'} This can be fixed by modifying the return value of _format_listener method to formatted_listener, which includes SSLCertificateId if provided in the playbook. Sample return Value: {'InstancePort': 8080, 'InstanceProtocol': 'HTTP', 'LoadBalancerPort': 443, 'Protocol': 'HTTPS', 'SSLCertificateId': 'arn:aws:acm:us-east-1:1234...'} ISSUE TYPE Bugfix Pull Request COMPONENT NAME elb_classic_lb Reviewed-by: Mark Chappell --- .../fragments/860-elb_classic_lb-create-https-listeners.yml | 2 ++ plugins/modules/elb_classic_lb.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/860-elb_classic_lb-create-https-listeners.yml diff --git a/changelogs/fragments/860-elb_classic_lb-create-https-listeners.yml b/changelogs/fragments/860-elb_classic_lb-create-https-listeners.yml new file mode 100644 index 00000000000..5d2ba07a30a --- /dev/null +++ b/changelogs/fragments/860-elb_classic_lb-create-https-listeners.yml @@ -0,0 +1,2 @@ +bugfixes: +- elb_classic_lb - modify the return value of _format_listeners method to resolve a failure creating https listeners (https://github.com/ansible-collections/amazon.aws/pull/860). diff --git a/plugins/modules/elb_classic_lb.py b/plugins/modules/elb_classic_lb.py index 44f697ab89a..20ba0c36f12 100644 --- a/plugins/modules/elb_classic_lb.py +++ b/plugins/modules/elb_classic_lb.py @@ -890,7 +890,7 @@ def _format_listener(self, listener, inject_protocol=False): if ssl_id: formatted_listener['SSLCertificateId'] = ssl_id - return snake_dict_to_camel_dict(listener, True) + return formatted_listener def _format_healthcheck_target(self): """Compose target string from healthcheck parameters"""