Reputation: 1863
AWS ECS allows you to create scheduled tasks on clusters. I can easily do this through the UI but want to add some automation steps in my Continuous Deployment configuration. While I am able to find the basic documentation provided by Amazon, I cannot find any documentation on how to do this via the CLI nor via the AWS APIs.
I see that they have StartTask API data listed, but it only states:
Custom schedulers use the StartTask API operation to place tasks on specific container instances within your cluster.
They also list Blox in the documentation, but that doesn't appear to have what I want.
Does anyone have any CLI or API examples (any language) that illustrate the programmatic creation of cron-based Scheduled Tasks in an ECS cluster?
Upvotes: 3
Views: 1700
Reputation: 11242
ECS Scheduled Tasks are backed by CloudWatch Event rules, so during the deployment you can use CLI to update CloudWatch Event Rule.
Actual payload of the event is name of the ECS cluster, Task Definition and Task Definition revision. If you try to edit Event via UI you can see that there is an option to define exact revision or to use "latest" option, which is basically not defining revision at all.
So solutions are:
Upvotes: 4