Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add alb_ingress_load_balancing_anomaly_mitigation #293

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ Available targets:
| <a name="input_alb_ingress_healthcheck_protocol"></a> [alb\_ingress\_healthcheck\_protocol](#input\_alb\_ingress\_healthcheck\_protocol) | The protocol to use to connect with the target. Defaults to `HTTP`. Not applicable when `target_type` is `lambda` | `string` | `"HTTP"` | no |
| <a name="input_alb_ingress_listener_authenticated_priority"></a> [alb\_ingress\_listener\_authenticated\_priority](#input\_alb\_ingress\_listener\_authenticated\_priority) | The priority for the rules with authentication, between 1 and 50000 (1 being highest priority). Must be different from `alb_ingress_listener_unauthenticated_priority` since a listener can't have multiple rules with the same priority | `number` | `300` | no |
| <a name="input_alb_ingress_listener_unauthenticated_priority"></a> [alb\_ingress\_listener\_unauthenticated\_priority](#input\_alb\_ingress\_listener\_unauthenticated\_priority) | The priority for the rules without authentication, between 1 and 50000 (1 being highest priority). Must be different from `alb_ingress_listener_authenticated_priority` since a listener can't have multiple rules with the same priority | `number` | `1000` | no |
| <a name="input_alb_ingress_load_balancing_algorithm_type"></a> [alb\_ingress\_load\_balancing\_algorithm\_type](#input\_alb\_ingress\_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 |
| <a name="input_alb_ingress_load_balancing_algorithm_type"></a> [alb\_ingress\_load\_balancing\_algorithm\_type](#input\_alb\_ingress\_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, least\_outstanding\_requests or weighted\_random. The default is round\_robin. | `string` | `"round_robin"` | no |
| <a name="input_alb_ingress_load_balancing_anomaly_mitigation"></a> [alb\_ingress\_load\_balancing\_anomaly\_mitigation](#input\_alb\_ingress\_load\_balancing\_anomaly\_mitigation) | Determines whether to enable target anomaly mitigation. Only supported by the weighted\_random load balancing algorithm type. Valid values are 'on' or 'off'. | `string` | `"off"` | no |
| <a name="input_alb_ingress_protocol"></a> [alb\_ingress\_protocol](#input\_alb\_ingress\_protocol) | The protocol for the created ALB target group (if target\_group\_arn is not set). One of `HTTP`, `HTTPS`. Defaults to `HTTP`. | `string` | `"HTTP"` | no |
| <a name="input_alb_ingress_protocol_version"></a> [alb\_ingress\_protocol\_version](#input\_alb\_ingress\_protocol\_version) | The protocol version. One of `HTTP1`, `HTTP2`, `GRPC`. Only applicable when protocol is HTTP or HTTPS. Specify GRPC to send requests to targets using gRPC. Specify HTTP2 to send requests to targets using HTTP/2. The default is `HTTP1`, which sends requests to targets using HTTP/1.1 | `string` | `"HTTP1"` | no |
| <a name="input_alb_ingress_target_group_arn"></a> [alb\_ingress\_target\_group\_arn](#input\_alb\_ingress\_target\_group\_arn) | Existing ALB target group ARN. If provided, set `alb_ingress_enable_default_target_group` to `false` to disable creation of the default target group | `string` | `""` | no |
Expand Down
3 changes: 2 additions & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
| <a name="input_alb_ingress_healthcheck_protocol"></a> [alb\_ingress\_healthcheck\_protocol](#input\_alb\_ingress\_healthcheck\_protocol) | The protocol to use to connect with the target. Defaults to `HTTP`. Not applicable when `target_type` is `lambda` | `string` | `"HTTP"` | no |
| <a name="input_alb_ingress_listener_authenticated_priority"></a> [alb\_ingress\_listener\_authenticated\_priority](#input\_alb\_ingress\_listener\_authenticated\_priority) | The priority for the rules with authentication, between 1 and 50000 (1 being highest priority). Must be different from `alb_ingress_listener_unauthenticated_priority` since a listener can't have multiple rules with the same priority | `number` | `300` | no |
| <a name="input_alb_ingress_listener_unauthenticated_priority"></a> [alb\_ingress\_listener\_unauthenticated\_priority](#input\_alb\_ingress\_listener\_unauthenticated\_priority) | The priority for the rules without authentication, between 1 and 50000 (1 being highest priority). Must be different from `alb_ingress_listener_authenticated_priority` since a listener can't have multiple rules with the same priority | `number` | `1000` | no |
| <a name="input_alb_ingress_load_balancing_algorithm_type"></a> [alb\_ingress\_load\_balancing\_algorithm\_type](#input\_alb\_ingress\_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 |
| <a name="input_alb_ingress_load_balancing_algorithm_type"></a> [alb\_ingress\_load\_balancing\_algorithm\_type](#input\_alb\_ingress\_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, least\_outstanding\_requests or weighted\_random. The default is round\_robin. | `string` | `"round_robin"` | no |
| <a name="input_alb_ingress_load_balancing_anomaly_mitigation"></a> [alb\_ingress\_load\_balancing\_anomaly\_mitigation](#input\_alb\_ingress\_load\_balancing\_anomaly\_mitigation) | Determines whether to enable target anomaly mitigation. Only supported by the weighted\_random load balancing algorithm type. Valid values are 'on' or 'off'. | `string` | `"off"` | no |
| <a name="input_alb_ingress_protocol"></a> [alb\_ingress\_protocol](#input\_alb\_ingress\_protocol) | The protocol for the created ALB target group (if target\_group\_arn is not set). One of `HTTP`, `HTTPS`. Defaults to `HTTP`. | `string` | `"HTTP"` | no |
| <a name="input_alb_ingress_protocol_version"></a> [alb\_ingress\_protocol\_version](#input\_alb\_ingress\_protocol\_version) | The protocol version. One of `HTTP1`, `HTTP2`, `GRPC`. Only applicable when protocol is HTTP or HTTPS. Specify GRPC to send requests to targets using gRPC. Specify HTTP2 to send requests to targets using HTTP/2. The default is `HTTP1`, which sends requests to targets using HTTP/1.1 | `string` | `"HTTP1"` | no |
| <a name="input_alb_ingress_target_group_arn"></a> [alb\_ingress\_target\_group\_arn](#input\_alb\_ingress\_target\_group\_arn) | Existing ALB target group ARN. If provided, set `alb_ingress_enable_default_target_group` to `false` to disable creation of the default target group | `string` | `""` | no |
Expand Down
23 changes: 12 additions & 11 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,18 @@ module "alb_ingress" {
protocol = var.alb_ingress_protocol
protocol_version = var.alb_ingress_protocol_version

target_type = var.alb_ingress_target_type
health_check_path = var.alb_ingress_healthcheck_path
health_check_protocol = var.alb_ingress_healthcheck_protocol
health_check_healthy_threshold = var.alb_ingress_health_check_healthy_threshold
health_check_interval = var.alb_ingress_health_check_interval
health_check_matcher = var.alb_ingress_health_check_matcher
health_check_timeout = var.alb_ingress_health_check_timeout
health_check_unhealthy_threshold = var.alb_ingress_health_check_unhealthy_threshold
default_target_group_enabled = var.alb_ingress_enable_default_target_group
target_group_arn = var.alb_ingress_target_group_arn
load_balancing_algorithm_type = var.alb_ingress_load_balancing_algorithm_type
target_type = var.alb_ingress_target_type
health_check_path = var.alb_ingress_healthcheck_path
health_check_protocol = var.alb_ingress_healthcheck_protocol
health_check_healthy_threshold = var.alb_ingress_health_check_healthy_threshold
health_check_interval = var.alb_ingress_health_check_interval
health_check_matcher = var.alb_ingress_health_check_matcher
health_check_timeout = var.alb_ingress_health_check_timeout
health_check_unhealthy_threshold = var.alb_ingress_health_check_unhealthy_threshold
default_target_group_enabled = var.alb_ingress_enable_default_target_group
target_group_arn = var.alb_ingress_target_group_arn
load_balancing_algorithm_type = var.alb_ingress_load_balancing_algorithm_type
load_balancing_anomaly_mitigation = var.alb_ingress_load_balancing_anomaly_mitigation

authenticated_paths = var.alb_ingress_authenticated_paths
unauthenticated_paths = var.alb_ingress_unauthenticated_paths
Expand Down
13 changes: 12 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,18 @@ variable "alb_ingress_authenticated_paths" {
variable "alb_ingress_load_balancing_algorithm_type" {
type = string
default = "round_robin"
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."
description = "Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is round_robin, least_outstanding_requests or weighted_random. The default is round_robin."
}

variable "alb_ingress_load_balancing_anomaly_mitigation" {
type = string
default = "off"
description = "Determines whether to enable target anomaly mitigation. Only supported by the weighted_random load balancing algorithm type. Valid values are 'on' or 'off'."

validation {
condition = contains(["on", "off"], var.alb_ingress_load_balancing_anomaly_mitigation)
error_message = "alb_ingress_load_balancing_anomaly_mitigation must be either 'on' or 'off'"
}
}

variable "nlb_ingress_target_group_arn" {
Expand Down