Creating a task definition
In this section, we will create a task definition for a hello-world
application using the tutum/hello-world
Docker image. Another Docker image that exposes a HTTP port may also be used, but not all Docker images may be used. As an unsuitable example, the MySQL database Docker image, mysql
, cannot be used with an application load balancer, as it exposes a TCP port, 3306
. For an ECS task that exposes a TCP port, a network load balancer should be used.
- To create a new task definition, select
Task Definitions
in the ECS console, as shown in the following screenshot:
- In
Task Definitions
, click onCreate new Task Definition
, as shown in the following screenshot:
- In
Create new
Task Definition
, selectÂFargate
 as the launch type compatibility, as shown in the following screenshot. Scroll down and click onÂNext step
:
- In
Configure task and container definitions
, specify aTask Definition Name
(hello-world-task-definition
) and selecte
csTaskExecutionRole
 as theTask Role
, as shown...