Creating an ECS task definition
Now that you have set up your ECS cluster and understand how ECS container instances register with the cluster, it's time to configure an ECS task definition, which defines the configuration of the containers you want to deploy for your application. ECS task definitions can define one or more containers, along with other elements, such as volumes, that your containers may need to read or write to.
To keep things simple, we are going to create a very basic task definition that will run the official Nginx Docker image, which is published at https://hub.docker.com/_/nginx/. Nginx is a popular web server, which by default will serve a Welcome to Nginx page, and for now this will suffice to represent a simple web application.
Let's now create an ECS task definition for our simple web application by performing the following steps:
- Navigate to the ECS console at Services | Elastic Container Service. You can create a new task definition by selecting Task Definitions...