Open remi-f-artelia opened 4 days ago
OK so my listeners
and target_groups
variables are not perfect yet to modelize each possible options matching the module... Moreover, there were based on a previous version of the module so it's failing later due to this...
If you want to reproduce, replace them with the default variables as in the module
variable "listeners" {
description = "Map of listener configurations to create"
type = any
default = {}
}
variable "target_groups" {
description = "Map of target group configurations to create"
type = any
default = {}
}
But then it's failing with another issue:
β Error: Error in function call
β
β on .terraform\modules\service_alb\main.tf line 346, in resource "aws_lb_listener_rule" "this":
β 346: arn = try(target_group.value.arn, aws_lb_target_group.this[target_group.value.target_group_key].arn)
β βββββββββββββββββ
β β aws_lb_target_group.this is object with 1 attribute "ex-instance"
β β target_group.value is object with 2 attributes
β β target_group.value.target_group_key is "ex-lambda-with-trigger"
β
β Call to function "try" failed: no expression succeeded:
β - Unsupported attribute (at .terraform\modules\service_alb\main.tf:346,44-48)
β This object does not have an attribute named "arn".
β - Invalid index (at .terraform\modules\service_alb\main.tf:346,74-111)
β The given key does not identify an element in this collection value.
β
β At least one expression must produce a successful result.
I don't really understand why the example is failing and why I can't find any other issue showing this
Description
Please provide a clear and concise description of the issue you are encountering, and a reproduction of your configuration (see the
examples/*
directory for references that you can copy+paste and tailor to match your configs if you are unable to copy your exact configuration). The reproduction MUST be executable by runningterraform init && terraform apply
without any further changes.If your request is for a new feature, please use the
Feature request
template.β οΈ Note
Before you submit an issue, please perform the following first:
.terraform
directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!):rm -rf .terraform/
terraform init
Versions
Module version [Required]:
v9.9.0
Terraform version:
Successfully configured the backend "s3"! Terraform will automatically use this backend unless the backend configuration changes. Initializing modules...
Initializing provider plugins...
Reproduction Code [Required]
The code is available in the following gist
Steps to reproduce the behavior:
Are you using workspaces? No Have you cleared the local cache (see Notice section above)?: Yes List steps in order that led up to the issue you encountered
Expected behavior
The plan should work without errors because:
Actual behavior
The plan fails with the following errors:
1st error
I'm not sure why this is failing right now. The only thing I know is that with the provided example it fails so we do not have a proper example to rely on.
2nd error
IMHO, the foreach should condition the
var.load_balancer_type
asgateway
since it's written this in the doc3rd issue
When I override the
.terraform\modules\service_alb\main.tf
block code as described into 1st error , I fail on the following issue, even if I hard code the vpc_idTerminal Output Screenshot(s)
Additional context