Class EcsTaskProps.Builder

java.lang.Object
software.amazon.awscdk.services.events.targets.EcsTaskProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<EcsTaskProps>
Enclosing interface:
EcsTaskProps

@Stability(Stable) public static final class EcsTaskProps.Builder extends Object implements software.amazon.jsii.Builder<EcsTaskProps>
A builder for EcsTaskProps
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • cluster

      @Stability(Stable) public EcsTaskProps.Builder cluster(ICluster cluster)
      Sets the value of EcsTaskProps.getCluster()
      Parameters:
      cluster - Cluster where service will be deployed. This parameter is required.
      Returns:
      this
    • taskDefinition

      @Stability(Stable) public EcsTaskProps.Builder taskDefinition(ITaskDefinition taskDefinition)
      Parameters:
      taskDefinition - Task Definition of the task that should be started. This parameter is required.
      Returns:
      this
    • assignPublicIp

      @Stability(Stable) public EcsTaskProps.Builder assignPublicIp(Boolean assignPublicIp)
      Parameters:
      assignPublicIp - Specifies whether the task's elastic network interface receives a public IP address. You can specify true only when LaunchType is set to FARGATE.
      Returns:
      this
    • containerOverrides

      @Stability(Stable) public EcsTaskProps.Builder containerOverrides(List<? extends ContainerOverride> containerOverrides)
      Parameters:
      containerOverrides - Container setting overrides. Key is the name of the container to override, value is the values you want to override.
      Returns:
      this
    • enableExecuteCommand

      @Stability(Stable) public EcsTaskProps.Builder enableExecuteCommand(Boolean enableExecuteCommand)
      Parameters:
      enableExecuteCommand - 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.
      Returns:
      this
    • launchType

      @Stability(Stable) public EcsTaskProps.Builder launchType(LaunchType launchType)
      Parameters:
      launchType - 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.
      Returns:
      this
    • platformVersion

      @Stability(Stable) public EcsTaskProps.Builder platformVersion(FargatePlatformVersion platformVersion)
      Parameters:
      platformVersion - The platform version on which to run your task. Unless you have specific compatibility requirements, you don't need to specify this.
      Returns:
      this
    • propagateTags

      @Stability(Stable) public EcsTaskProps.Builder propagateTags(PropagatedTagSource propagateTags)
      Parameters:
      propagateTags - Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated.
      Returns:
      this
    • role

      @Stability(Stable) public EcsTaskProps.Builder role(IRole role)
      Sets the value of EcsTaskProps.getRole()
      Parameters:
      role - Existing IAM role to run the ECS task.
      Returns:
      this
    • securityGroups

      @Stability(Stable) public EcsTaskProps.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      Parameters:
      securityGroups - Existing security groups to use for the task's ENIs. (Only applicable in case the TaskDefinition is configured for AwsVpc networking)
      Returns:
      this
    • subnetSelection

      @Stability(Stable) public EcsTaskProps.Builder subnetSelection(SubnetSelection subnetSelection)
      Parameters:
      subnetSelection - In what subnets to place the task's ENIs. (Only applicable in case the TaskDefinition is configured for AwsVpc networking)
      Returns:
      this
    • tags

      @Stability(Stable) public EcsTaskProps.Builder tags(List<? extends Tag> tags)
      Sets the value of EcsTaskProps.getTags()
      Parameters:
      tags - 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.
      Returns:
      this
    • taskCount

      @Stability(Stable) public EcsTaskProps.Builder taskCount(Number taskCount)
      Sets the value of EcsTaskProps.getTaskCount()
      Parameters:
      taskCount - How many tasks should be started when this event is triggered.
      Returns:
      this
    • deadLetterQueue

      @Stability(Stable) public EcsTaskProps.Builder deadLetterQueue(IQueue deadLetterQueue)
      Parameters:
      deadLetterQueue - The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
      Returns:
      this
    • maxEventAge

      @Stability(Stable) public EcsTaskProps.Builder maxEventAge(Duration maxEventAge)
      Parameters:
      maxEventAge - The maximum age of a request that Lambda sends to a function for processing. Minimum value of 60. Maximum value of 86400.
      Returns:
      this
    • retryAttempts

      @Stability(Stable) public EcsTaskProps.Builder retryAttempts(Number retryAttempts)
      Parameters:
      retryAttempts - The maximum number of times to retry when the function returns an error. Minimum value of 0. Maximum value of 185.
      Returns:
      this
    • build

      @Stability(Stable) public EcsTaskProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<EcsTaskProps>
      Returns:
      a new instance of EcsTaskProps
      Throws:
      NullPointerException - if any required attribute was not provided