ECS Task

ECS Task Definitions

A task definition contains parameters needed to run Docker containers on Amazon ECS. For example, the docker image and the amount of resources allocated to execute the container are some of the parameters defined in the task definition. In addition, each task definition supports multiple containers.

Click here to learn more about ECS Task Definitions.

Creating the ECS Task

Using the AWS Console, search for ECS

Click on Task Definitions

Start the task definition wizard by clicking on Create New Task Definition

Select Fargate and click on Next Step.

ECS can also be deployed to EC2 instances, click here to learn more.

Fill in the Task Definition Name field with awsbuilders-task-definition

Keep scrolling down - Select 0.5GB for Task Memory (GB) and 0.25vCPU for Task CPU vCPU

Let’s create your container - click on Add container

Use awsbuilders-task-container for the container name and paste the Image URI copied from the AWS ECR console to fill in the image field. Don’t forget to add :latest to the end of the URI.

Example: 123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/awsbuilders-dotnet:latest

Before clicking on Add, set the Port mappings to 80 TCP

After creating the container, click on create to finalize the task definition wizard.