terraform-aws-modules/terraform-aws-alb

Invalide Attribute Combination

cdg-gavin-gavinyap opened this issue · 2 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

we have this

ex-lambda-without-trigger = {
name_prefix = "l2-"
target_type = "lambda"
target_id = module.lambda_without_allowed_triggers.lambda_function_arn
attach_lambda_permission = true
}
in our example and it works as expected

closing for now since I am not able to reproduce

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.