Class ScheduledEc2Task.Builder

java.lang.Object
software.amazon.awscdk.services.ecs.patterns.ScheduledEc2Task.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<ScheduledEc2Task>
Enclosing class:
ScheduledEc2Task

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

    • create

      @Stability(Stable) public static ScheduledEc2Task.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of ScheduledEc2Task.Builder.
    • schedule

      @Stability(Stable) public ScheduledEc2Task.Builder schedule(Schedule schedule)
      The schedule or rate (frequency) that determines when CloudWatch Events runs the rule.

      For more information, see Schedule Expression Syntax for Rules in the Amazon CloudWatch User Guide.

      Parameters:
      schedule - The schedule or rate (frequency) that determines when CloudWatch Events runs the rule. This parameter is required.
      Returns:
      this
    • cluster

      @Stability(Stable) public ScheduledEc2Task.Builder cluster(ICluster cluster)
      The name of the cluster that hosts the service.

      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.

      Parameters:
      cluster - The name of the cluster that hosts the service. This parameter is required.
      Returns:
      this
    • desiredTaskCount

      @Stability(Stable) public ScheduledEc2Task.Builder desiredTaskCount(Number desiredTaskCount)
      The desired number of instantiations of the task definition to keep running on the service.

      Default: 1

      Parameters:
      desiredTaskCount - The desired number of instantiations of the task definition to keep running on the service. This parameter is required.
      Returns:
      this
    • enabled

      @Stability(Stable) public ScheduledEc2Task.Builder enabled(Boolean enabled)
      Indicates whether the rule is enabled.

      Default: true

      Parameters:
      enabled - Indicates whether the rule is enabled. This parameter is required.
      Returns:
      this
    • propagateTags

      @Stability(Stable) public ScheduledEc2Task.Builder propagateTags(PropagatedTagSource propagateTags)
      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

      Parameters:
      propagateTags - Specifies whether to propagate the tags from the task definition to the task. This parameter is required.
      Returns:
      this
    • ruleName

      @Stability(Stable) public ScheduledEc2Task.Builder ruleName(String ruleName)
      A name for the rule.

      Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see [Name Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html).

      Parameters:
      ruleName - A name for the rule. This parameter is required.
      Returns:
      this
    • securityGroups

      @Stability(Stable) public ScheduledEc2Task.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      Existing security groups to use for your service.

      Default: - a new security group will be created.

      Parameters:
      securityGroups - Existing security groups to use for your service. This parameter is required.
      Returns:
      this
    • subnetSelection

      @Stability(Stable) public ScheduledEc2Task.Builder subnetSelection(SubnetSelection subnetSelection)
      In what subnets to place the task's ENIs.

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

      Default: Private subnets

      Parameters:
      subnetSelection - In what subnets to place the task's ENIs. This parameter is required.
      Returns:
      this
    • tags

      @Stability(Stable) public ScheduledEc2Task.Builder tags(List<? extends Tag> 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.

      Default: - No tags are applied to the task

      Parameters:
      tags - The metadata that you apply to the task to help you categorize and organize them. This parameter is required.
      Returns:
      this
    • vpc

      @Stability(Stable) public ScheduledEc2Task.Builder vpc(IVpc vpc)
      The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.

      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.

      Parameters:
      vpc - The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed. This parameter is required.
      Returns:
      this
    • scheduledEc2TaskDefinitionOptions

      @Stability(Stable) public ScheduledEc2Task.Builder scheduledEc2TaskDefinitionOptions(ScheduledEc2TaskDefinitionOptions scheduledEc2TaskDefinitionOptions)
      The properties to define if using an existing TaskDefinition in this construct.

      ScheduledEc2TaskDefinitionOptions or ScheduledEc2TaskImageOptions must be defined, but not both.

      Default: none

      Parameters:
      scheduledEc2TaskDefinitionOptions - The properties to define if using an existing TaskDefinition in this construct. This parameter is required.
      Returns:
      this
    • scheduledEc2TaskImageOptions

      @Stability(Stable) public ScheduledEc2Task.Builder scheduledEc2TaskImageOptions(ScheduledEc2TaskImageOptions scheduledEc2TaskImageOptions)
      The properties to define if the construct is to create a TaskDefinition.

      ScheduledEc2TaskDefinitionOptions or ScheduledEc2TaskImageOptions must be defined, but not both.

      Default: none

      Parameters:
      scheduledEc2TaskImageOptions - The properties to define if the construct is to create a TaskDefinition. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public ScheduledEc2Task build()
      Specified by:
      build in interface software.amazon.jsii.Builder<ScheduledEc2Task>
      Returns:
      a newly built instance of ScheduledEc2Task.