Interface EcsTaskProps

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

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-11T15:55:59.256Z") @Stability(Stable) public interface EcsTaskProps extends software.amazon.jsii.JsiiSerializable, TargetBaseProps
Properties to define an ECS Event Task.

Example:

 import software.amazon.awscdk.services.ecs.*;
 import software.amazon.awscdk.services.ec2.*;
 ICluster cluster;
 TaskDefinition taskDefinition;
 Rule rule = Rule.Builder.create(this, "Rule")
         .schedule(Schedule.rate(Duration.hours(1)))
         .build();
 rule.addTarget(
 EcsTask.Builder.create()
         .cluster(cluster)
         .taskDefinition(taskDefinition)
         .assignPublicIp(true)
         .subnetSelection(SubnetSelection.builder().subnetType(SubnetType.PUBLIC).build())
         .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.
    • getAssignPublicIp

      @Stability(Stable) @Nullable default Boolean getAssignPublicIp()
      Specifies whether the task's elastic network interface receives a public IP address.

      You can specify true only when LaunchType is set to FARGATE.

      Default: - true if the subnet type is PUBLIC, otherwise false

    • 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.

    • getEnableExecuteCommand

      @Stability(Stable) @Nullable default Boolean getEnableExecuteCommand()
      Whether or not to enable the execute command functionality for the containers in this task.

      If true, this enables execute command functionality on all containers in the task.

      Default: - false

    • getLaunchType

      @Stability(Stable) @Nullable default LaunchType getLaunchType()
      Specifies the launch type on which your task is running.

      The launch type that you specify here must match one of the launch type (compatibilities) of the target task.

      Default: - 'EC2' if `isEc2Compatible` for the `taskDefinition` is true, otherwise 'FARGATE'

    • 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:
    • getPropagateTags

      @Stability(Stable) @Nullable default PropagatedTagSource getPropagateTags()
      Specifies whether to propagate the tags from the task definition to the task.

      If no value is specified, the tags are not propagated.

      Default: - Tags will not be propagated

    • getRole

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

      Default: A new IAM role 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

    • getTags

      @Stability(Stable) @Nullable default List<Tag> getTags()
      The metadata that you apply to the task to help you categorize and organize them.

      Each tag consists of a key and an optional value, both of which you define.

      Default: - No additional tags are applied to the task

    • 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