Skip to content

Commit b6cf424

Browse files
Michael Stracheantonbabenko
andauthored
fix: Explicitly setting http_tcp_listener.action_type to forward fails (#281)
Co-authored-by: Anton Babenko <[email protected]>
1 parent 72e0ce4 commit b6cf424

File tree

7 files changed

+35
-22
lines changed

7 files changed

+35
-22
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.77.1
3+
rev: v1.80.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_wrapper_module_for_each

examples/complete-alb/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ Note that this example may create resources which cost money. Run `terraform des
3434

3535
| Name | Source | Version |
3636
|------|--------|---------|
37-
| <a name="module_acm"></a> [acm](#module\_acm) | terraform-aws-modules/acm/aws | ~> 3.0 |
37+
| <a name="module_acm"></a> [acm](#module\_acm) | terraform-aws-modules/acm/aws | ~> 4.0 |
3838
| <a name="module_alb"></a> [alb](#module\_alb) | ../../ | n/a |
39-
| <a name="module_lambda_with_allowed_triggers"></a> [lambda\_with\_allowed\_triggers](#module\_lambda\_with\_allowed\_triggers) | terraform-aws-modules/lambda/aws | ~> 3.0 |
40-
| <a name="module_lambda_without_allowed_triggers"></a> [lambda\_without\_allowed\_triggers](#module\_lambda\_without\_allowed\_triggers) | terraform-aws-modules/lambda/aws | ~> 3.0 |
39+
| <a name="module_lambda_with_allowed_triggers"></a> [lambda\_with\_allowed\_triggers](#module\_lambda\_with\_allowed\_triggers) | terraform-aws-modules/lambda/aws | ~> 5.0 |
40+
| <a name="module_lambda_without_allowed_triggers"></a> [lambda\_without\_allowed\_triggers](#module\_lambda\_without\_allowed\_triggers) | terraform-aws-modules/lambda/aws | ~> 5.0 |
4141
| <a name="module_lb_disabled"></a> [lb\_disabled](#module\_lb\_disabled) | ../../ | n/a |
42-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 3.0 |
43-
| <a name="module_wildcard_cert"></a> [wildcard\_cert](#module\_wildcard\_cert) | terraform-aws-modules/acm/aws | ~> 3.0 |
42+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |
43+
| <a name="module_wildcard_cert"></a> [wildcard\_cert](#module\_wildcard\_cert) | terraform-aws-modules/acm/aws | ~> 4.0 |
4444

4545
## Resources
4646

examples/complete-alb/main.tf

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
provider "aws" {
22
region = local.region
3+
4+
# Make it faster by skipping something
5+
skip_metadata_api_check = true
6+
skip_region_validation = true
7+
skip_credentials_validation = true
8+
skip_requesting_account_id = true
39
}
410

511
data "aws_availability_zones" "available" {}
@@ -500,7 +506,7 @@ resource "null_resource" "download_package" {
500506

501507
module "lambda_with_allowed_triggers" {
502508
source = "terraform-aws-modules/lambda/aws"
503-
version = "~> 3.0"
509+
version = "~> 5.0"
504510

505511
function_name = "${local.name}-with-allowed-triggers"
506512
description = "My awesome lambda function (with allowed triggers)"
@@ -524,7 +530,7 @@ module "lambda_with_allowed_triggers" {
524530

525531
module "lambda_without_allowed_triggers" {
526532
source = "terraform-aws-modules/lambda/aws"
527-
version = "~> 3.0"
533+
version = "~> 5.0"
528534

529535
function_name = "${local.name}-without-allowed-triggers"
530536
description = "My awesome lambda function (without allowed triggers)"
@@ -548,7 +554,7 @@ module "lambda_without_allowed_triggers" {
548554

549555
module "vpc" {
550556
source = "terraform-aws-modules/vpc/aws"
551-
version = "~> 3.0"
557+
version = "~> 5.0"
552558

553559
name = local.name
554560
cidr = local.vpc_cidr
@@ -557,8 +563,8 @@ module "vpc" {
557563
private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 4, k)]
558564
public_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 8, k + 48)]
559565

560-
enable_nat_gateway = true
561-
single_nat_gateway = true
566+
# Disabled NAT gateway to save a few seconds running this example
567+
enable_nat_gateway = false
562568
enable_dns_hostnames = true
563569

564570
tags = local.tags
@@ -570,15 +576,15 @@ data "aws_route53_zone" "this" {
570576

571577
module "acm" {
572578
source = "terraform-aws-modules/acm/aws"
573-
version = "~> 3.0"
579+
version = "~> 4.0"
574580

575581
domain_name = var.domain_name
576582
zone_id = data.aws_route53_zone.this.id
577583
}
578584

579585
module "wildcard_cert" {
580586
source = "terraform-aws-modules/acm/aws"
581-
version = "~> 3.0"
587+
version = "~> 4.0"
582588

583589
domain_name = "*.${var.domain_name}"
584590
zone_id = data.aws_route53_zone.this.id

examples/complete-nlb/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Note that this example may create resources which cost money. Run `terraform des
3232

3333
| Name | Source | Version |
3434
|------|--------|---------|
35-
| <a name="module_acm"></a> [acm](#module\_acm) | terraform-aws-modules/acm/aws | ~> 3.0 |
35+
| <a name="module_acm"></a> [acm](#module\_acm) | terraform-aws-modules/acm/aws | ~> 4.0 |
3636
| <a name="module_nlb"></a> [nlb](#module\_nlb) | ../../ | n/a |
37-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 3.0 |
37+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |
3838

3939
## Resources
4040

examples/complete-nlb/main.tf

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
provider "aws" {
22
region = local.region
3+
4+
# Make it faster by skipping something
5+
skip_metadata_api_check = true
6+
skip_region_validation = true
7+
skip_credentials_validation = true
8+
skip_requesting_account_id = true
39
}
410

511
data "aws_availability_zones" "available" {}
@@ -125,7 +131,7 @@ module "nlb" {
125131

126132
module "vpc" {
127133
source = "terraform-aws-modules/vpc/aws"
128-
version = "~> 3.0"
134+
version = "~> 5.0"
129135

130136
name = local.name
131137
cidr = local.vpc_cidr
@@ -134,8 +140,8 @@ module "vpc" {
134140
private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 4, k)]
135141
public_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 8, k + 48)]
136142

137-
enable_nat_gateway = true
138-
single_nat_gateway = true
143+
# Disabled NAT gateway to save a few seconds running this example
144+
enable_nat_gateway = false
139145
enable_dns_hostnames = true
140146

141147
tags = local.tags
@@ -147,13 +153,14 @@ data "aws_route53_zone" "this" {
147153

148154
module "acm" {
149155
source = "terraform-aws-modules/acm/aws"
150-
version = "~> 3.0"
156+
version = "~> 4.0"
151157

152158
domain_name = var.domain_name
153159
zone_id = data.aws_route53_zone.this.id
154160
}
155161

156162
resource "aws_eip" "this" {
157163
count = length(local.azs)
158-
vpc = true
164+
165+
domain = "vpc"
159166
}

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ resource "aws_lb_listener" "frontend_http_tcp" {
635635
# Defaults to forward action if action_type not specified
636636
content {
637637
type = lookup(default_action.value, "action_type", "forward")
638-
target_group_arn = contains([null, ""], lookup(default_action.value, "action_type", "")) ? aws_lb_target_group.main[lookup(default_action.value, "target_group_index", count.index)].id : null
638+
target_group_arn = contains([null, "", "forward"], lookup(default_action.value, "action_type", "")) ? aws_lb_target_group.main[lookup(default_action.value, "target_group_index", count.index)].id : null
639639

640640
dynamic "redirect" {
641641
for_each = length(keys(lookup(default_action.value, "redirect", {}))) == 0 ? [] : [lookup(default_action.value, "redirect", {})]

wrappers/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
output "wrapper" {
22
description = "Map of outputs of a wrapper."
33
value = module.wrapper
4-
# sensitive = false # No sensitive module output found
4+
# sensitive = false # No sensitive module output found
55
}

0 commit comments

Comments
 (0)