Class EcsTaskProps
Properties to define an ECS Event Task.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Events.Targets
Assembly: Amazon.CDK.AWS.Events.Targets.dll
Syntax (csharp)
public class EcsTaskProps : Object, IEcsTaskProps
Syntax (vb)
Public Class EcsTaskProps
Inherits Object
Implements IEcsTaskProps
Remarks
ExampleMetadata: fixture=basic infused
Examples
using Amazon.CDK.AWS.Events;
using Amazon.CDK.AWS.Events.Targets;
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.IAM;
Cluster cluster;
TaskDefinition taskDefinition;
Role role;
var ecsTaskTarget = new EcsTask(new EcsTaskProps { Cluster = cluster, TaskDefinition = taskDefinition, Role = role });
new Rule(this, "ScheduleRule", new RuleProps {
Schedule = Schedule.Cron(new CronOptions { Minute = "0", Hour = "4" }),
Targets = new [] { ecsTaskTarget }
});
Synopsis
Constructors
EcsTaskProps() |
Properties
Cluster | Cluster where service will be deployed. |
ContainerOverrides | Container setting overrides. |
PlatformVersion | The platform version on which to run your task. |
Role | Existing IAM role to run the ECS task. |
SecurityGroup | (deprecated) Existing security group to use for the task's ENIs. |
SecurityGroups | Existing security groups to use for the task's ENIs. |
SubnetSelection | In what subnets to place the task's ENIs. |
TaskCount | How many tasks should be started when this event is triggered. |
TaskDefinition | Task Definition of the task that should be started. |
Constructors
EcsTaskProps()
public EcsTaskProps()
Properties
Cluster
Cluster where service will be deployed.
public ICluster Cluster { get; set; }
Property Value
ContainerOverrides
Container setting overrides.
public IContainerOverride[] ContainerOverrides { get; set; }
Property Value
Remarks
Key is the name of the container to override, value is the values you want to override.
PlatformVersion
The platform version on which to run your task.
public Nullable<FargatePlatformVersion> PlatformVersion { get; set; }
Property Value
System.Nullable<FargatePlatformVersion>
Remarks
Unless you have specific compatibility requirements, you don't need to specify this.
Default: - ECS will set the Fargate platform version to 'LATEST'
See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html
Role
Existing IAM role to run the ECS task.
public IRole Role { get; set; }
Property Value
Remarks
Default: A new IAM role is created
SecurityGroup
(deprecated) Existing security group to use for the task's ENIs.
public ISecurityGroup SecurityGroup { get; set; }
Property Value
Remarks
(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
Default: A new security group is created
Stability: Deprecated
SecurityGroups
Existing security groups to use for the task's ENIs.
public ISecurityGroup[] SecurityGroups { get; set; }
Property Value
Remarks
(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
Default: A new security group is 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
TaskCount
How many tasks should be started when this event is triggered.
public Nullable<double> TaskCount { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: 1
TaskDefinition
Task Definition of the task that should be started.
public ITaskDefinition TaskDefinition { get; set; }
Property Value