Cannot create ECS service with existing load balancer

0

Hi.
I am trying to launch a service in ECS with my Docker image.
I have successfully started it as a task, but without a domain name. Tried accessing it only by IP.

Now I am trying to create it as a service. Again without an attached domain name, it works. However to attach a domain name I need to use ELB and that is when it becomes complicated.

Step 1 config.:
Launch type: FARGATE
No. of tasks: 1
Deployment type: Rolling update.
The rest are by default.

Step 2:
Cluster VPC: existing one
Subnets: private
Security groups: created one for ECS
Auto-assign public IP: disabled
Load balancer type: Application
Load balancer name: choosing existing one
Container name port: existing one on port 80
Enable service integration: checked
and choosing a configured service from there.

and when I click next step, the field "Container name port" becomes red with an error "Please configure a container with elb.".

And that is when I do not know what to do next.

I have checked the rules in ELB and there is one configured on port 80, which points the target group by the host name.
The target group exists. However it does not have any targets. Which seems to be fine.
In Route53 a private zone is created and the domain name is being created automatically when I try to create a service. So this also seems to work.
The IAM role for the service has following policies attached:
AWSApplicationDiscoveryServiceFullAccess
AmazonECSTaskExecutionRolePolicy
ElasticLoadBalancingReadOnly
ReadSecrets

I have tried adding
ElasticLoadBalancingFullAccess
AmazonRoute53FullAccess
but without any luck.

Can you please advice what else to check that my be causing this issue?

asked 5 years ago2129 views
2 Answers
0

I have ended with creating a new load balancer for my ECS service.

And it worked totally fine for a few days until I have decided to update the task definition. Result: same error again on 2nd step - "Please configure a container with elb.".

I have tried googling this error, but without any luck. This error clarification would be nice.

answered 5 years ago
0

Solution: is to click the button "Add to load balancer" and configure the parameters there, trying to re-use existing configurations.

After a reply from the support, maybe the problem was that when you create a load balancer for the first time for your service, something is pre-configured, while on the subsequent attempts, you have to do it manually.

answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions