UNPKG

2.88 kBTypeScriptView Raw
1import { Construct } from 'constructs';
2import { CommonTaskDefinitionAttributes, CommonTaskDefinitionProps, IpcMode, ITaskDefinition, NetworkMode, PidMode, TaskDefinition, InferenceAccelerator } from '../base/task-definition';
3import { PlacementConstraint } from '../placement';
4/**
5 * The properties for a task definition run on an EC2 cluster.
6 */
7export interface Ec2TaskDefinitionProps extends CommonTaskDefinitionProps {
8 /**
9 * The Docker networking mode to use for the containers in the task.
10 *
11 * The valid values are NONE, BRIDGE, AWS_VPC, and HOST.
12 *
13 * @default - NetworkMode.BRIDGE for EC2 tasks, AWS_VPC for Fargate tasks.
14 */
15 readonly networkMode?: NetworkMode;
16 /**
17 * An array of placement constraint objects to use for the task. You can
18 * specify a maximum of 10 constraints per task (this limit includes
19 * constraints in the task definition and those specified at run time).
20 *
21 * @default - No placement constraints.
22 */
23 readonly placementConstraints?: PlacementConstraint[];
24 /**
25 * The IPC resource namespace to use for the containers in the task.
26 *
27 * Not supported in Fargate and Windows containers.
28 *
29 * @default - IpcMode used by the task is not specified
30 */
31 readonly ipcMode?: IpcMode;
32 /**
33 * The process namespace to use for the containers in the task.
34 *
35 * Not supported in Fargate and Windows containers.
36 *
37 * @default - PidMode used by the task is not specified
38 */
39 readonly pidMode?: PidMode;
40 /**
41 * The inference accelerators to use for the containers in the task.
42 *
43 * Not supported in Fargate.
44 *
45 * @default - No inference accelerators.
46 */
47 readonly inferenceAccelerators?: InferenceAccelerator[];
48}
49/**
50 * The interface of a task definition run on an EC2 cluster.
51 */
52export interface IEc2TaskDefinition extends ITaskDefinition {
53}
54/**
55 * Attributes used to import an existing EC2 task definition
56 */
57export interface Ec2TaskDefinitionAttributes extends CommonTaskDefinitionAttributes {
58}
59/**
60 * The details of a task definition run on an EC2 cluster.
61 *
62 * @resource AWS::ECS::TaskDefinition
63 */
64export declare class Ec2TaskDefinition extends TaskDefinition implements IEc2TaskDefinition {
65 /**
66 * Imports a task definition from the specified task definition ARN.
67 */
68 static fromEc2TaskDefinitionArn(scope: Construct, id: string, ec2TaskDefinitionArn: string): IEc2TaskDefinition;
69 /**
70 * Imports an existing Ec2 task definition from its attributes
71 */
72 static fromEc2TaskDefinitionAttributes(scope: Construct, id: string, attrs: Ec2TaskDefinitionAttributes): IEc2TaskDefinition;
73 /**
74 * Constructs a new instance of the Ec2TaskDefinition class.
75 */
76 constructor(scope: Construct, id: string, props?: Ec2TaskDefinitionProps);
77}