UNPKG

4.2 kBTypeScriptView Raw
1import { Construct } from 'constructs';
2import { CommonTaskDefinitionAttributes, CommonTaskDefinitionProps, ITaskDefinition, NetworkMode, TaskDefinition } from '../base/task-definition';
3import { RuntimePlatform } from '../runtime-platform';
4/**
5 * The properties for a task definition.
6 */
7export interface FargateTaskDefinitionProps extends CommonTaskDefinitionProps {
8 /**
9 * The number of cpu units used by the task. For tasks using the Fargate launch type,
10 * this field is required and you must use one of the following values,
11 * which determines your range of valid values for the memory parameter:
12 *
13 * 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB)
14 *
15 * 512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB)
16 *
17 * 1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB)
18 *
19 * 2048 (2 vCPU) - Available memory values: Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB)
20 *
21 * 4096 (4 vCPU) - Available memory values: Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB)
22 *
23 * @default 256
24 */
25 readonly cpu?: number;
26 /**
27 * The amount (in MiB) of memory used by the task. For tasks using the Fargate launch type,
28 * this field is required and you must use one of the following values, which determines your range of valid values for the cpu parameter:
29 *
30 * 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU)
31 *
32 * 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU)
33 *
34 * 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU)
35 *
36 * Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU)
37 *
38 * Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU)
39 *
40 * @default 512
41 */
42 readonly memoryLimitMiB?: number;
43 /**
44 * The amount (in GiB) of ephemeral storage to be allocated to the task. The maximum supported value is 200 GiB.
45 *
46 * NOTE: This parameter is only supported for tasks hosted on AWS Fargate using platform version 1.4.0 or later.
47 *
48 * @default 20
49 */
50 readonly ephemeralStorageGiB?: number;
51 /**
52 * The operating system that your task definitions are running on.
53 *
54 * A runtimePlatform is supported only for tasks using the Fargate launch type.
55 *
56 * @default - Undefined.
57 */
58 readonly runtimePlatform?: RuntimePlatform;
59}
60/**
61 * The interface of a task definition run on a Fargate cluster.
62 */
63export interface IFargateTaskDefinition extends ITaskDefinition {
64}
65/**
66 * Attributes used to import an existing Fargate task definition
67 */
68export interface FargateTaskDefinitionAttributes extends CommonTaskDefinitionAttributes {
69}
70/**
71 * The details of a task definition run on a Fargate cluster.
72 *
73 * @resource AWS::ECS::TaskDefinition
74 */
75export declare class FargateTaskDefinition extends TaskDefinition implements IFargateTaskDefinition {
76 /**
77 * Imports a task definition from the specified task definition ARN.
78 */
79 static fromFargateTaskDefinitionArn(scope: Construct, id: string, fargateTaskDefinitionArn: string): IFargateTaskDefinition;
80 /**
81 * Import an existing Fargate task definition from its attributes
82 */
83 static fromFargateTaskDefinitionAttributes(scope: Construct, id: string, attrs: FargateTaskDefinitionAttributes): IFargateTaskDefinition;
84 /**
85 * The Docker networking mode to use for the containers in the task. Fargate tasks require the awsvpc network mode.
86 */
87 readonly networkMode: NetworkMode;
88 /**
89 * The amount (in GiB) of ephemeral storage to be allocated to the task.
90 */
91 readonly ephemeralStorageGiB?: number;
92 /**
93 * Constructs a new instance of the FargateTaskDefinition class.
94 */
95 constructor(scope: Construct, id: string, props?: FargateTaskDefinitionProps);
96}