Load Balancer Target Group Module
This module can be used to create a Target Group and Listener Rules for an Application Load Balancer created with the alb module.
The reason the load-balancer-alb-target-group
module is separate is that you may wish to create multiple target groups
for a single load balancer.
See the examples folder for fully working sample code.
Reference
- Inputs
- Outputs
Required
health_check_path
stringThe path to use for health check requests.
The starting priority for the Listener Rules
port
numberThe port the servers are listening on for requests.
target_group_name
stringThe name to use for the Target Group
Whether we're using an ASG or Gruntwork's Server Group module. If using ASG, then asg_name
must be specified. Otherwise leave it blank
vpc_id
stringThe ID of the VPC in which to deploy the Target Group
Optional
asg_name
stringThe name of the ASG (ASG) in the servers are deployed. Leave this blank if using with a Server Group
null
deregistration_delay
numberThe amount time for the Load Balancer to wait before changing the state of a deregistering server from draining to unused. The range is 0-3600 seconds.
300
Set to true to enable stickiness, so a given user always gets routed to the same server. We recommend enabling this for the Couchbase Web Console.
false
The number of times the health check must pass before a server is considered healthy.
2
health_check_interval
numberThe approximate amount of time, in seconds, between health checks of each server. Minimum value 5 seconds, Maximum value 300 seconds.
30
health_check_matcher
stringThe HTTP codes to use when checking for a successful response from a server. You can specify multiple comma-separated values (for example, '200,202') or a range of values (for example, '200-299').
"200"
health_check_timeout
numberThe amount of time, in seconds, during which no response from a server means a failed health check. Must be between 2 and 60 seconds.
5
The number of times the health check must fail before a server is considered unhealthy.
2
http_listener_arns
list(string)The HTTP ARNs of ALB listeners to which Listener Rules that route to this Target Group should be added.
[]
https_listener_arns
list(string)The HTTPS ARNs of ALB listeners to which Listener Rules that route to this Target Group should be added.
[]
num_http_listener_arns
numberThe number of HTTP ARNs in listener_arns
. We should be able to compute this automatically, but due to a Terraform limitation, if there are any dynamic resources in listener_arns
, then we won't be able to: https://github.com/hashicorp/terraform/pull/11482
0
num_https_listener_arns
numberThe number of HTTPS ARNs in listener_arns
. We should be able to compute this automatically, but due to a Terraform limitation, if there are any dynamic resources in listener_arns
, then we won't be able to: https://github.com/hashicorp/terraform/pull/11482
0
protocol
stringThe protocol to use to talk to the servers. Must be one of: HTTP, HTTPS.
"HTTP"
routing_condition
list(object(…))This variable defines the paths or domain names that will be routed to the servers. By default, we route all paths and domain names to the servers. To override this, you should pass in a list of maps, where each map has the keys field and values. See the Condition Blocks documentation for the syntax to use: https://www.terraform.io/docs/providers/aws/r/lb_listener_rule.html.
list(object({
field = string
values = list(string)
}))
[
{
field = "path-pattern",
values = [
"*"
]
}
]
The time period, in seconds, during which requests from a client should be routed to the same target. After this time period expires, the load balancer-generated cookie is considered stale. The range is 1 second to 1 week (604800 seconds). Only used if enable_stickiness
is true.
86400