Class ScheduledFargateTaskProps.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.patterns.ScheduledFargateTaskProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ScheduledFargateTaskProps>
- Enclosing interface:
- ScheduledFargateTaskProps
@Stability(Stable)
public static final class ScheduledFargateTaskProps.Builder
extends Object
implements software.amazon.jsii.Builder<ScheduledFargateTaskProps>
A builder for
ScheduledFargateTaskProps
-
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()
platformVersion
(FargatePlatformVersion platformVersion) Sets the value ofScheduledFargateTaskProps.getPlatformVersion()
Sets the value ofScheduledTaskBaseProps.getRuleName()
Sets the value ofScheduledTaskBaseProps.getSchedule()
scheduledFargateTaskDefinitionOptions
(ScheduledFargateTaskDefinitionOptions scheduledFargateTaskDefinitionOptions) Sets the value ofScheduledFargateTaskProps.getScheduledFargateTaskDefinitionOptions()
scheduledFargateTaskImageOptions
(ScheduledFargateTaskImageOptions scheduledFargateTaskImageOptions) Sets the value ofScheduledFargateTaskProps.getScheduledFargateTaskImageOptions()
securityGroups
(List<? extends ISecurityGroup> securityGroups) Sets the value ofScheduledTaskBaseProps.getSecurityGroups()
subnetSelection
(SubnetSelection subnetSelection) Sets the value ofScheduledTaskBaseProps.getSubnetSelection()
Sets the value ofScheduledTaskBaseProps.getVpc()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
platformVersion
@Stability(Stable) public ScheduledFargateTaskProps.Builder platformVersion(FargatePlatformVersion platformVersion) Sets the value ofScheduledFargateTaskProps.getPlatformVersion()
- Parameters:
platformVersion
- The platform version on which to run your service. If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.- Returns:
this
-
scheduledFargateTaskDefinitionOptions
@Stability(Stable) public ScheduledFargateTaskProps.Builder scheduledFargateTaskDefinitionOptions(ScheduledFargateTaskDefinitionOptions scheduledFargateTaskDefinitionOptions) Sets the value ofScheduledFargateTaskProps.getScheduledFargateTaskDefinitionOptions()
- Parameters:
scheduledFargateTaskDefinitionOptions
- The properties to define if using an existing TaskDefinition in this construct. ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions must be defined, but not both.- Returns:
this
-
scheduledFargateTaskImageOptions
@Stability(Stable) public ScheduledFargateTaskProps.Builder scheduledFargateTaskImageOptions(ScheduledFargateTaskImageOptions scheduledFargateTaskImageOptions) Sets the value ofScheduledFargateTaskProps.getScheduledFargateTaskImageOptions()
- Parameters:
scheduledFargateTaskImageOptions
- The properties to define if the construct is to create a TaskDefinition. ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions 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
@Stability(Stable) public ScheduledFargateTaskProps.Builder desiredTaskCount(Number 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
-
ruleName
Sets the value ofScheduledTaskBaseProps.getRuleName()
- Parameters:
ruleName
- A name for the rule.- Returns:
this
-
securityGroups
@Stability(Stable) public ScheduledFargateTaskProps.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 ScheduledFargateTaskProps.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
-
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<ScheduledFargateTaskProps>
- Returns:
- a new instance of
ScheduledFargateTaskProps
- Throws:
NullPointerException
- if any required attribute was not provided
-