Class CfnTaskDefinitionPropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
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 .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cfnpropertymixins.services.ecs.*;
import software.amazon.awscdk.*;
IMergeStrategy mergeStrategy;
CfnTaskDefinitionPropsMixin cfnTaskDefinitionPropsMixin = CfnTaskDefinitionPropsMixin.Builder.create(CfnTaskDefinitionMixinProps.builder()
.containerDefinitions(List.of(ContainerDefinitionProperty.builder()
.command(List.of("command"))
.cpu(123)
.credentialSpecs(List.of("credentialSpecs"))
.dependsOn(List.of(ContainerDependencyProperty.builder()
.condition("condition")
.containerName("containerName")
.build()))
.disableNetworking(false)
.dnsSearchDomains(List.of("dnsSearchDomains"))
.dnsServers(List.of("dnsServers"))
.dockerLabels(Map.of(
"dockerLabelsKey", "dockerLabels"))
.dockerSecurityOptions(List.of("dockerSecurityOptions"))
.entryPoint(List.of("entryPoint"))
.environment(List.of(KeyValuePairProperty.builder()
.name("name")
.value("value")
.build()))
.environmentFiles(List.of(EnvironmentFileProperty.builder()
.type("type")
.value("value")
.build()))
.essential(false)
.extraHosts(List.of(HostEntryProperty.builder()
.hostname("hostname")
.ipAddress("ipAddress")
.build()))
.firelensConfiguration(FirelensConfigurationProperty.builder()
.options(Map.of(
"optionsKey", "options"))
.type("type")
.build())
.healthCheck(HealthCheckProperty.builder()
.command(List.of("command"))
.interval(123)
.retries(123)
.startPeriod(123)
.timeout(123)
.build())
.hostname("hostname")
.image("image")
.interactive(false)
.links(List.of("links"))
.linuxParameters(LinuxParametersProperty.builder()
.capabilities(KernelCapabilitiesProperty.builder()
.add(List.of("add"))
.drop(List.of("drop"))
.build())
.devices(List.of(DeviceProperty.builder()
.containerPath("containerPath")
.hostPath("hostPath")
.permissions(List.of("permissions"))
.build()))
.initProcessEnabled(false)
.maxSwap(123)
.sharedMemorySize(123)
.swappiness(123)
.tmpfs(List.of(TmpfsProperty.builder()
.containerPath("containerPath")
.mountOptions(List.of("mountOptions"))
.size(123)
.build()))
.build())
.logConfiguration(LogConfigurationProperty.builder()
.logDriver("logDriver")
.options(Map.of(
"optionsKey", "options"))
.secretOptions(List.of(SecretProperty.builder()
.name("name")
.valueFrom("valueFrom")
.build()))
.build())
.memory(123)
.memoryReservation(123)
.mountPoints(List.of(MountPointProperty.builder()
.containerPath("containerPath")
.readOnly(false)
.sourceVolume("sourceVolume")
.build()))
.name("name")
.portMappings(List.of(PortMappingProperty.builder()
.appProtocol("appProtocol")
.containerPort(123)
.containerPortRange("containerPortRange")
.hostPort(123)
.name("name")
.protocol("protocol")
.build()))
.privileged(false)
.pseudoTerminal(false)
.readonlyRootFilesystem(false)
.repositoryCredentials(RepositoryCredentialsProperty.builder()
.credentialsParameter("credentialsParameter")
.build())
.resourceRequirements(List.of(ResourceRequirementProperty.builder()
.type("type")
.value("value")
.build()))
.restartPolicy(RestartPolicyProperty.builder()
.enabled(false)
.ignoredExitCodes(List.of(123))
.restartAttemptPeriod(123)
.build())
.secrets(List.of(SecretProperty.builder()
.name("name")
.valueFrom("valueFrom")
.build()))
.startTimeout(123)
.stopTimeout(123)
.systemControls(List.of(SystemControlProperty.builder()
.namespace("namespace")
.value("value")
.build()))
.ulimits(List.of(UlimitProperty.builder()
.hardLimit(123)
.name("name")
.softLimit(123)
.build()))
.user("user")
.versionConsistency("versionConsistency")
.volumesFrom(List.of(VolumeFromProperty.builder()
.readOnly(false)
.sourceContainer("sourceContainer")
.build()))
.workingDirectory("workingDirectory")
.build()))
.cpu("cpu")
.enableFaultInjection(false)
.ephemeralStorage(EphemeralStorageProperty.builder()
.sizeInGiB(123)
.build())
.executionRoleArn("executionRoleArn")
.family("family")
.inferenceAccelerators(List.of(InferenceAcceleratorProperty.builder()
.deviceName("deviceName")
.deviceType("deviceType")
.build()))
.ipcMode("ipcMode")
.memory("memory")
.networkMode("networkMode")
.pidMode("pidMode")
.placementConstraints(List.of(TaskDefinitionPlacementConstraintProperty.builder()
.expression("expression")
.type("type")
.build()))
.proxyConfiguration(ProxyConfigurationProperty.builder()
.containerName("containerName")
.proxyConfigurationProperties(List.of(KeyValuePairProperty.builder()
.name("name")
.value("value")
.build()))
.type("type")
.build())
.requiresCompatibilities(List.of("requiresCompatibilities"))
.runtimePlatform(RuntimePlatformProperty.builder()
.cpuArchitecture("cpuArchitecture")
.operatingSystemFamily("operatingSystemFamily")
.build())
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.taskRoleArn("taskRoleArn")
.volumes(List.of(VolumeProperty.builder()
.configuredAtLaunch(false)
.dockerVolumeConfiguration(DockerVolumeConfigurationProperty.builder()
.autoprovision(false)
.driver("driver")
.driverOpts(Map.of(
"driverOptsKey", "driverOpts"))
.labels(Map.of(
"labelsKey", "labels"))
.scope("scope")
.build())
.efsVolumeConfiguration(EFSVolumeConfigurationProperty.builder()
.authorizationConfig(AuthorizationConfigProperty.builder()
.accessPointId("accessPointId")
.iam("iam")
.build())
.filesystemId("filesystemId")
.rootDirectory("rootDirectory")
.transitEncryption("transitEncryption")
.transitEncryptionPort(123)
.build())
.fSxWindowsFileServerVolumeConfiguration(FSxWindowsFileServerVolumeConfigurationProperty.builder()
.authorizationConfig(FSxAuthorizationConfigProperty.builder()
.credentialsParameter("credentialsParameter")
.domain("domain")
.build())
.fileSystemId("fileSystemId")
.rootDirectory("rootDirectory")
.build())
.host(HostVolumePropertiesProperty.builder()
.sourcePath("sourcePath")
.build())
.name("name")
.build()))
.build())
.strategy(mergeStrategy)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe authorization configuration details for the Amazon EFS file system.static final classA fluent builder forCfnTaskDefinitionPropsMixin.static interfaceTheContainerDefinitionproperty specifies a container definition.static interfaceTheContainerDependencyproperty specifies the dependencies defined for container startup and shutdown.static interfaceTheDeviceproperty specifies an object representing a container instance host device.static interfaceTheDockerVolumeConfigurationproperty specifies a Docker volume configuration and is used when you use Docker volumes.static interfaceThis parameter is specified when you're using an Amazon Elastic File System file system for task storage.static interfaceA list of files containing the environment variables to pass to a container.static interfaceThe amount of ephemeral storage to allocate for the task.static interfaceThe FireLens configuration for the container.static interfaceThe authorization configuration details for Amazon FSx for Windows File Server file system.static interfaceThis parameter is specified when you're using Amazon FSx for Windows File Server file system for task storage.static interfaceTheHealthCheckproperty specifies an object representing a container health check.static interfaceTheHostEntryproperty specifies a hostname and an IP address that are added to the/etc/hostsfile of a container through theextraHostsparameter of itsContainerDefinitionresource.static interfaceTheHostVolumePropertiesproperty specifies details on a container instance bind mount host volume.static interfaceExample:static interfaceThe Linux capabilities to add or remove from the default Docker configuration for a container defined in the task definition.static interfaceA key-value pair object.static interfaceThe Linux-specific options that are applied to the container, such as Linux KernelCapabilities .static interfaceTheLogConfigurationproperty specifies log configuration options to send to a custom log driver for the container.static interfaceThe details for a volume mount point that's used in a container definition.static interfaceThePortMappingproperty specifies a port mapping.static interfaceThe configuration details for the App Mesh proxy.static interfaceThe repository credentials for private registry authentication.static interfaceThe type and amount of a resource to assign to a container.static interfaceYou can enable a restart policy for each container defined in your task definition, to overcome transient failures faster and maintain task availability.static interfaceInformation about the platform for the Amazon ECS service or task.static interfaceAn object representing the secret to expose to your container.static interfaceA list of namespaced kernel parameters to set in the container.static interfaceThe constraint on task placement in the task definition.static interfaceThe container path, mount options, and size of the tmpfs mount.static interfaceTheulimitsettings to pass to the container.static interfaceDetails on a data volume from another container in the same task definition.static interfaceThe data volume configuration for tasks launched using this task definition.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::ECS::TaskDefinition.Create a mixin to apply properties toAWS::ECS::TaskDefinition.protectedCfnTaskDefinitionPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnTaskDefinitionPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnTaskDefinitionMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_PROPERTY_KEYS
-
-
Constructor Details
-
CfnTaskDefinitionPropsMixin
protected CfnTaskDefinitionPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
CfnTaskDefinitionPropsMixin
protected CfnTaskDefinitionPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnTaskDefinitionPropsMixin
@Stability(Stable) public CfnTaskDefinitionPropsMixin(@NotNull CfnTaskDefinitionMixinProps props, @Nullable CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::ECS::TaskDefinition.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnTaskDefinitionPropsMixin
Create a mixin to apply properties toAWS::ECS::TaskDefinition.- Parameters:
props- L1 properties to apply. This parameter is required.
-
-
Method Details
-
applyTo
@Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct) Apply the mixin properties to the construct. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-