class ScheduledTaskBase
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ECS.Patterns.ScheduledTaskBase |
Java | software.amazon.awscdk.services.ecs.patterns.ScheduledTaskBase |
Python | aws_cdk.aws_ecs_patterns.ScheduledTaskBase |
TypeScript (source) | @aws-cdk/aws-ecs-patterns » ScheduledTaskBase |
Implements
IConstruct, IConstruct, IDependable
Extends
Construct
Implemented by
Scheduled, Scheduled
The base class for ScheduledEc2Task and ScheduledFargateTask tasks.
Initializer
new ScheduledTaskBase(scope: Construct, id: string, props: ScheduledTaskBaseProps)
Parameters
- scope
Construct - id
string - props
ScheduledTask Base Props
Constructs a new instance of the ScheduledTaskBase class.
Properties
| Name | Type | Description |
|---|---|---|
| cluster | ICluster | The name of the cluster that hosts the service. |
| desired | number | The desired number of instantiations of the task definition to keep running on the service. |
| event | Rule | The CloudWatch Events rule for the service. |
| node | Construct | The construct tree node associated with this construct. |
| subnet | Subnet | In what subnets to place the task's ENIs. |
cluster
Type:
ICluster
The name of the cluster that hosts the service.
desiredTaskCount
Type:
number
The desired number of instantiations of the task definition to keep running on the service.
The minimum value is 1
eventRule
Type:
Rule
The CloudWatch Events rule for the service.
node
Type:
Construct
The construct tree node associated with this construct.
subnetSelection
Type:
Subnet
In what subnets to place the task's ENIs.
(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
Methods
| Name | Description |
|---|---|
| to | Returns a string representation of this construct. |
| protected add | Adds task as a target of the scheduled event rule. |
| protected add | Create an ECS task using the task definition provided and add it to the scheduled event rule. |
| protected create | Create an AWS Log Driver with the provided streamPrefix. |
| protected get | Returns the default cluster. |
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected addTaskAsTarget(ecsTaskTarget)
protected addTaskAsTarget(ecsTaskTarget: EcsTask): void
Parameters
- ecsTaskTarget
Ecs— the EcsTask to add to the event rule.Task
Adds task as a target of the scheduled event rule.
protected addTaskDefinitionToEventTarget(taskDefinition)
protected addTaskDefinitionToEventTarget(taskDefinition: TaskDefinition): EcsTask
Parameters
- taskDefinition
Task— the TaskDefinition to add to the event rule.Definition
Returns
Create an ECS task using the task definition provided and add it to the scheduled event rule.
protected createAWSLogDriver(prefix)
protected createAWSLogDriver(prefix: string): AwsLogDriver
Parameters
- prefix
string— the Cloudwatch logging prefix.
Returns
Create an AWS Log Driver with the provided streamPrefix.
protected getDefaultCluster(scope, vpc?)
protected getDefaultCluster(scope: Construct, vpc?: IVpc): Cluster
Parameters
Returns
Returns the default cluster.

.NET
Java
Python
TypeScript (