AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

ExternalTaskDefinition

The details of a task definition run on an External cluster.

Import

import { ExternalTaskDefinition } from 'aws-cdk-lib/aws-ecs';

Or use the module namespace:

import * as ecs from 'aws-cdk-lib/aws-ecs';
// ecs.ExternalTaskDefinition

Properties

Configuration passed to the constructor as ExternalTaskDefinitionProps.

networkModeOptional
NetworkMode

The networking mode to use for the containers in the task. With ECS Anywhere, supported modes are bridge, host and none.

Default: NetworkMode.BRIDGE

6 properties inherited from CommonTaskDefinitionProps
enableFaultInjectionOptionalinherited from CommonTaskDefinitionProps
boolean

Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes.

Default: undefined - ECS default setting is false

executionRoleOptionalinherited from CommonTaskDefinitionProps
IRole

The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. The role will be used to retrieve container images from ECR and create CloudWatch log groups.

Default: - An execution role will be automatically created if you use ECR images in your task definition.

familyOptionalinherited from CommonTaskDefinitionProps
string

The name of a family that this task definition is registered to. A family groups multiple versions of a task definition.

Default: - Automatically generated name.

proxyConfigurationOptionalinherited from CommonTaskDefinitionProps
ProxyConfiguration

The configuration details for the App Mesh proxy.

Default: - No proxy configuration.

taskRoleOptionalinherited from CommonTaskDefinitionProps
IRole

The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.

Default: - A task role is automatically created for you.

volumesOptionalinherited from CommonTaskDefinitionProps
Volume[]

The list of volume definitions for the task. For more information, see [Task Definition Parameter Volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide//task_definition_parameters.html#volumes).

Default: - No volumes are passed to the Docker daemon on a container instance.

Get the Amazon ECS Cheat Sheet

Everything you need to know about Amazon ECS on one page. HD quality, print-friendly.

Download Free Infographic