Terraform ALB Listeners with multiple routing rules

1,548 views
Skip to first unread message

Bobby M.

unread,
Jan 9, 2018, 7:37:07 PM1/9/18
to Terraform
Hello, 

Searching the documentation for the aws_lb_listener resource I see I can define a default action, to target  a single target group ARN.

Looking at the source code:

It appears I can't specify more than 1 routing rule to an ALB yet.  Is this the case?  I only see the defintion of a map for a default action, and not a series of actions. 
If I'm wrong can I see an example of multiple routing rules pointing to different target groups?

Thanks in advance

-Bobby

David Adams

unread,
Jan 9, 2018, 7:50:41 PM1/9/18
to terrafo...@googlegroups.com
Listener rules are a separate resource: https://www.terraform.io/docs/providers/aws/r/lb_listener_rule.html

This allows you to decouple the definition of the rules to a different project or different set of logic, and also matches the actual AWS API for these resources, which treats them as a separate resource.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/572724f8-9616-46ff-8e3d-c7d1c11a5c5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bobby M.

unread,
Jan 9, 2018, 7:54:50 PM1/9/18
to Terraform
This is exactly what I needed.  Thanks David!



On Tuesday, January 9, 2018 at 4:50:41 PM UTC-8, David Adams wrote:
Listener rules are a separate resource: https://www.terraform.io/docs/providers/aws/r/lb_listener_rule.html

This allows you to decouple the definition of the rules to a different project or different set of logic, and also matches the actual AWS API for these resources, which treats them as a separate resource.
On Tue, Jan 9, 2018 at 6:37 PM, Bobby M. <bmes...@gmail.com> wrote:
Hello, 

Searching the documentation for the aws_lb_listener resource I see I can define a default action, to target  a single target group ARN.

Looking at the source code:

It appears I can't specify more than 1 routing rule to an ALB yet.  Is this the case?  I only see the defintion of a map for a default action, and not a series of actions. 
If I'm wrong can I see an example of multiple routing rules pointing to different target groups?

Thanks in advance

-Bobby

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages