Search code examples
amazon-web-servicesamazon-ec2amazon-ecsaws-application-load-balancer

Unable to create service in Amazon ECS using Application Load Balancer. No error message given


I am trying to create a service on an ecs cluster with an application load balancer to run a task definition with two containers, an api, and redis. When I attempt to create the service I get the error, "Failed creation of service /n Service creation failed:", which doesn't give me any information on the error.

I would like the service to automatically register the correct port of my ecs ec2 by having the service create a new target group for me. My api container has host port: 0, and container port: 3000. My redis container has host port: 0 and container port: 6379, both using tcp.

I will paste the text version of my service configuration below.

Review

Cluster: rest-api-explorer
Launch type: EC2
Task Definition: rest-api-explorer:19
Service name: rest-api-service
Service type: DAEMON
Minimum healthy: percent 0
Maximum percent: 100

Configure network
Health check grace period: 10
Container Name: api-rest-explorer
Container Port: 3000
ELB Name: rest-api-explorer
Target Group: ecs-created-rest-api-service
Health Check Path: /api/rest/console
Listener Port: 3000
Path-pattern: /api/rest/console
Service Role: AWSServiceRoleForECS

Set Auto Scaling (optional)
not configured


Solution

  • After attempting to start the service with aws cli, I've found that it was an iam permissions related issue. Lesson learned is that aws cli is better for getting error messages than console.