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

fix: Explicitly setting http_tcp_listener.action_type to forward fails #281

Merged
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.77.1
rev: v1.80.0
hooks:
- id: terraform_fmt
- id: terraform_wrapper_module_for_each
Expand Down
10 changes: 5 additions & 5 deletions examples/complete-alb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ Note that this example may create resources which cost money. Run `terraform des

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

## Resources

Expand Down
20 changes: 13 additions & 7 deletions examples/complete-alb/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
provider "aws" {
region = local.region

# Make it faster by skipping something
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
skip_requesting_account_id = true
}

data "aws_availability_zones" "available" {}
Expand Down Expand Up @@ -500,7 +506,7 @@ resource "null_resource" "download_package" {

module "lambda_with_allowed_triggers" {
source = "terraform-aws-modules/lambda/aws"
version = "~> 3.0"
version = "~> 5.0"

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

module "lambda_without_allowed_triggers" {
source = "terraform-aws-modules/lambda/aws"
version = "~> 3.0"
version = "~> 5.0"

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

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 3.0"
version = "~> 5.0"

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

enable_nat_gateway = true
single_nat_gateway = true
# Disabled NAT gateway to save a few seconds running this example
enable_nat_gateway = false
enable_dns_hostnames = true

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

module "acm" {
source = "terraform-aws-modules/acm/aws"
version = "~> 3.0"
version = "~> 4.0"

domain_name = var.domain_name
zone_id = data.aws_route53_zone.this.id
}

module "wildcard_cert" {
source = "terraform-aws-modules/acm/aws"
version = "~> 3.0"
version = "~> 4.0"

domain_name = "*.${var.domain_name}"
zone_id = data.aws_route53_zone.this.id
Expand Down
4 changes: 2 additions & 2 deletions examples/complete-nlb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Note that this example may create resources which cost money. Run `terraform des

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

## Resources

Expand Down
17 changes: 12 additions & 5 deletions examples/complete-nlb/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
provider "aws" {
region = local.region

# Make it faster by skipping something
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
skip_requesting_account_id = true
}

data "aws_availability_zones" "available" {}
Expand Down Expand Up @@ -125,7 +131,7 @@ module "nlb" {

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 3.0"
version = "~> 5.0"

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

enable_nat_gateway = true
single_nat_gateway = true
# Disabled NAT gateway to save a few seconds running this example
enable_nat_gateway = false
enable_dns_hostnames = true

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

module "acm" {
source = "terraform-aws-modules/acm/aws"
version = "~> 3.0"
version = "~> 4.0"

domain_name = var.domain_name
zone_id = data.aws_route53_zone.this.id
}

resource "aws_eip" "this" {
count = length(local.azs)
vpc = true

domain = "vpc"
}
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ resource "aws_lb_listener" "frontend_http_tcp" {
# Defaults to forward action if action_type not specified
content {
type = lookup(default_action.value, "action_type", "forward")
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
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

dynamic "redirect" {
for_each = length(keys(lookup(default_action.value, "redirect", {}))) == 0 ? [] : [lookup(default_action.value, "redirect", {})]
Expand Down
2 changes: 1 addition & 1 deletion wrappers/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
output "wrapper" {
description = "Map of outputs of a wrapper."
value = module.wrapper
# sensitive = false # No sensitive module output found
# sensitive = false # No sensitive module output found
}