interface ExternalTaskDefinitionProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ECS.ExternalTaskDefinitionProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#ExternalTaskDefinitionProps |
![]() | software.amazon.awscdk.services.ecs.ExternalTaskDefinitionProps |
![]() | aws_cdk.aws_ecs.ExternalTaskDefinitionProps |
![]() | aws-cdk-lib » aws_ecs » ExternalTaskDefinitionProps |
The properties for a task definition run on an External cluster.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
declare const proxyConfiguration: ecs.ProxyConfiguration;
declare const role: iam.Role;
const externalTaskDefinitionProps: ecs.ExternalTaskDefinitionProps = {
enableFaultInjection: false,
executionRole: role,
family: 'family',
networkMode: ecs.NetworkMode.NONE,
proxyConfiguration: proxyConfiguration,
taskRole: role,
volumes: [{
name: 'name',
// the properties below are optional
configuredAtLaunch: false,
dockerVolumeConfiguration: {
driver: 'driver',
scope: ecs.Scope.TASK,
// the properties below are optional
autoprovision: false,
driverOpts: {
driverOptsKey: 'driverOpts',
},
labels: {
labelsKey: 'labels',
},
},
efsVolumeConfiguration: {
fileSystemId: 'fileSystemId',
// the properties below are optional
authorizationConfig: {
accessPointId: 'accessPointId',
iam: 'iam',
},
rootDirectory: 'rootDirectory',
transitEncryption: 'transitEncryption',
transitEncryptionPort: 123,
},
host: {
sourcePath: 'sourcePath',
},
}],
};
Properties
Name | Type | Description |
---|---|---|
enable | boolean | Enables fault injection and allows for fault injection requests to be accepted from the task's containers. |
execution | IRole | The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. |
family? | string | The name of a family that this task definition is registered to. |
network | Network | The networking mode to use for the containers in the task. |
proxy | Proxy | The configuration details for the App Mesh proxy. |
task | IRole | The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. |
volumes? | Volume [] | The list of volume definitions for the task. |
enableFaultInjection?
Type:
boolean
(optional, default: undefined - ECS default setting is false)
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.
executionRole?
Type:
IRole
(optional, default: An execution role will be automatically created if you use ECR images in your task definition.)
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.
family?
Type:
string
(optional, default: Automatically generated name.)
The name of a family that this task definition is registered to.
A family groups multiple versions of a task definition.
networkMode?
Type:
Network
(optional, default: NetworkMode.BRIDGE)
The networking mode to use for the containers in the task.
With ECS Anywhere, supported modes are bridge, host and none.
proxyConfiguration?
Type:
Proxy
(optional, default: No proxy configuration.)
The configuration details for the App Mesh proxy.
taskRole?
Type:
IRole
(optional, default: A task role is automatically created for you.)
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
volumes?
Type:
Volume
[]
(optional, default: No volumes are passed to the Docker daemon on a container instance.)
The list of volume definitions for the task.
For more information, see Task Definition Parameter Volumes.