Skip to content

Commit 1f002c0

Browse files
sodreactions-bot
andauthored
Add load balacing algorithm type (cloudposse#41)
* Add load balacing algorithm type * Updated README.md * Fix terraform lint issue Co-authored-by: actions-bot <[email protected]>
1 parent d61e4f7 commit 1f002c0

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ Available targets:
240240
| id\_length\_limit | Limit `id` to this many characters.<br>Set to `0` for unlimited length.<br>Set to `null` for default, which is `0`.<br>Does not affect `id_full`. | `number` | `null` | no |
241241
| label\_order | The naming order of the id output and Name tag.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 5 elements, but at least one must be present. | `list(string)` | `null` | no |
242242
| listener\_http\_header\_conditions | A list of http header conditions to apply to the listener. | <pre>list(object({<br> name = string<br> value = list(string)<br> }))</pre> | `[]` | no |
243+
| load\_balancing\_algorithm\_type | Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is round\_robin or least\_outstanding\_requests. The default is round\_robin. | `string` | `"round_robin"` | no |
243244
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
244245
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |
245246
| port | The port for the created ALB target group (if `target_group_arn` is not set) | `number` | `80` | no |

docs/terraform.md

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
| id\_length\_limit | Limit `id` to this many characters.<br>Set to `0` for unlimited length.<br>Set to `null` for default, which is `0`.<br>Does not affect `id_full`. | `number` | `null` | no |
5757
| label\_order | The naming order of the id output and Name tag.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 5 elements, but at least one must be present. | `list(string)` | `null` | no |
5858
| listener\_http\_header\_conditions | A list of http header conditions to apply to the listener. | <pre>list(object({<br> name = string<br> value = list(string)<br> }))</pre> | `[]` | no |
59+
| load\_balancing\_algorithm\_type | Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is round\_robin or least\_outstanding\_requests. The default is round\_robin. | `string` | `"round_robin"` | no |
5960
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
6061
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |
6162
| port | The port for the created ALB target group (if `target_group_arn` is not set) | `number` | `80` | no |

main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ resource "aws_lb_target_group" "default" {
2323

2424
deregistration_delay = var.deregistration_delay
2525

26+
load_balancing_algorithm_type = var.load_balancing_algorithm_type
27+
2628
stickiness {
2729
type = var.stickiness_type
2830
cookie_duration = var.stickiness_cookie_duration

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ variable "deregistration_delay" {
4949
description = "The amount of time to wait in seconds while deregistering target"
5050
}
5151

52+
variable "load_balancing_algorithm_type" {
53+
type = string
54+
default = "round_robin"
55+
description = "Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is round_robin or least_outstanding_requests. The default is round_robin."
56+
}
57+
5258
variable "health_check_enabled" {
5359
type = bool
5460
default = true

0 commit comments

Comments
 (0)