UNPKG

2.46 kBTypeScriptView Raw
1import { IRole } from '@aws-cdk/aws-iam';
2import { Resource } from '@aws-cdk/core';
3import { Construct } from 'constructs';
4import { IEc2TaskDefinition } from '../ec2/ec2-task-definition';
5import { IFargateTaskDefinition } from '../fargate/fargate-task-definition';
6import { Compatibility, NetworkMode } from './task-definition';
7/**
8 * The properties of ImportedTaskDefinition
9 */
10export interface ImportedTaskDefinitionProps {
11 /**
12 * The arn of the task definition
13 */
14 readonly taskDefinitionArn: string;
15 /**
16 * What launch types this task definition should be compatible with.
17 *
18 * @default Compatibility.EC2_AND_FARGATE
19 */
20 readonly compatibility?: Compatibility;
21 /**
22 * The networking mode to use for the containers in the task.
23 *
24 * @default Network mode cannot be provided to the imported task.
25 */
26 readonly networkMode?: NetworkMode;
27 /**
28 * The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
29 *
30 * @default Permissions cannot be granted to the imported task.
31 */
32 readonly taskRole?: IRole;
33}
34/**
35 * Task definition reference of an imported task
36 */
37export declare class ImportedTaskDefinition extends Resource implements IEc2TaskDefinition, IFargateTaskDefinition {
38 /**
39 * What launch types this task definition should be compatible with.
40 */
41 readonly compatibility: Compatibility;
42 /**
43 * ARN of this task definition
44 */
45 readonly taskDefinitionArn: string;
46 /**
47 * Execution role for this task definition
48 */
49 readonly executionRole?: IRole;
50 /**
51 * The networking mode to use for the containers in the task.
52 */
53 readonly _networkMode?: NetworkMode;
54 /**
55 * The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
56 */
57 readonly _taskRole?: IRole;
58 constructor(scope: Construct, id: string, props: ImportedTaskDefinitionProps);
59 get networkMode(): NetworkMode;
60 get taskRole(): IRole;
61 /**
62 * Return true if the task definition can be run on an EC2 cluster
63 */
64 get isEc2Compatible(): boolean;
65 /**
66 * Return true if the task definition can be run on a Fargate cluster
67 */
68 get isFargateCompatible(): boolean;
69 /**
70 * Return true if the task definition can be run on a ECS Anywhere cluster
71 */
72 get isExternalCompatible(): boolean;
73}