Interface IScheduledTaskBaseProps
The properties for the base ScheduledEc2Task or ScheduledFargateTask task.
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IScheduledTaskBaseProps
Syntax (vb)
Public Interface IScheduledTaskBaseProps
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ApplicationAutoScaling;
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.ECS.Patterns;
Cluster cluster;
Schedule schedule;
SecurityGroup securityGroup;
Subnet subnet;
SubnetFilter subnetFilter;
Vpc vpc;
var scheduledTaskBaseProps = new ScheduledTaskBaseProps {
Schedule = schedule,
// the properties below are optional
Cluster = cluster,
DesiredTaskCount = 123,
Enabled = false,
PropagateTags = PropagatedTagSource.SERVICE,
RuleName = "ruleName",
SecurityGroups = new [] { securityGroup },
SubnetSelection = new SubnetSelection {
AvailabilityZones = new [] { "availabilityZones" },
OnePerAz = false,
SubnetFilters = new [] { subnetFilter },
SubnetGroupName = "subnetGroupName",
Subnets = new [] { subnet },
SubnetType = SubnetType.PRIVATE_ISOLATED
},
Tags = new [] { new Tag {
Key = "key",
Value = "value"
} },
Vpc = vpc
};
Synopsis
Properties
Cluster | The name of the cluster that hosts the service. |
Desired |
The desired number of instantiations of the task definition to keep running on the service. |
Enabled | Indicates whether the rule is enabled. |
Propagate |
Specifies whether to propagate the tags from the task definition to the task. |
Rule |
A name for the rule. |
Schedule | The schedule or rate (frequency) that determines when CloudWatch Events runs the rule. |
Security |
Existing security groups to use for your service. |
Subnet |
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. |
Vpc | The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed. |
Properties
Cluster
The name of the cluster that hosts the service.
virtual ICluster Cluster { get; }
Property Value
Remarks
If a cluster is specified, the vpc construct should be omitted. Alternatively, you can omit both cluster and vpc.
Default: - create a new cluster; if both cluster and vpc are omitted, a new VPC will be created for you.
DesiredTaskCount
The desired number of instantiations of the task definition to keep running on the service.
virtual Nullable<double> DesiredTaskCount { get; }
Property Value
System.
Remarks
Default: 1
Enabled
Indicates whether the rule is enabled.
virtual Nullable<bool> Enabled { get; }
Property Value
System.
Remarks
Default: true
PropagateTags
Specifies whether to propagate the tags from the task definition to the task.
virtual Nullable<PropagatedTagSource> PropagateTags { get; }
Property Value
System.
Remarks
If no value is specified, the tags are not propagated.
Default: - Tags will not be propagated
RuleName
A name for the rule.
virtual string RuleName { get; }
Property Value
System.
Remarks
Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see Name Type.
Schedule
The schedule or rate (frequency) that determines when CloudWatch Events runs the rule.
Schedule Schedule { get; }
Property Value
Remarks
For more information, see Schedule Expression Syntax for Rules in the Amazon CloudWatch User Guide.
SecurityGroups
Existing security groups to use for your service.
virtual ISecurityGroup[] SecurityGroups { get; }
Property Value
Remarks
Default: - a new security group will be created.
SubnetSelection
In what subnets to place the task's ENIs.
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.
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
Vpc
The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.
virtual IVpc Vpc { get; }
Property Value
Remarks
If a vpc is specified, the cluster construct should be omitted. Alternatively, you can omit both vpc and cluster.
Default: - uses the VPC defined in the cluster or creates a new VPC.