I'm trying to create an application load balancer with a single listener.
That lister should have a default rule with weighted target groups.
This is how the default rule config format looks.
The error I get is
File "C:\Users**\AppData\Roaming\Python\Python36\site-packages\moto\elbv2\models.py", line 1001, in create_listener
target_group = self.target_groups[action.data["TargetGroupArn"]]
KeyError: 'TargetGroupArn'
Looking at the models.py create_listener code, it fails in this loop, where it attempts to get the TargetGroupArn attribute from action.data.
However when I step through and look at action.data it does not contain a TargetGroupArn key it contains the entire default actions list.
for action in default_actions:
if action.type == "forward":
target_group = self.target_groups[action.data["TargetGroupArn"]]
target_group.load_balancer_arns.append(load_balancer_arn)
Hi @rickbowden, thanks for raising this! Looks like we only support sending a single TargetGroupArn - will mark it as an enhancement to also support the ForwardConfig-parameter.
Python version: 3.6 Moto version: 2.2.18
I'm trying to create an application load balancer with a single listener. That lister should have a default rule with weighted target groups. This is how the default rule config format looks.
The error I get is File "C:\Users**\AppData\Roaming\Python\Python36\site-packages\moto\elbv2\models.py", line 1001, in create_listener target_group = self.target_groups[action.data["TargetGroupArn"]] KeyError: 'TargetGroupArn'
Looking at the models.py create_listener code, it fails in this loop, where it attempts to get the TargetGroupArn attribute from action.data. However when I step through and look at action.data it does not contain a TargetGroupArn key it contains the entire default actions list.