Starting and accessing the containers in AWS
In this recipe, we will start our scraper as a service by telling ECS to run our task definition. Then we will check hat it is running by issuing a curl to get contents of a job listing.
Getting ready
We need to do one quick thing before running the task. Tasks in ECS go through revisions. Each time you register a task definition with the same name ("family"), ECS defines a new revision number. You can run any of the revisions.
To run the most recent one, we need to list the task definitions for that family and find the most recent revision number. The following lists all of the task definitions in the cluster. At this point we only have one:
$ aws ecs list-task-definitions { "taskDefinitionArns": [ "arn:aws:ecs:us-west-2:414704166289:task-definition/scraper-as-a-service:17" ] }
Notice my revision number is at 17. While this is my only currently registered version of this task, I have registered (and unregistered) 16 previous revisions...