fargatecli icon indicating copy to clipboard operation
fargatecli copied to clipboard

Lb complains if security group not specified, but says SGs are only for http LBs if I specify one

Open darthcabs opened this issue 6 years ago • 4 comments

I'm trying to create a LB for my ECS Service, but I'm stuck here:

fargate lb create name --port 8000 --subnet-id subnet-a218a38d [!] Could not find EC2 security group

fargate lb create name --port 8000 --security-group-id sg-d1d0cca5 --subnet-id subnet-a218a38d [!] Security groups can only be specified for HTTP/HTTPS load balancers

I've read somewhere that LBs require two subnets, but providing them in those commands doesn't help either.

Am I missing something? Is there a workaround? Thanks!

darthcabs avatar Apr 11 '18 20:04 darthcabs

Hi @darthcabs , did you check that your security group opens this port to the public? (I have only one subnet, but had to open load balanced ports to ingress on that port.)

mgajda avatar Sep 08 '18 10:09 mgajda

Actually I have same issue. For HTTP & HTTPS it works without problem, however if I use tcp: ports then fargate shows same error.

fargate lb create aml-service-lb --port tcp:80 --security-group-id sg-05e3a638d5d4ada93 --cluster core-master --region eu-west-1 - security groups can only be specified for HTTP/HTTPS load balancers

masterjg avatar Oct 25 '18 12:10 masterjg

apparently aws does not support security groups on network lb. https://www.linkedin.com/pulse/aws-new-network-elastic-load-balancernlb-few-silvio-l-de-morais/

masterjg avatar Oct 25 '18 13:10 masterjg

May it be that your script used application load balancer, and now it converts to Network Load Balancer (TCP) than does not understand security groups?

mgajda avatar Oct 27 '18 11:10 mgajda