Create a service with the task definition

Once the task definition has been registered, you can place the task in the cluster. You can create a service with the task definition and place one task in the cluster:

  • Using AWS Management Console:
    1. On the Task Definition: packt-windows registration confirmation page, select ActionsCreate Service.
    2. On the Create Service page, enter the following information and then choose Create service:
      • Cluster: PacktWindowsCluster
      • Number of tasks: 1
      • Service name: PacktWindowsService
  • Using the AWS CLI:

Run the following command to create your service:

aws ecs create-service --cluster PacktWindowsCluster --task-definition packt-windows --desired-count 1 --service-name PacktWindowsService

Get Expert AWS Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.