PlacementConstraint

class aws_cdk.aws_ecs.PlacementConstraint

Bases: object

The placement constraints to use for tasks in the service. For more information, see Amazon ECS Task Placement Constraints.

Tasks will only be placed on instances that match these rules.

Methods

to_json()

Return the placement JSON.

Return type

List[PlacementConstraintProperty]

Static Methods

classmethod distinct_instances()

Use distinctInstance to ensure that each task in a particular group is running on a different container instance.

Return type

PlacementConstraint

classmethod member_of(*expressions)

Use memberOf to restrict the selection to a group of valid candidates specified by a query expression.

Multiple expressions can be specified. For more information, see Cluster Query Language.

You can specify multiple expressions in one call. The tasks will only be placed on instances matching all expressions.

Parameters

expressions (str) –

see :see: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html

Return type

PlacementConstraint