UNPKG

3.56 kBTypeScriptView Raw
1import { CfnService } from './ecs.generated';
2/**
3 * Instance resource used for bin packing
4 */
5export declare enum BinPackResource {
6 /**
7 * Fill up hosts' CPU allocations first
8 */
9 CPU = "cpu",
10 /**
11 * Fill up hosts' memory allocations first
12 */
13 MEMORY = "memory"
14}
15/**
16 * The placement strategies to use for tasks in the service. For more information, see
17 * [Amazon ECS Task Placement Strategies](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html).
18 *
19 * Tasks will preferentially be placed on instances that match these rules.
20 */
21export declare class PlacementStrategy {
22 private readonly json;
23 /**
24 * Places tasks evenly across all container instances in the cluster.
25 */
26 static spreadAcrossInstances(): PlacementStrategy;
27 /**
28 * Places tasks evenly based on the specified value.
29 *
30 * You can use one of the built-in attributes found on `BuiltInAttributes`
31 * or supply your own custom instance attributes. If more than one attribute
32 * is supplied, spreading is done in order.
33 *
34 * @default attributes instanceId
35 */
36 static spreadAcross(...fields: string[]): PlacementStrategy;
37 /**
38 * Places tasks on container instances with the least available amount of CPU capacity.
39 *
40 * This minimizes the number of instances in use.
41 */
42 static packedByCpu(): PlacementStrategy;
43 /**
44 * Places tasks on container instances with the least available amount of memory capacity.
45 *
46 * This minimizes the number of instances in use.
47 */
48 static packedByMemory(): PlacementStrategy;
49 /**
50 * Places tasks on the container instances with the least available capacity of the specified resource.
51 */
52 static packedBy(resource: BinPackResource): PlacementStrategy;
53 /**
54 * Places tasks randomly.
55 */
56 static randomly(): PlacementStrategy;
57 /**
58 * Constructs a new instance of the PlacementStrategy class.
59 */
60 private constructor();
61 /**
62 * Return the placement JSON
63 */
64 toJson(): CfnService.PlacementStrategyProperty[];
65}
66/**
67 * The placement constraints to use for tasks in the service. For more information, see
68 * [Amazon ECS Task Placement Constraints](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html).
69 *
70 * Tasks will only be placed on instances that match these rules.
71 */
72export declare class PlacementConstraint {
73 private readonly json;
74 /**
75 * Use distinctInstance to ensure that each task in a particular group is running on a different container instance.
76 */
77 static distinctInstances(): PlacementConstraint;
78 /**
79 * Use memberOf to restrict the selection to a group of valid candidates specified by a query expression.
80 *
81 * Multiple expressions can be specified. For more information, see
82 * [Cluster Query Language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html).
83 *
84 * You can specify multiple expressions in one call. The tasks will only be placed on instances matching all expressions.
85 *
86 * @see https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html
87 */
88 static memberOf(...expressions: string[]): PlacementConstraint;
89 /**
90 * Constructs a new instance of the PlacementConstraint class.
91 */
92 private constructor();
93 /**
94 * Return the placement JSON
95 */
96 toJson(): CfnService.PlacementConstraintProperty[];
97}
98
\No newline at end of file