Skip to content

Commit

Permalink
Added few variables to enable HealthCheck configuration of the ALB (c…
Browse files Browse the repository at this point in the history
…loudposse#160)

* Added few variables to enable HealthCheck configuration of the ALB

* Auto Format

Co-authored-by: cloudpossebot <[email protected]>
Co-authored-by: nitrocode <[email protected]>
  • Loading branch information
3 people authored Aug 18, 2021
1 parent 5f9216f commit 24b941e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ Available targets:
| <a name="input_alb_ingress_authenticated_listener_arns_count"></a> [alb\_ingress\_authenticated\_listener\_arns\_count](#input\_alb\_ingress\_authenticated\_listener\_arns\_count) | The number of authenticated ARNs in `alb_ingress_authenticated_listener_arns`. This is necessary to work around a limitation in Terraform where counts cannot be computed | `number` | `0` | no |
| <a name="input_alb_ingress_authenticated_paths"></a> [alb\_ingress\_authenticated\_paths](#input\_alb\_ingress\_authenticated\_paths) | Authenticated path pattern to match (a maximum of 1 can be defined) | `list(string)` | `[]` | no |
| <a name="input_alb_ingress_enable_default_target_group"></a> [alb\_ingress\_enable\_default\_target\_group](#input\_alb\_ingress\_enable\_default\_target\_group) | If true, create a default target group for the ALB ingress | `bool` | `true` | no |
| <a name="input_alb_ingress_health_check_healthy_threshold"></a> [alb\_ingress\_health\_check\_healthy\_threshold](#input\_alb\_ingress\_health\_check\_healthy\_threshold) | The number of consecutive health checks successes required before healthy | `number` | `2` | no |
| <a name="input_alb_ingress_health_check_interval"></a> [alb\_ingress\_health\_check\_interval](#input\_alb\_ingress\_health\_check\_interval) | The duration in seconds in between health checks | `number` | `15` | no |
| <a name="input_alb_ingress_health_check_timeout"></a> [alb\_ingress\_health\_check\_timeout](#input\_alb\_ingress\_health\_check\_timeout) | The amount of time to wait in seconds before failing a health check request | `number` | `10` | no |
| <a name="input_alb_ingress_health_check_unhealthy_threshold"></a> [alb\_ingress\_health\_check\_unhealthy\_threshold](#input\_alb\_ingress\_health\_check\_unhealthy\_threshold) | The number of consecutive health check failures required before unhealthy | `number` | `2` | no |
| <a name="input_alb_ingress_healthcheck_path"></a> [alb\_ingress\_healthcheck\_path](#input\_alb\_ingress\_healthcheck\_path) | The path of the healthcheck which the ALB checks | `string` | `"/"` | no |
| <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 |
Expand Down
4 changes: 4 additions & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
| <a name="input_alb_ingress_authenticated_listener_arns_count"></a> [alb\_ingress\_authenticated\_listener\_arns\_count](#input\_alb\_ingress\_authenticated\_listener\_arns\_count) | The number of authenticated ARNs in `alb_ingress_authenticated_listener_arns`. This is necessary to work around a limitation in Terraform where counts cannot be computed | `number` | `0` | no |
| <a name="input_alb_ingress_authenticated_paths"></a> [alb\_ingress\_authenticated\_paths](#input\_alb\_ingress\_authenticated\_paths) | Authenticated path pattern to match (a maximum of 1 can be defined) | `list(string)` | `[]` | no |
| <a name="input_alb_ingress_enable_default_target_group"></a> [alb\_ingress\_enable\_default\_target\_group](#input\_alb\_ingress\_enable\_default\_target\_group) | If true, create a default target group for the ALB ingress | `bool` | `true` | no |
| <a name="input_alb_ingress_health_check_healthy_threshold"></a> [alb\_ingress\_health\_check\_healthy\_threshold](#input\_alb\_ingress\_health\_check\_healthy\_threshold) | The number of consecutive health checks successes required before healthy | `number` | `2` | no |
| <a name="input_alb_ingress_health_check_interval"></a> [alb\_ingress\_health\_check\_interval](#input\_alb\_ingress\_health\_check\_interval) | The duration in seconds in between health checks | `number` | `15` | no |
| <a name="input_alb_ingress_health_check_timeout"></a> [alb\_ingress\_health\_check\_timeout](#input\_alb\_ingress\_health\_check\_timeout) | The amount of time to wait in seconds before failing a health check request | `number` | `10` | no |
| <a name="input_alb_ingress_health_check_unhealthy_threshold"></a> [alb\_ingress\_health\_check\_unhealthy\_threshold](#input\_alb\_ingress\_health\_check\_unhealthy\_threshold) | The number of consecutive health check failures required before unhealthy | `number` | `2` | no |
| <a name="input_alb_ingress_healthcheck_path"></a> [alb\_ingress\_healthcheck\_path](#input\_alb\_ingress\_healthcheck\_path) | The path of the healthcheck which the ALB checks | `string` | `"/"` | no |
| <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 |
Expand Down
16 changes: 10 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ module "alb_ingress" {
source = "cloudposse/alb-ingress/aws"
version = "0.23.0"

vpc_id = var.vpc_id
port = var.container_port
health_check_path = var.alb_ingress_healthcheck_path
health_check_protocol = var.alb_ingress_healthcheck_protocol
default_target_group_enabled = var.alb_ingress_enable_default_target_group
target_group_arn = var.alb_ingress_target_group_arn
vpc_id = var.vpc_id
port = var.container_port
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_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

authenticated_paths = var.alb_ingress_authenticated_paths
unauthenticated_paths = var.alb_ingress_unauthenticated_paths
Expand Down
24 changes: 24 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,30 @@ variable "alb_ingress_healthcheck_protocol" {
description = "The protocol to use to connect with the target. Defaults to `HTTP`. Not applicable when `target_type` is `lambda`"
}

variable "alb_ingress_health_check_healthy_threshold" {
type = number
default = 2
description = "The number of consecutive health checks successes required before healthy"
}

variable "alb_ingress_health_check_unhealthy_threshold" {
type = number
default = 2
description = "The number of consecutive health check failures required before unhealthy"
}

variable "alb_ingress_health_check_interval" {
type = number
default = 15
description = "The duration in seconds in between health checks"
}

variable "alb_ingress_health_check_timeout" {
type = number
default = 10
description = "The amount of time to wait in seconds before failing a health check request"
}

variable "alb_ingress_listener_unauthenticated_priority" {
type = number
default = 1000
Expand Down

0 comments on commit 24b941e

Please sign in to comment.