Для этого вы можете использовать CloudWatchEvents из пространства имен Amazon.CloudWatchEvents.
var putRuleRequest = new PutRuleRequest
{
Name = "test",
RoleArn = "IAM_ROLE_ARN",
ScheduleExpression = "rate(5 minutes)",
State = RuleState.ENABLED,
};
var putRuleResponse = client.PutRuleAsync(putRuleRequest).Result;
var putTargets = new PutTargetsRequest()
{
Rule = putRuleResponse.RuleArn,
Targets =
{
new Target
{
Arn = "cluster arn",
RoleArn = "ecs events role",
EcsParameters = new EcsParameters
{
TaskDefinitionArn = "arn for the task definition",
TaskCount = 1
}
}
}
};
var response = await client.PutTargetsAsync(putTargets);
https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html