Class ScheduledFargateTaskProps
The properties for the ScheduledFargateTask task.
Inheritance
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.AWS.ECS.Patterns.dll
Syntax (csharp)
public class ScheduledFargateTaskProps : Object, IScheduledFargateTaskProps, IScheduledTaskBaseProps
Syntax (vb)
Public Class ScheduledFargateTaskProps
Inherits Object
Implements IScheduledFargateTaskProps, IScheduledTaskBaseProps
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
var scheduledFargateTask = new ScheduledFargateTask(this, "ScheduledFargateTask", new ScheduledFargateTaskProps {
Cluster = cluster,
ScheduledFargateTaskImageOptions = new ScheduledFargateTaskImageOptions {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
MemoryLimitMiB = 512
},
Schedule = Schedule.Expression("rate(1 minute)"),
PlatformVersion = FargatePlatformVersion.LATEST
});
Synopsis
Constructors
ScheduledFargateTaskProps() |
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. |
PlatformVersion | The platform version on which to run your service. |
RuleName | A name for the rule. |
Schedule | The schedule or rate (frequency) that determines when CloudWatch Events runs the rule. |
ScheduledFargateTaskDefinitionOptions | The properties to define if using an existing TaskDefinition in this construct. |
ScheduledFargateTaskImageOptions | The properties to define if the construct is to create a TaskDefinition. |
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
ScheduledFargateTaskProps()
public ScheduledFargateTaskProps()
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
PlatformVersion
The platform version on which to run your service.
public Nullable<FargatePlatformVersion> PlatformVersion { get; set; }
Property Value
System.Nullable<FargatePlatformVersion>
Remarks
If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.
Default: Latest
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.
ScheduledFargateTaskDefinitionOptions
The properties to define if using an existing TaskDefinition in this construct.
public IScheduledFargateTaskDefinitionOptions ScheduledFargateTaskDefinitionOptions { get; set; }
Property Value
IScheduledFargateTaskDefinitionOptions
Remarks
ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions must be defined, but not both.
Default: none
ScheduledFargateTaskImageOptions
The properties to define if the construct is to create a TaskDefinition.
public IScheduledFargateTaskImageOptions ScheduledFargateTaskImageOptions { get; set; }
Property Value
IScheduledFargateTaskImageOptions
Remarks
ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions must be defined, but not both.
Default: none
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.