mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
[AWS] Add helpful failure message when using wrong lb module (#40433)
Remove the default empty dict parameter for tags.
This commit is contained in:
@@ -229,6 +229,9 @@ class ApplicationLoadBalancer(ElasticLoadBalancerV2):
|
||||
self.access_logs_s3_prefix = module.params.get("access_logs_s3_prefix")
|
||||
self.idle_timeout = module.params.get("idle_timeout")
|
||||
|
||||
if self.elb is not None and self.elb['Type'] != 'application':
|
||||
self.module.fail_json(msg="The load balancer type you are trying to manage is not application. Try elb_network_lb module instead.")
|
||||
|
||||
def create_elb(self):
|
||||
"""
|
||||
Create a load balancer
|
||||
@@ -340,6 +343,9 @@ class NetworkLoadBalancer(ElasticLoadBalancerV2):
|
||||
self.type = 'network'
|
||||
self.cross_zone_load_balancing = module.params.get('cross_zone_load_balancing')
|
||||
|
||||
if self.elb is not None and self.elb['Type'] != 'network':
|
||||
self.module.fail_json(msg="The load balancer type you are trying to manage is not network. Try elb_application_lb module instead.")
|
||||
|
||||
def create_elb(self):
|
||||
"""
|
||||
Create a load balancer
|
||||
|
||||
Reference in New Issue
Block a user