Class ScheduledTaskBase
The base class for ScheduledEc2Task and ScheduledFargateTask tasks.
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class ScheduledTaskBase : Construct
Syntax (vb)
Public MustInherit Class ScheduledTaskBase
Inherits Construct
Synopsis
Constructors
ScheduledTaskBase(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ScheduledTaskBase(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
ScheduledTaskBase(Construct, String, IScheduledTaskBaseProps) | Constructs a new instance of the ScheduledTaskBase class. |
Properties
Cluster | The name of the cluster that hosts the service. |
DesiredTaskCount | The desired number of instantiations of the task definition to keep running on the service. |
EventRule | The CloudWatch Events rule for the service. |
PropagateTags | Specifies whether to propagate the tags from the task definition to the task. |
SubnetSelection | In what subnets to place the task's ENIs. |
Tags | The metadata that you apply to the task to help you categorize and organize them. |
Methods
AddTaskAsTarget(EcsTask) | Adds task as a target of the scheduled event rule. |
AddTaskDefinitionToEventTarget(TaskDefinition) | Create an ECS task using the task definition provided and add it to the scheduled event rule. |
CreateAWSLogDriver(String) | Create an AWS Log Driver with the provided streamPrefix. |
GetDefaultCluster(Construct, IVpc) | Returns the default cluster. |
Constructors
ScheduledTaskBase(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ScheduledTaskBase(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ScheduledTaskBase(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ScheduledTaskBase(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
ScheduledTaskBase(Construct, String, IScheduledTaskBaseProps)
Constructs a new instance of the ScheduledTaskBase class.
protected ScheduledTaskBase(Construct scope, string id, IScheduledTaskBaseProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IScheduledTaskBaseProps
Properties
Cluster
The name of the cluster that hosts the service.
public virtual ICluster Cluster { get; }
Property Value
DesiredTaskCount
The desired number of instantiations of the task definition to keep running on the service.
public virtual double DesiredTaskCount { get; }
Property Value
System.Double
Remarks
The minimum value is 1
EventRule
The CloudWatch Events rule for the service.
public virtual Rule EventRule { get; }
Property Value
PropagateTags
Specifies whether to propagate the tags from the task definition to the task.
public virtual Nullable<PropagatedTagSource> PropagateTags { get; }
Property Value
System.Nullable<PropagatedTagSource>
Remarks
If no value is specified, the tags are not propagated.
Default: - Tags will not be propagated
SubnetSelection
In what subnets to place the task's ENIs.
public virtual ISubnetSelection SubnetSelection { get; }
Property Value
Remarks
(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
Default: Private subnets
Tags
The metadata that you apply to the task to help you categorize and organize them.
public virtual ITag[] Tags { get; }
Property Value
ITag[]
Remarks
Each tag consists of a key and an optional value, both of which you define.
Default: - No tags are applied to the task
Methods
AddTaskAsTarget(EcsTask)
Adds task as a target of the scheduled event rule.
protected virtual void AddTaskAsTarget(EcsTask ecsTaskTarget)
Parameters
- ecsTaskTarget EcsTask
the EcsTask to add to the event rule.
AddTaskDefinitionToEventTarget(TaskDefinition)
Create an ECS task using the task definition provided and add it to the scheduled event rule.
protected virtual EcsTask AddTaskDefinitionToEventTarget(TaskDefinition taskDefinition)
Parameters
- taskDefinition TaskDefinition
the TaskDefinition to add to the event rule.
Returns
CreateAWSLogDriver(String)
Create an AWS Log Driver with the provided streamPrefix.
protected virtual AwsLogDriver CreateAWSLogDriver(string prefix)
Parameters
- prefix System.String
the Cloudwatch logging prefix.
Returns