Interface CfnService.IPlacementConstraintProperty
An object representing a constraint on task placement.
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IPlacementConstraintProperty
Syntax (vb)
Public Interface IPlacementConstraintProperty
Remarks
For more information, see Task placement constraints in the Amazon Elastic Container Service Developer Guide .
If you're using the Fargate launch type, task placement constraints aren't supported.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;
var placementConstraintProperty = new PlacementConstraintProperty {
Type = "type",
// the properties below are optional
Expression = "expression"
};
Synopsis
Properties
Expression | A cluster query language expression to apply to the constraint. |
Type | The type of constraint. |
Properties
Expression
A cluster query language expression to apply to the constraint.
virtual string Expression { get; }
Property Value
System.String
Remarks
The expression can have a maximum length of 2000 characters. You can't specify an expression if the constraint type is distinctInstance
. For more information, see Cluster query language in the Amazon Elastic Container Service Developer Guide .
Type
The type of constraint.
string Type { get; }
Property Value
System.String
Remarks
Use distinctInstance
to ensure that each task in a particular group is running on a different container instance. Use memberOf
to restrict the selection to a group of valid candidates.