Class ScheduledTaskBase
The base class for ScheduledEc2Task and ScheduledFargateTask tasks.
Inherited Members
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.AWS.ECS.Patterns.dll
Syntax (csharp)
public abstract class ScheduledTaskBase : Construct, IConstruct, IDependable
Syntax (vb)
Public MustInherit Class ScheduledTaskBase
Inherits Construct
Implements IConstruct, IDependable
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. |
SubnetSelection | In what subnets to place the task's ENIs. |
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
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
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
GetDefaultCluster(Construct, IVpc)
Returns the default cluster.
protected virtual Cluster GetDefaultCluster(Construct scope, IVpc vpc = null)
Parameters
Returns