How to create a new LB listener default action forwarding to several target groups?

Hi,

the AWS Console allows to create new load-balancer listeners with the default action set to “forward” and associated with several target groups (with different weights). See that screenshot:

I’ve tried to have the same type of configuration using Terraform, but it looks like it’s not possible?

  • It’s possible to set a default action for a listener as “forward”, but only one target group is accepted here.
  • Adding several rules with action = forward to different target groups is similar but actually not completely as:
    1. the condition part is mandatory there;
    2. and it’s not possible to add different rules with the same priority and I didn’t any other place with this “weight” concept.

Is there something I’m missing or is it currently a limitation from Terraform (and/or the AWS API actually?)

Thanks for you help!

Jonathan

Looks as if the API’s been augmented:

// DefaultActions is a required field DefaultActions []*Action type:“list” required:“true”
https://docs.aws.amazon.com/sdk-for-go/api/service/elbv2/#CreateListenerInput