Run the task
Now that you have the Docker image stored in ECR and an ECS cluster and Task Definition ready to run the container, you can actually run the service to start monitoring a Twitch chat automatically.
- Navigate to the Amazon ECS console and choose Task Definitions in the left menu.
- Select the checkbox of the Task Definition you just created.
- In the Actions drop down menu, select Run Task.
- In the VPC and security groups section, choose the Default VPC for your account and one of its subnets. You can find the default VPC by sorting your list of VPCs by isDefault. If you don’t have a Default VPC, you can choose another VPC and a subnet that has access to the internet.
- Expand the Advanced Options section, then expand the named container in the Container Overrides section.
- In Command override, add a comma-separated list of command-line arguments. So for example enter
-c,tekken,-d,600000 to monitor the #tekken channel for 10 minutes (600,000 milliseconds).
- Choose Run Task.
If you click the Task link, you can view the status of the task. After the Last status changes to ‘RUNNING’, you should be able to see some logs in the Logs tab. After a few minutes, go back to CloudWatch to view negative sentiment for the channel you are monitoring.