We can use ECS task for two different purposes:
- ECS:Service:Task(s) (for long running app (either using EC2/Fargate))
- Where we create task-definition and register with ECS.
- Create ECS service with above created task-definition in required ECS cluster.
- ECS:Task (for one-off job (either using EC2/Fargate))
- Where we create task-definition and register with ECS.
- Programmatically using ECS run_task API-call (through AWS SDK) with passing above task-definition-url and required ECS-Cluster-name to run ECS:task