Class ScheduledEc2TaskProps.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.patterns.ScheduledEc2TaskProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ScheduledEc2TaskProps>
- Enclosing interface:
ScheduledEc2TaskProps
@Stability(Stable)
public static final class ScheduledEc2TaskProps.Builder
extends Object
implements software.amazon.jsii.Builder<ScheduledEc2TaskProps>
A builder for
ScheduledEc2TaskProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofScheduledTaskBaseProps.getCluster()
desiredTaskCount
(Number desiredTaskCount) Sets the value ofScheduledTaskBaseProps.getDesiredTaskCount()
Sets the value ofScheduledTaskBaseProps.getEnabled()
propagateTags
(PropagatedTagSource propagateTags) Sets the value ofScheduledTaskBaseProps.getPropagateTags()
Sets the value ofScheduledTaskBaseProps.getRuleName()
Sets the value ofScheduledTaskBaseProps.getSchedule()
scheduledEc2TaskDefinitionOptions
(ScheduledEc2TaskDefinitionOptions scheduledEc2TaskDefinitionOptions) Sets the value ofScheduledEc2TaskProps.getScheduledEc2TaskDefinitionOptions()
scheduledEc2TaskImageOptions
(ScheduledEc2TaskImageOptions scheduledEc2TaskImageOptions) Sets the value ofScheduledEc2TaskProps.getScheduledEc2TaskImageOptions()
securityGroups
(List<? extends ISecurityGroup> securityGroups) Sets the value ofScheduledTaskBaseProps.getSecurityGroups()
subnetSelection
(SubnetSelection subnetSelection) Sets the value ofScheduledTaskBaseProps.getSubnetSelection()
Sets the value ofScheduledTaskBaseProps.getTags()
Sets the value ofScheduledTaskBaseProps.getVpc()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
scheduledEc2TaskDefinitionOptions
@Stability(Stable) public ScheduledEc2TaskProps.Builder scheduledEc2TaskDefinitionOptions(ScheduledEc2TaskDefinitionOptions scheduledEc2TaskDefinitionOptions) Sets the value ofScheduledEc2TaskProps.getScheduledEc2TaskDefinitionOptions()
- Parameters:
scheduledEc2TaskDefinitionOptions
- The properties to define if using an existing TaskDefinition in this construct. ScheduledEc2TaskDefinitionOptions or ScheduledEc2TaskImageOptions must be defined, but not both.- Returns:
this
-
scheduledEc2TaskImageOptions
@Stability(Stable) public ScheduledEc2TaskProps.Builder scheduledEc2TaskImageOptions(ScheduledEc2TaskImageOptions scheduledEc2TaskImageOptions) Sets the value ofScheduledEc2TaskProps.getScheduledEc2TaskImageOptions()
- Parameters:
scheduledEc2TaskImageOptions
- The properties to define if the construct is to create a TaskDefinition. ScheduledEc2TaskDefinitionOptions or ScheduledEc2TaskImageOptions must be defined, but not both.- Returns:
this
-
schedule
Sets the value ofScheduledTaskBaseProps.getSchedule()
- Parameters:
schedule
- The schedule or rate (frequency) that determines when CloudWatch Events runs the rule. This parameter is required. For more information, see Schedule Expression Syntax for Rules in the Amazon CloudWatch User Guide.- Returns:
this
-
cluster
Sets the value ofScheduledTaskBaseProps.getCluster()
- Parameters:
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.- Returns:
this
-
desiredTaskCount
Sets the value ofScheduledTaskBaseProps.getDesiredTaskCount()
- Parameters:
desiredTaskCount
- The desired number of instantiations of the task definition to keep running on the service.- Returns:
this
-
enabled
Sets the value ofScheduledTaskBaseProps.getEnabled()
- Parameters:
enabled
- Indicates whether the rule is enabled.- Returns:
this
-
propagateTags
@Stability(Stable) public ScheduledEc2TaskProps.Builder propagateTags(PropagatedTagSource propagateTags) Sets the value ofScheduledTaskBaseProps.getPropagateTags()
- 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
-
ruleName
Sets the value ofScheduledTaskBaseProps.getRuleName()
- Parameters:
ruleName
- A name for the rule.- Returns:
this
-
securityGroups
@Stability(Stable) public ScheduledEc2TaskProps.Builder securityGroups(List<? extends ISecurityGroup> securityGroups) Sets the value ofScheduledTaskBaseProps.getSecurityGroups()
- Parameters:
securityGroups
- Existing security groups to use for your service.- Returns:
this
-
subnetSelection
@Stability(Stable) public ScheduledEc2TaskProps.Builder subnetSelection(SubnetSelection subnetSelection) Sets the value ofScheduledTaskBaseProps.getSubnetSelection()
- 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
Sets the value ofScheduledTaskBaseProps.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
-
vpc
Sets the value ofScheduledTaskBaseProps.getVpc()
- Parameters:
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.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<ScheduledEc2TaskProps>
- Returns:
- a new instance of
ScheduledEc2TaskProps
- Throws:
NullPointerException
- if any required attribute was not provided
-