Class CfnService.PlacementConstraintProperty.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.CfnService.PlacementConstraintProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnService.PlacementConstraintProperty>
- Enclosing interface:
CfnService.PlacementConstraintProperty
@Stability(Stable)
public static final class CfnService.PlacementConstraintProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnService.PlacementConstraintProperty>
A builder for
CfnService.PlacementConstraintProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.expression
(String expression) Sets the value ofCfnService.PlacementConstraintProperty.getExpression()
Sets the value ofCfnService.PlacementConstraintProperty.getType()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
type
Sets the value ofCfnService.PlacementConstraintProperty.getType()
- Parameters:
type
- The type of constraint. This parameter is required. UsedistinctInstance
to ensure that each task in a particular group is running on a different container instance. UsememberOf
to restrict the selection to a group of valid candidates.- Returns:
this
-
expression
@Stability(Stable) public CfnService.PlacementConstraintProperty.Builder expression(String expression) Sets the value ofCfnService.PlacementConstraintProperty.getExpression()
- Parameters:
expression
- A cluster query language expression to apply to the constraint. The expression can have a maximum length of 2000 characters. You can't specify an expression if the constraint type isdistinctInstance
. For more information, see Cluster query language in the Amazon Elastic Container Service Developer Guide .- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnService.PlacementConstraintProperty>
- Returns:
- a new instance of
CfnService.PlacementConstraintProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-