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

How is custom_lb_arn being used #66

Open
jastsai opened this issue Jan 26, 2023 · 2 comments
Open

How is custom_lb_arn being used #66

jastsai opened this issue Jan 26, 2023 · 2 comments
Labels
question Further information is requested

Comments

@jastsai
Copy link

jastsai commented Jan 26, 2023

Hi,

I am wondering how var.custom_lb_arn is used? It seems the follow code snippet is the only place the variable is used, but I would like to use a custom load balancer in the service... how?

module "ecs-alb" {
count = var.custom_lb_arn == null ? 1 : 0

source = "cn-terraform/ecs-alb/aws"
version = "1.0.28"

Thanks,
Jason

@jnonino jnonino added the question Further information is requested label Jan 31, 2023
@pavillet
Copy link

@jnonino Same question here I use it from the fargate module but it's clearly not working

│ 
│   on .terraform/modules/ecs-fargate.ecs-fargate-service/main.tf line 83, in resource "aws_ecs_service" "service":
│   83:     for_each = module.ecs-alb[0].lb_http_tgs_map_arn_port
│     ├────────────────
│     │ module.ecs-alb is empty tuple
│ 
│ The given key does not identify an element in this collection value: the collection has no elements.
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/ecs-fargate.ecs-fargate-service/main.tf line 91, in resource "aws_ecs_service" "service":
│   91:     for_each = module.ecs-alb[0].lb_https_tgs_map_arn_port
│     ├────────────────
│     │ module.ecs-alb is empty tuple
│ 
│ The given key does not identify an element in this collection value: the collection has no elements.
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/ecs-fargate.ecs-fargate-service/main.tf line 174, in resource "aws_security_group_rule" "ingress_through_http_and_https":
│  174:   for_each                 = toset(concat(module.ecs-alb[0].lb_https_tgs_ports, module.ecs-alb[0].lb_http_tgs_ports))
│     ├────────────────
│     │ module.ecs-alb is empty tuple
│ 
│ The given key does not identify an element in this collection value: the collection has no elements.
╵
╷
│ Error: Invalid index
│ 
│   on .terraform/modules/ecs-fargate.ecs-fargate-service/main.tf line 174, in resource "aws_security_group_rule" "ingress_through_http_and_https":
│  174:   for_each                 = toset(concat(module.ecs-alb[0].lb_https_tgs_ports, module.ecs-alb[0].lb_http_tgs_ports))
│     ├────────────────
│     │ module.ecs-alb is empty tuple
│ 
│ The given key does not identify an element in this collection value: the collection has no elements.

@amontalban
Copy link
Contributor

@jnonino looks like this functionality is broken.

I was actually looking for a way to avoid creating an ALB as I'm using Traefik and I don't want to create an ALB per service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Development

No branches or pull requests

4 participants