class EcsRunEc2Task
| Language | Type name | 
|---|---|
|  .NET | Amazon.CDK.AWS.Scheduler.Targets.EcsRunEc2Task | 
|  Go | github.com/aws/aws-cdk-go/awscdk/v2/awsschedulertargets#EcsRunEc2Task | 
|  Java | software.amazon.awscdk.services.scheduler.targets.EcsRunEc2Task | 
|  Python | aws_cdk.aws_scheduler_targets.EcsRunEc2Task | 
|  TypeScript (source) | aws-cdk-lib»aws_scheduler_targets»EcsRunEc2Task | 
Implements
ISchedule
Extends
Ecs
Schedule an ECS Task on EC2 using AWS EventBridge Scheduler.
Example
import * as ecs from 'aws-cdk-lib/aws-ecs';
declare const cluster: ecs.ICluster;
declare const taskDefinition: ecs.Ec2TaskDefinition;
new Schedule(this, 'Schedule', {
  schedule: ScheduleExpression.rate(cdk.Duration.minutes(60)),
  target: new targets.EcsRunEc2Task(cluster, {
    taskDefinition,
  }),
});
Initializer
new EcsRunEc2Task(cluster: ICluster, props: Ec2TaskProps)
Parameters
- cluster ICluster
- props Ec2Task Props 
Methods
| Name | Description | 
|---|---|
| bind(schedule) | Create a return a Schedule Target Configuration for the given schedule. | 
| protected bind | 
bind(schedule)
public bind(schedule: ISchedule): ScheduleTargetConfig
Parameters
- schedule ISchedule
Returns
Create a return a Schedule Target Configuration for the given schedule.
protected bindBaseTargetConfig(_schedule)   
protected bindBaseTargetConfig(_schedule: ISchedule): ScheduleTargetConfig
Parameters
- _schedule ISchedule
Returns
