terraform-aws-alb icon indicating copy to clipboard operation
terraform-aws-alb copied to clipboard

Invalide Attribute Combination

Open cdg-gavin-gavinyap opened this issue 1 year ago β€’ 0 comments

Description

When target group's target type is set to lambda, the following

β”‚ Warning: Invalid Attribute Combination
β”‚ 
β”‚   with module.lb["devops-nebula-lambda-alb-1"].aws_lb_target_group.this["lambda-target-group-0"],
β”‚   on .terraform/modules/lb/main.tf line 485, in resource "aws_lb_target_group" "this":
β”‚  485:   port                               = try(each.value.target_type, null) == "lambda" ? null : try(each.value.port, var.default_port)
β”‚ 
β”‚ Attribute "port" cannot be specified when "target_type" is "lambda".
  • [x ] βœ‹ I have searched the open/closed issues and my issue is not listed.

⚠️ Note

Versions

  • Module version [Required]: 9.7.0

  • Terraform version: 1.50

  • Provider version(s): . β”œβ”€β”€ provider[registry.terraform.io/hashicorp/aws] β”œβ”€β”€ module.gateway_lb β”‚ └── provider[registry.terraform.io/hashicorp/aws] └── module.lb └── provider[registry.terraform.io/hashicorp/aws] >= 5.33.0

Reproduction Code [Required]

lambda-target-group-0 = { name_prefix = "l1-" target_type = "lambda" lambda_multi_value_headers_enabled = true target_id = module.lambda_with_allowed_triggers.lambda_function_arn }

Steps to reproduce the behavior:

  1. define a ALB with target group above
  2. terraform apply

Got the warning in description

cdg-gavin-gavinyap avatar Feb 20 '24 02:02 cdg-gavin-gavinyap