Skip to content

Commit 1e62250

Browse files
authored
feat: Add target_group_health block (#376)
1 parent 2b8b20e commit 1e62250

File tree

12 files changed

+63
-16
lines changed

12 files changed

+63
-16
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,13 @@ See [patterns.md](https://github.com/terraform-aws-modules/terraform-aws-alb/blo
352352
| Name | Version |
353353
|------|---------|
354354
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
355-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.46 |
355+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
356356

357357
## Providers
358358

359359
| Name | Version |
360360
|------|---------|
361-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.46 |
361+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
362362

363363
## Modules
364364

examples/complete-alb/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.46 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
2424
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 2.0 |
25+
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.6 |
2526

2627
## Providers
2728

2829
| Name | Version |
2930
|------|---------|
30-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.46 |
31+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
3132
| <a name="provider_null"></a> [null](#provider\_null) | >= 2.0 |
33+
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.6 |
3234

3335
## Modules
3436

@@ -53,6 +55,7 @@ Note that this example may create resources which cost money. Run `terraform des
5355
| [aws_instance.other](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance) | resource |
5456
| [aws_instance.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance) | resource |
5557
| [null_resource.download_package](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
58+
| [random_string.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
5659
| [aws_availability_zones.available](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones) | data source |
5760
| [aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |
5861
| [aws_ssm_parameter.al2](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameter) | data source |

examples/complete-alb/main.tf

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,15 @@ module "alb" {
368368
load_balancing_anomaly_mitigation = "on"
369369
load_balancing_cross_zone_enabled = false
370370

371+
target_group_health = {
372+
dns_failover = {
373+
minimum_healthy_targets_count = 2
374+
}
375+
unhealthy_state_routing = {
376+
minimum_healthy_targets_percentage = 50
377+
}
378+
}
379+
371380
health_check = {
372381
enabled = true
373382
interval = 30
@@ -568,8 +577,14 @@ resource "aws_cognito_user_pool_client" "this" {
568577
allowed_oauth_flows_user_pool_client = true
569578
}
570579

580+
resource "random_string" "this" {
581+
length = 5
582+
upper = false
583+
special = false
584+
}
585+
571586
resource "aws_cognito_user_pool_domain" "this" {
572-
domain = local.name
587+
domain = "${local.name}-${random_string.this.result}"
573588
user_pool_id = aws_cognito_user_pool.this.id
574589
}
575590

examples/complete-alb/versions.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.46"
7+
version = ">= 5.59"
88
}
99
null = {
1010
source = "hashicorp/null"
1111
version = ">= 2.0"
1212
}
13+
random = {
14+
source = "hashicorp/random"
15+
version = ">= 3.6"
16+
}
1317
}
1418
}

examples/complete-nlb/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.46 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.46 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
3030

3131
## Modules
3232

examples/complete-nlb/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.46"
7+
version = ">= 5.59"
88
}
99
}
1010
}

examples/mutual-auth-alb/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ Note that this example may create resources which cost money. Run `terraform des
2121
| Name | Version |
2222
|------|---------|
2323
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
24-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.46 |
24+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
2525
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 2.0 |
2626
| <a name="requirement_tls"></a> [tls](#requirement\_tls) | >= 4.0 |
2727

2828
## Providers
2929

3030
| Name | Version |
3131
|------|---------|
32-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.46 |
32+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
3333
| <a name="provider_null"></a> [null](#provider\_null) | >= 2.0 |
3434
| <a name="provider_tls"></a> [tls](#provider\_tls) | >= 4.0 |
3535

examples/mutual-auth-alb/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.46"
7+
version = ">= 5.59"
88
}
99
null = {
1010
source = "hashicorp/null"

main.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,31 @@ resource "aws_lb_target_group" "this" {
540540
}
541541
}
542542

543+
dynamic "target_group_health" {
544+
for_each = try([each.value.target_group_health], [])
545+
546+
content {
547+
548+
dynamic "dns_failover" {
549+
for_each = try([target_group_health.value.dns_failover], [])
550+
551+
content {
552+
minimum_healthy_targets_count = try(dns_failover.value.minimum_healthy_targets_count, null)
553+
minimum_healthy_targets_percentage = try(dns_failover.value.minimum_healthy_targets_percentage, null)
554+
}
555+
}
556+
557+
dynamic "unhealthy_state_routing" {
558+
for_each = try([target_group_health.value.unhealthy_state_routing], [])
559+
560+
content {
561+
minimum_healthy_targets_count = try(unhealthy_state_routing.value.minimum_healthy_targets_count, null)
562+
minimum_healthy_targets_percentage = try(unhealthy_state_routing.value.minimum_healthy_targets_percentage, null)
563+
}
564+
}
565+
}
566+
}
567+
543568
dynamic "target_health_state" {
544569
for_each = try([each.value.target_health_state], [])
545570
content {

modules/lb_trust_store/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ module "trust_store" {
3030
| Name | Version |
3131
|------|---------|
3232
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
33-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.46 |
33+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
3434

3535
## Providers
3636

3737
| Name | Version |
3838
|------|---------|
39-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.46 |
39+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
4040

4141
## Modules
4242

0 commit comments

Comments
 (0)