Class ScheduledTaskBaseProps
The properties for the base ScheduledEc2Task or ScheduledFargateTask task.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.AWS.ECS.Patterns.dll
Syntax (csharp)
public class ScheduledTaskBaseProps : Object, IScheduledTaskBaseProps
Syntax (vb)
Public Class ScheduledTaskBaseProps
Inherits Object
Implements 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,
RuleName = "ruleName",
SecurityGroups = new [] { securityGroup },
SubnetSelection = new SubnetSelection {
AvailabilityZones = new [] { "availabilityZones" },
OnePerAz = false,
SubnetFilters = new [] { subnetFilter },
SubnetGroupName = "subnetGroupName",
SubnetName = "subnetName",
Subnets = new [] { subnet },
SubnetType = SubnetType.ISOLATED
},
Vpc = vpc
};
Synopsis
Constructors
ScheduledTaskBaseProps() |
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. |
Enabled | Indicates whether the rule is enabled. |
RuleName | A name for the rule. |
Schedule | The schedule or rate (frequency) that determines when CloudWatch Events runs the rule. |
SecurityGroups | Existing security groups to use for your service. |
SubnetSelection | In what subnets to place the task's ENIs. |
Vpc | The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed. |
Constructors
ScheduledTaskBaseProps()
public ScheduledTaskBaseProps()
Properties
Cluster
The name of the cluster that hosts the service.
public ICluster Cluster { get; set; }
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.
public Nullable<double> DesiredTaskCount { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: 1
Enabled
Indicates whether the rule is enabled.
public Nullable<bool> Enabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
RuleName
A name for the rule.
public string RuleName { get; set; }
Property Value
System.String
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.
public Schedule Schedule { get; set; }
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.
public ISecurityGroup[] SecurityGroups { get; set; }
Property Value
Remarks
Default: - a new security group will be created.
SubnetSelection
In what subnets to place the task's ENIs.
public ISubnetSelection SubnetSelection { get; set; }
Property Value
Remarks
(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
Default: Private subnets
Vpc
The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.
public IVpc Vpc { get; set; }
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.