ECS runs on top of EC2. Therefore, everything that can be done for EC2 can and should be done for ECS, including disk space monitoring. The main difference is that you have more options on how to implement it:
- Your first option consists of duplicating what we did with EC2 and have the cloudwatchmon run on every EC2 instance running ECS. To implement this, you can create a new Ansible role for the ECS host and add the installation and execution of Ansible to the UserData variable of the ecs-cluster-cf-template.py, the way we did in nodeserver-cf-template.py.
- Your second option also relies on the UserData field, but, this time, you create a new container that runs cloudwatchmon and creates a task for it. The UserData ...