Interface EcsTaskProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
EcsTaskProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:47.728Z") @Stability(Stable) public interface EcsTaskProps extends software.amazon.jsii.JsiiSerializable
Properties to define an ECS Event Task.

Example:

 import software.amazon.awscdk.services.events.Rule;
 import software.amazon.awscdk.services.events.Schedule;
 import software.amazon.awscdk.services.events.targets.EcsTask;
 import software.amazon.awscdk.services.ecs.Cluster;
 import software.amazon.awscdk.services.ecs.TaskDefinition;
 import software.amazon.awscdk.services.iam.Role;
 Cluster cluster;
 TaskDefinition taskDefinition;
 Role role;
 EcsTask ecsTaskTarget = EcsTask.Builder.create().cluster(cluster).taskDefinition(taskDefinition).role(role).build();
 Rule.Builder.create(this, "ScheduleRule")
         .schedule(Schedule.cron(CronOptions.builder().minute("0").hour("4").build()))
         .targets(List.of(ecsTaskTarget))
         .build();
 
  • Method Details

    • getCluster

      @Stability(Stable) @NotNull ICluster getCluster()
      Cluster where service will be deployed.
    • getTaskDefinition

      @Stability(Stable) @NotNull ITaskDefinition getTaskDefinition()
      Task Definition of the task that should be started.
    • getContainerOverrides

      @Stability(Stable) @Nullable default List<ContainerOverride> getContainerOverrides()
      Container setting overrides.

      Key is the name of the container to override, value is the values you want to override.

    • getPlatformVersion

      @Stability(Stable) @Nullable default FargatePlatformVersion getPlatformVersion()
      The platform version on which to run your task.

      Unless you have specific compatibility requirements, you don't need to specify this.

      Default: - ECS will set the Fargate platform version to 'LATEST'

      See Also:
    • getRole

      @Stability(Stable) @Nullable default IRole getRole()
      Existing IAM role to run the ECS task.

      Default: A new IAM role is created

    • getSecurityGroup

      @Stability(Deprecated) @Deprecated @Nullable default ISecurityGroup getSecurityGroup()
      Deprecated.
      use securityGroups instead
      (deprecated) Existing security group to use for the task's ENIs.

      (Only applicable in case the TaskDefinition is configured for AwsVpc networking)

      Default: A new security group is created

    • getSecurityGroups

      @Stability(Stable) @Nullable default List<ISecurityGroup> getSecurityGroups()
      Existing security groups to use for the task's ENIs.

      (Only applicable in case the TaskDefinition is configured for AwsVpc networking)

      Default: A new security group is created

    • getSubnetSelection

      @Stability(Stable) @Nullable default SubnetSelection getSubnetSelection()
      In what subnets to place the task's ENIs.

      (Only applicable in case the TaskDefinition is configured for AwsVpc networking)

      Default: Private subnets

    • getTaskCount

      @Stability(Stable) @Nullable default Number getTaskCount()
      How many tasks should be started when this event is triggered.

      Default: 1

    • builder

      @Stability(Stable) static EcsTaskProps.Builder builder()
      Returns:
      a EcsTaskProps.Builder of EcsTaskProps