awslabs / fargatecli

CLI for AWS Fargate
Apache License 2.0
893 stars 114 forks source link

Errors between different load balancer configurations #27

Closed MedLexAI closed 6 years ago

MedLexAI commented 6 years ago

Testing out this CLI interface for Fargate, and from following along with the video there are a couple of errors I don't understand.

For starters, I am specifying the exact command line from the video but get this error:

$ fargate service create app --port HTTP:8080 --lb test-app --num 2
[!] Invalid load balancer and protocol
network load balancer web-app only supports TCP

This is a Docker instance launched from the private ECR registry:

$ fargate task run --image 123456.dkr.ecr.us-east-1.amazonaws.com/test-app/test-app --subnet-id subnet-123456a --subnet-id subnet-123456b -v

I am also getting different errors based upon the ports I am specifying, for example:

$  fargate lb create test-app --port 8080 --certificate example.com
[i] Created load balancer test-app
$ fargate lb destroy test-app
[i] Destroyed load balancer test-app
$  fargate lb create test-app --port 443 --certificate example.com
[!] Could not create ELB load balancer
ValidationError: At least two subnets in two different Availability Zones must be specified
        status code: 400, request id: 1234-567-8912345

The test-app was launched with two subnets attached to different availability zones...?

Also, how does one go about launching two separate tasks within separate availability zones? I would assume that would be a requirement for the application load balancer? My goal is being able to use an alias so that https://example.com -> application load balancer -> Fargate tasks running web application

Thanks in advance, your project will be a big help if I can get it working properly!

jpignata commented 6 years ago

Hi there! Sorry my project is giving you trouble. A few things:

In terms of launching across AZs, the CLI will launch across your default subnets by default. You can control which subnets it uses by passing --subnet-id to either task run or servcie create.

I hope that helps!

MedLexAI commented 6 years ago

Thanks for the prompt response, I will test out your suggestions tomorrow and look forward to contributing feedback!