interface CommonTaskDefinitionProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ECS.CommonTaskDefinitionProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#CommonTaskDefinitionProps |
Java | software.amazon.awscdk.services.ecs.CommonTaskDefinitionProps |
Python | aws_cdk.aws_ecs.CommonTaskDefinitionProps |
TypeScript (source) | aws-cdk-lib » aws_ecs » CommonTaskDefinitionProps |
The common properties for all task definitions.
For more information, see Task Definition Parameters.
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 commonTaskDefinitionProps: ecs.CommonTaskDefinitionProps = {
executionRole: role,
family: 'family',
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 |
---|---|---|
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. |
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. |
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.
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.