class CfnTaskDefinitionPropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.ECS.Mixins.CfnTaskDefinitionPropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awsecs/mixins#CfnTaskDefinitionPropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.ecs.mixins.CfnTaskDefinitionPropsMixin |
Python | aws_cdk.mixins_preview.aws_ecs.mixins.CfnTaskDefinitionPropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_ecs » mixins » CfnTaskDefinitionPropsMixin |
Implements
IMixin
Extends
Mixin
Registers a new task definition from the supplied family and containerDefinitions .
Optionally, you can add data volumes to your containers with the volumes parameter. For more information about task definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon Elastic Container Service Developer Guide .
You can specify a role for your task with the taskRoleArn parameter. When you specify a role for a task, its containers can then use the latest versions of the AWS CLI or SDKs to make API requests to the AWS services that are specified in the policy that's associated with the role. For more information, see IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide .
You can specify a Docker networking mode for the containers in your task definition with the networkMode parameter. If you specify the awsvpc network mode, the task is allocated an elastic network interface, and you must specify a NetworkConfiguration when you create a service or run a task with the task definition. For more information, see Task Networking in the Amazon Elastic Container Service Developer Guide .
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { mixins } from '@aws-cdk/mixins-preview';
import { mixins as ecs_mixins } from '@aws-cdk/mixins-preview/aws-ecs';
const cfnTaskDefinitionPropsMixin = new ecs_mixins.CfnTaskDefinitionPropsMixin({
containerDefinitions: [{
command: ['command'],
cpu: 123,
credentialSpecs: ['credentialSpecs'],
dependsOn: [{
condition: 'condition',
containerName: 'containerName',
}],
disableNetworking: false,
dnsSearchDomains: ['dnsSearchDomains'],
dnsServers: ['dnsServers'],
dockerLabels: {
dockerLabelsKey: 'dockerLabels',
},
dockerSecurityOptions: ['dockerSecurityOptions'],
entryPoint: ['entryPoint'],
environment: [{
name: 'name',
value: 'value',
}],
environmentFiles: [{
type: 'type',
value: 'value',
}],
essential: false,
extraHosts: [{
hostname: 'hostname',
ipAddress: 'ipAddress',
}],
firelensConfiguration: {
options: {
optionsKey: 'options',
},
type: 'type',
},
healthCheck: {
command: ['command'],
interval: 123,
retries: 123,
startPeriod: 123,
timeout: 123,
},
hostname: 'hostname',
image: 'image',
interactive: false,
links: ['links'],
linuxParameters: {
capabilities: {
add: ['add'],
drop: ['drop'],
},
devices: [{
containerPath: 'containerPath',
hostPath: 'hostPath',
permissions: ['permissions'],
}],
initProcessEnabled: false,
maxSwap: 123,
sharedMemorySize: 123,
swappiness: 123,
tmpfs: [{
containerPath: 'containerPath',
mountOptions: ['mountOptions'],
size: 123,
}],
},
logConfiguration: {
logDriver: 'logDriver',
options: {
optionsKey: 'options',
},
secretOptions: [{
name: 'name',
valueFrom: 'valueFrom',
}],
},
memory: 123,
memoryReservation: 123,
mountPoints: [{
containerPath: 'containerPath',
readOnly: false,
sourceVolume: 'sourceVolume',
}],
name: 'name',
portMappings: [{
appProtocol: 'appProtocol',
containerPort: 123,
containerPortRange: 'containerPortRange',
hostPort: 123,
name: 'name',
protocol: 'protocol',
}],
privileged: false,
pseudoTerminal: false,
readonlyRootFilesystem: false,
repositoryCredentials: {
credentialsParameter: 'credentialsParameter',
},
resourceRequirements: [{
type: 'type',
value: 'value',
}],
restartPolicy: {
enabled: false,
ignoredExitCodes: [123],
restartAttemptPeriod: 123,
},
secrets: [{
name: 'name',
valueFrom: 'valueFrom',
}],
startTimeout: 123,
stopTimeout: 123,
systemControls: [{
namespace: 'namespace',
value: 'value',
}],
ulimits: [{
hardLimit: 123,
name: 'name',
softLimit: 123,
}],
user: 'user',
versionConsistency: 'versionConsistency',
volumesFrom: [{
readOnly: false,
sourceContainer: 'sourceContainer',
}],
workingDirectory: 'workingDirectory',
}],
cpu: 'cpu',
enableFaultInjection: false,
ephemeralStorage: {
sizeInGiB: 123,
},
executionRoleArn: 'executionRoleArn',
family: 'family',
inferenceAccelerators: [{
deviceName: 'deviceName',
deviceType: 'deviceType',
}],
ipcMode: 'ipcMode',
memory: 'memory',
networkMode: 'networkMode',
pidMode: 'pidMode',
placementConstraints: [{
expression: 'expression',
type: 'type',
}],
proxyConfiguration: {
containerName: 'containerName',
proxyConfigurationProperties: [{
name: 'name',
value: 'value',
}],
type: 'type',
},
requiresCompatibilities: ['requiresCompatibilities'],
runtimePlatform: {
cpuArchitecture: 'cpuArchitecture',
operatingSystemFamily: 'operatingSystemFamily',
},
tags: [{
key: 'key',
value: 'value',
}],
taskRoleArn: 'taskRoleArn',
volumes: [{
configuredAtLaunch: false,
dockerVolumeConfiguration: {
autoprovision: false,
driver: 'driver',
driverOpts: {
driverOptsKey: 'driverOpts',
},
labels: {
labelsKey: 'labels',
},
scope: 'scope',
},
efsVolumeConfiguration: {
authorizationConfig: {
accessPointId: 'accessPointId',
iam: 'iam',
},
filesystemId: 'filesystemId',
rootDirectory: 'rootDirectory',
transitEncryption: 'transitEncryption',
transitEncryptionPort: 123,
},
fSxWindowsFileServerVolumeConfiguration: {
authorizationConfig: {
credentialsParameter: 'credentialsParameter',
domain: 'domain',
},
fileSystemId: 'fileSystemId',
rootDirectory: 'rootDirectory',
},
host: {
sourcePath: 'sourcePath',
},
name: 'name',
}],
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnTaskDefinitionPropsMixin(props: CfnTaskDefinitionMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.Task Definition Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::ECS::TaskDefinition.
Properties
| Name | Type | Description |
|---|---|---|
| props | Cfn | |
| strategy | Property | |
| static CFN_PROPERTY_KEYS | string[] |
props
Type:
Cfn
strategy
Type:
Property
static CFN_PROPERTY_KEYS
Type:
string[]
Methods
| Name | Description |
|---|---|
| apply | Apply the mixin properties to the construct. |
| supports(construct) | Check if this mixin supports the given construct. |
applyTo(construct)
public applyTo(construct: IConstruct): IConstruct
Parameters
- construct
IConstruct
Returns
Apply the mixin properties to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct.

.NET
Go
Java
Python
TypeScript