All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.ecs.model.TaskDefinition Maven / Gradle / Ivy

Go to download

The AWS Java SDK for the Amazon EC2 Container Service holds the client classes that are used for communicating with the Amazon EC2 Container Service

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.ecs.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* The details of a task definition which describes the container and volume definitions of an Amazon Elastic Container * Service task. You can specify which Docker images to use, the required resources, and other configurations related to * launching the task definition through an Amazon ECS service or task. *

*/ @Generated("software.amazon.awssdk:codegen") public final class TaskDefinition implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TASK_DEFINITION_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("taskDefinitionArn").getter(getter(TaskDefinition::taskDefinitionArn)) .setter(setter(Builder::taskDefinitionArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("taskDefinitionArn").build()).build(); private static final SdkField> CONTAINER_DEFINITIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("containerDefinitions") .getter(getter(TaskDefinition::containerDefinitions)) .setter(setter(Builder::containerDefinitions)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("containerDefinitions").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(ContainerDefinition::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField FAMILY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("family") .getter(getter(TaskDefinition::family)).setter(setter(Builder::family)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("family").build()).build(); private static final SdkField TASK_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("taskRoleArn").getter(getter(TaskDefinition::taskRoleArn)).setter(setter(Builder::taskRoleArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("taskRoleArn").build()).build(); private static final SdkField EXECUTION_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("executionRoleArn").getter(getter(TaskDefinition::executionRoleArn)) .setter(setter(Builder::executionRoleArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("executionRoleArn").build()).build(); private static final SdkField NETWORK_MODE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("networkMode").getter(getter(TaskDefinition::networkModeAsString)).setter(setter(Builder::networkMode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("networkMode").build()).build(); private static final SdkField REVISION_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("revision").getter(getter(TaskDefinition::revision)).setter(setter(Builder::revision)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("revision").build()).build(); private static final SdkField> VOLUMES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("volumes") .getter(getter(TaskDefinition::volumes)) .setter(setter(Builder::volumes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("volumes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Volume::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(TaskDefinition::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField> REQUIRES_ATTRIBUTES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("requiresAttributes") .getter(getter(TaskDefinition::requiresAttributes)) .setter(setter(Builder::requiresAttributes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("requiresAttributes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Attribute::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> PLACEMENT_CONSTRAINTS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("placementConstraints") .getter(getter(TaskDefinition::placementConstraints)) .setter(setter(Builder::placementConstraints)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("placementConstraints").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(TaskDefinitionPlacementConstraint::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> COMPATIBILITIES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("compatibilities") .getter(getter(TaskDefinition::compatibilitiesAsStrings)) .setter(setter(Builder::compatibilitiesWithStrings)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("compatibilities").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField RUNTIME_PLATFORM_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("runtimePlatform") .getter(getter(TaskDefinition::runtimePlatform)).setter(setter(Builder::runtimePlatform)) .constructor(RuntimePlatform::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("runtimePlatform").build()).build(); private static final SdkField> REQUIRES_COMPATIBILITIES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("requiresCompatibilities") .getter(getter(TaskDefinition::requiresCompatibilitiesAsStrings)) .setter(setter(Builder::requiresCompatibilitiesWithStrings)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("requiresCompatibilities").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField CPU_FIELD = SdkField. builder(MarshallingType.STRING).memberName("cpu") .getter(getter(TaskDefinition::cpu)).setter(setter(Builder::cpu)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cpu").build()).build(); private static final SdkField MEMORY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("memory") .getter(getter(TaskDefinition::memory)).setter(setter(Builder::memory)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("memory").build()).build(); private static final SdkField> INFERENCE_ACCELERATORS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("inferenceAccelerators") .getter(getter(TaskDefinition::inferenceAccelerators)) .setter(setter(Builder::inferenceAccelerators)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("inferenceAccelerators").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(InferenceAccelerator::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField PID_MODE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("pidMode").getter(getter(TaskDefinition::pidModeAsString)).setter(setter(Builder::pidMode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pidMode").build()).build(); private static final SdkField IPC_MODE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ipcMode").getter(getter(TaskDefinition::ipcModeAsString)).setter(setter(Builder::ipcMode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ipcMode").build()).build(); private static final SdkField PROXY_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("proxyConfiguration") .getter(getter(TaskDefinition::proxyConfiguration)).setter(setter(Builder::proxyConfiguration)) .constructor(ProxyConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("proxyConfiguration").build()) .build(); private static final SdkField REGISTERED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("registeredAt").getter(getter(TaskDefinition::registeredAt)).setter(setter(Builder::registeredAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("registeredAt").build()).build(); private static final SdkField DEREGISTERED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("deregisteredAt").getter(getter(TaskDefinition::deregisteredAt)).setter(setter(Builder::deregisteredAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deregisteredAt").build()).build(); private static final SdkField REGISTERED_BY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("registeredBy").getter(getter(TaskDefinition::registeredBy)).setter(setter(Builder::registeredBy)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("registeredBy").build()).build(); private static final SdkField EPHEMERAL_STORAGE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ephemeralStorage") .getter(getter(TaskDefinition::ephemeralStorage)).setter(setter(Builder::ephemeralStorage)) .constructor(EphemeralStorage::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ephemeralStorage").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TASK_DEFINITION_ARN_FIELD, CONTAINER_DEFINITIONS_FIELD, FAMILY_FIELD, TASK_ROLE_ARN_FIELD, EXECUTION_ROLE_ARN_FIELD, NETWORK_MODE_FIELD, REVISION_FIELD, VOLUMES_FIELD, STATUS_FIELD, REQUIRES_ATTRIBUTES_FIELD, PLACEMENT_CONSTRAINTS_FIELD, COMPATIBILITIES_FIELD, RUNTIME_PLATFORM_FIELD, REQUIRES_COMPATIBILITIES_FIELD, CPU_FIELD, MEMORY_FIELD, INFERENCE_ACCELERATORS_FIELD, PID_MODE_FIELD, IPC_MODE_FIELD, PROXY_CONFIGURATION_FIELD, REGISTERED_AT_FIELD, DEREGISTERED_AT_FIELD, REGISTERED_BY_FIELD, EPHEMERAL_STORAGE_FIELD)); private static final long serialVersionUID = 1L; private final String taskDefinitionArn; private final List containerDefinitions; private final String family; private final String taskRoleArn; private final String executionRoleArn; private final String networkMode; private final Integer revision; private final List volumes; private final String status; private final List requiresAttributes; private final List placementConstraints; private final List compatibilities; private final RuntimePlatform runtimePlatform; private final List requiresCompatibilities; private final String cpu; private final String memory; private final List inferenceAccelerators; private final String pidMode; private final String ipcMode; private final ProxyConfiguration proxyConfiguration; private final Instant registeredAt; private final Instant deregisteredAt; private final String registeredBy; private final EphemeralStorage ephemeralStorage; private TaskDefinition(BuilderImpl builder) { this.taskDefinitionArn = builder.taskDefinitionArn; this.containerDefinitions = builder.containerDefinitions; this.family = builder.family; this.taskRoleArn = builder.taskRoleArn; this.executionRoleArn = builder.executionRoleArn; this.networkMode = builder.networkMode; this.revision = builder.revision; this.volumes = builder.volumes; this.status = builder.status; this.requiresAttributes = builder.requiresAttributes; this.placementConstraints = builder.placementConstraints; this.compatibilities = builder.compatibilities; this.runtimePlatform = builder.runtimePlatform; this.requiresCompatibilities = builder.requiresCompatibilities; this.cpu = builder.cpu; this.memory = builder.memory; this.inferenceAccelerators = builder.inferenceAccelerators; this.pidMode = builder.pidMode; this.ipcMode = builder.ipcMode; this.proxyConfiguration = builder.proxyConfiguration; this.registeredAt = builder.registeredAt; this.deregisteredAt = builder.deregisteredAt; this.registeredBy = builder.registeredBy; this.ephemeralStorage = builder.ephemeralStorage; } /** *

* The full Amazon Resource Name (ARN) of the task definition. *

* * @return The full Amazon Resource Name (ARN) of the task definition. */ public final String taskDefinitionArn() { return taskDefinitionArn; } /** * For responses, this returns true if the service returned a value for the ContainerDefinitions property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasContainerDefinitions() { return containerDefinitions != null && !(containerDefinitions instanceof SdkAutoConstructList); } /** *

* A list of container definitions in JSON format that describe the different containers that make up your task. For * more information about container definition parameters and defaults, see Amazon ECS Task * Definitions in the Amazon Elastic Container Service Developer Guide. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasContainerDefinitions} method. *

* * @return A list of container definitions in JSON format that describe the different containers that make up your * task. For more information about container definition parameters and defaults, see Amazon ECS Task * Definitions in the Amazon Elastic Container Service Developer Guide. */ public final List containerDefinitions() { return containerDefinitions; } /** *

* The name of a family that this task definition is registered to. Up to 255 characters are allowed. Letters (both * uppercase and lowercase letters), numbers, hyphens (-), and underscores (_) are allowed. *

*

* A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that you * registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each task * definition that you add. *

* * @return The name of a family that this task definition is registered to. Up to 255 characters are allowed. * Letters (both uppercase and lowercase letters), numbers, hyphens (-), and underscores (_) are * allowed.

*

* A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that * you registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each * task definition that you add. */ public final String family() { return family; } /** *

* The short name or full Amazon Resource Name (ARN) of the Identity and Access Management role that grants * containers in the task permission to call Amazon Web Services APIs on your behalf. For more information, see Amazon ECS Task Role * in the Amazon Elastic Container Service Developer Guide. *

*

* IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you launch the * Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code to use the feature. For * more information, see Windows IAM roles * for tasks in the Amazon Elastic Container Service Developer Guide. *

* * @return The short name or full Amazon Resource Name (ARN) of the Identity and Access Management role that grants * containers in the task permission to call Amazon Web Services APIs on your behalf. For more information, * see Amazon ECS * Task Role in the Amazon Elastic Container Service Developer Guide.

*

* IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you * launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code to use * the feature. For more information, see Windows * IAM roles for tasks in the Amazon Elastic Container Service Developer Guide. */ public final String taskRoleArn() { return taskRoleArn; } /** *

* The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission * to make Amazon Web Services API calls on your behalf. The task execution IAM role is required depending on the * requirements of your task. For more information, see Amazon ECS task * execution IAM role in the Amazon Elastic Container Service Developer Guide. *

* * @return The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent * permission to make Amazon Web Services API calls on your behalf. The task execution IAM role is required * depending on the requirements of your task. For more information, see Amazon * ECS task execution IAM role in the Amazon Elastic Container Service Developer Guide. */ public final String executionRoleArn() { return executionRoleArn; } /** *

* The Docker networking mode to use for the containers in the task. The valid values are none, * bridge, awsvpc, and host. If no network mode is specified, the default is * bridge. *

*

* For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks on Amazon * EC2 Linux instances, any network mode can be used. For Amazon ECS tasks on Amazon EC2 Windows instances, * <default> or awsvpc can be used. If the network mode is set to none, * you cannot specify port mappings in your container definitions, and the tasks containers do not have external * connectivity. The host and awsvpc network modes offer the highest networking * performance for containers because they use the EC2 network stack instead of the virtualized network stack * provided by the bridge mode. *

*

* With the host and awsvpc network modes, exposed container ports are mapped directly to * the corresponding host port (for the host network mode) or the attached elastic network interface * port (for the awsvpc network mode), so you cannot take advantage of dynamic host port mappings. *

* *

* When using the host network mode, you should not run containers using the root user (UID 0). It is * considered best practice to use a non-root user. *

*
*

* If the network mode is awsvpc, the task is allocated an elastic network interface, and you must * specify a NetworkConfiguration value 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. *

*

* If the network mode is host, you cannot run multiple instantiations of the same task on a single * container instance when port mappings are used. *

*

* For more information, see Network * settings in the Docker run reference. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #networkMode} will * return {@link NetworkMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #networkModeAsString}. *

* * @return The Docker networking mode to use for the containers in the task. The valid values are none, * bridge, awsvpc, and host. If no network mode is specified, the * default is bridge.

*

* For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks * on Amazon EC2 Linux instances, any network mode can be used. For Amazon ECS tasks on Amazon EC2 Windows * instances, <default> or awsvpc can be used. If the network mode is set to * none, you cannot specify port mappings in your container definitions, and the tasks * containers do not have external connectivity. The host and awsvpc network modes * offer the highest networking performance for containers because they use the EC2 network stack instead of * the virtualized network stack provided by the bridge mode. *

*

* With the host and awsvpc network modes, exposed container ports are mapped * directly to the corresponding host port (for the host network mode) or the attached elastic * network interface port (for the awsvpc network mode), so you cannot take advantage of * dynamic host port mappings. *

* *

* When using the host network mode, you should not run containers using the root user (UID 0). * It is considered best practice to use a non-root user. *

*
*

* If the network mode is awsvpc, the task is allocated an elastic network interface, and you * must specify a NetworkConfiguration value 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. *

*

* If the network mode is host, you cannot run multiple instantiations of the same task on a * single container instance when port mappings are used. *

*

* For more information, see Network settings in the * Docker run reference. * @see NetworkMode */ public final NetworkMode networkMode() { return NetworkMode.fromValue(networkMode); } /** *

* The Docker networking mode to use for the containers in the task. The valid values are none, * bridge, awsvpc, and host. If no network mode is specified, the default is * bridge. *

*

* For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks on Amazon * EC2 Linux instances, any network mode can be used. For Amazon ECS tasks on Amazon EC2 Windows instances, * <default> or awsvpc can be used. If the network mode is set to none, * you cannot specify port mappings in your container definitions, and the tasks containers do not have external * connectivity. The host and awsvpc network modes offer the highest networking * performance for containers because they use the EC2 network stack instead of the virtualized network stack * provided by the bridge mode. *

*

* With the host and awsvpc network modes, exposed container ports are mapped directly to * the corresponding host port (for the host network mode) or the attached elastic network interface * port (for the awsvpc network mode), so you cannot take advantage of dynamic host port mappings. *

* *

* When using the host network mode, you should not run containers using the root user (UID 0). It is * considered best practice to use a non-root user. *

*
*

* If the network mode is awsvpc, the task is allocated an elastic network interface, and you must * specify a NetworkConfiguration value 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. *

*

* If the network mode is host, you cannot run multiple instantiations of the same task on a single * container instance when port mappings are used. *

*

* For more information, see Network * settings in the Docker run reference. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #networkMode} will * return {@link NetworkMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #networkModeAsString}. *

* * @return The Docker networking mode to use for the containers in the task. The valid values are none, * bridge, awsvpc, and host. If no network mode is specified, the * default is bridge.

*

* For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks * on Amazon EC2 Linux instances, any network mode can be used. For Amazon ECS tasks on Amazon EC2 Windows * instances, <default> or awsvpc can be used. If the network mode is set to * none, you cannot specify port mappings in your container definitions, and the tasks * containers do not have external connectivity. The host and awsvpc network modes * offer the highest networking performance for containers because they use the EC2 network stack instead of * the virtualized network stack provided by the bridge mode. *

*

* With the host and awsvpc network modes, exposed container ports are mapped * directly to the corresponding host port (for the host network mode) or the attached elastic * network interface port (for the awsvpc network mode), so you cannot take advantage of * dynamic host port mappings. *

* *

* When using the host network mode, you should not run containers using the root user (UID 0). * It is considered best practice to use a non-root user. *

*
*

* If the network mode is awsvpc, the task is allocated an elastic network interface, and you * must specify a NetworkConfiguration value 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. *

*

* If the network mode is host, you cannot run multiple instantiations of the same task on a * single container instance when port mappings are used. *

*

* For more information, see Network settings in the * Docker run reference. * @see NetworkMode */ public final String networkModeAsString() { return networkMode; } /** *

* The revision of the task in a particular family. The revision is a version number of a task definition in a * family. When you register a task definition for the first time, the revision is 1. Each time that * you register a new revision of a task definition in the same family, the revision value always increases by one. * This is even if you deregistered previous revisions in this family. *

* * @return The revision of the task in a particular family. The revision is a version number of a task definition in * a family. When you register a task definition for the first time, the revision is 1. Each * time that you register a new revision of a task definition in the same family, the revision value always * increases by one. This is even if you deregistered previous revisions in this family. */ public final Integer revision() { return revision; } /** * For responses, this returns true if the service returned a value for the Volumes property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasVolumes() { return volumes != null && !(volumes instanceof SdkAutoConstructList); } /** *

* The list of data volume definitions for the task. For more information, see Using data volumes in * tasks in the Amazon Elastic Container Service Developer Guide. *

* *

* The host and sourcePath parameters aren't supported for tasks run on Fargate. *

*
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasVolumes} method. *

* * @return The list of data volume definitions for the task. For more information, see Using data * volumes in tasks in the Amazon Elastic Container Service Developer Guide.

*

* The host and sourcePath parameters aren't supported for tasks run on Fargate. *

*/ public final List volumes() { return volumes; } /** *

* The status of the task definition. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link TaskDefinitionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

* * @return The status of the task definition. * @see TaskDefinitionStatus */ public final TaskDefinitionStatus status() { return TaskDefinitionStatus.fromValue(status); } /** *

* The status of the task definition. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link TaskDefinitionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

* * @return The status of the task definition. * @see TaskDefinitionStatus */ public final String statusAsString() { return status; } /** * For responses, this returns true if the service returned a value for the RequiresAttributes property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasRequiresAttributes() { return requiresAttributes != null && !(requiresAttributes instanceof SdkAutoConstructList); } /** *

* The container instance attributes required by your task. When an Amazon EC2 instance is registered to your * cluster, the Amazon ECS container agent assigns some standard attributes to the instance. You can apply custom * attributes. These are specified as key-value pairs using the Amazon ECS console or the PutAttributes API. * These attributes are used when determining task placement for tasks hosted on Amazon EC2 instances. For more * information, see Attributes in the Amazon Elastic Container Service Developer Guide. *

* *

* This parameter isn't supported for tasks run on Fargate. *

*
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasRequiresAttributes} method. *

* * @return The container instance attributes required by your task. When an Amazon EC2 instance is registered to * your cluster, the Amazon ECS container agent assigns some standard attributes to the instance. You can * apply custom attributes. These are specified as key-value pairs using the Amazon ECS console or the * PutAttributes API. These attributes are used when determining task placement for tasks hosted on * Amazon EC2 instances. For more information, see Attributes in the Amazon Elastic Container Service Developer Guide.

*

* This parameter isn't supported for tasks run on Fargate. *

*/ public final List requiresAttributes() { return requiresAttributes; } /** * For responses, this returns true if the service returned a value for the PlacementConstraints property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasPlacementConstraints() { return placementConstraints != null && !(placementConstraints instanceof SdkAutoConstructList); } /** *

* An array of placement constraint objects to use for tasks. *

* *

* This parameter isn't supported for tasks run on Fargate. *

*
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasPlacementConstraints} method. *

* * @return An array of placement constraint objects to use for tasks.

*

* This parameter isn't supported for tasks run on Fargate. *

*/ public final List placementConstraints() { return placementConstraints; } /** *

* The task launch types the task definition validated against during task definition registration. For more * information, see Amazon * ECS launch types in the Amazon Elastic Container Service Developer Guide. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasCompatibilities} method. *

* * @return The task launch types the task definition validated against during task definition registration. For more * information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. */ public final List compatibilities() { return CompatibilityListCopier.copyStringToEnum(compatibilities); } /** * For responses, this returns true if the service returned a value for the Compatibilities property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasCompatibilities() { return compatibilities != null && !(compatibilities instanceof SdkAutoConstructList); } /** *

* The task launch types the task definition validated against during task definition registration. For more * information, see Amazon * ECS launch types in the Amazon Elastic Container Service Developer Guide. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasCompatibilities} method. *

* * @return The task launch types the task definition validated against during task definition registration. For more * information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. */ public final List compatibilitiesAsStrings() { return compatibilities; } /** *

* The operating system that your task definitions are running on. A platform family is specified only for tasks * using the Fargate launch type. *

*

* When you specify a task in a service, this value must match the runtimePlatform value of the * service. *

* * @return The operating system that your task definitions are running on. A platform family is specified only for * tasks using the Fargate launch type.

*

* When you specify a task in a service, this value must match the runtimePlatform value of the * service. */ public final RuntimePlatform runtimePlatform() { return runtimePlatform; } /** *

* The task launch types the task definition was validated against. The valid values are EC2, * FARGATE, and EXTERNAL. For more information, see Amazon ECS launch types * in the Amazon Elastic Container Service Developer Guide. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasRequiresCompatibilities} method. *

* * @return The task launch types the task definition was validated against. The valid values are EC2, * FARGATE, and EXTERNAL. For more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. */ public final List requiresCompatibilities() { return CompatibilityListCopier.copyStringToEnum(requiresCompatibilities); } /** * For responses, this returns true if the service returned a value for the RequiresCompatibilities property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasRequiresCompatibilities() { return requiresCompatibilities != null && !(requiresCompatibilities instanceof SdkAutoConstructList); } /** *

* The task launch types the task definition was validated against. The valid values are EC2, * FARGATE, and EXTERNAL. For more information, see Amazon ECS launch types * in the Amazon Elastic Container Service Developer Guide. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasRequiresCompatibilities} method. *

* * @return The task launch types the task definition was validated against. The valid values are EC2, * FARGATE, and EXTERNAL. For more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. */ public final List requiresCompatibilitiesAsStrings() { return requiresCompatibilities; } /** *

* The number of cpu units used by the task. If you use the EC2 launch type, this field is optional. * Any value can be used. If you use the Fargate launch type, this field is required. You must use one of the * following values. The value that you choose determines your range of valid values for the memory * parameter. *

*

* The CPU units cannot be less than 1 vCPU when you use Windows containers on Fargate. *

*
    *
  • *

    * 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) *

    *
  • *
  • *

    * 512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) *

    *
  • *
  • *

    * 1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 * GB), 7168 (7 GB), 8192 (8 GB) *

    *
  • *
  • *

    * 2048 (2 vCPU) - Available memory values: 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) *

    *
  • *
  • *

    * 4096 (4 vCPU) - Available memory values: 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) *

    *
  • *
  • *

    * 8192 (8 vCPU) - Available memory values: 16 GB and 60 GB in 4 GB increments *

    *

    * This option requires Linux platform 1.4.0 or later. *

    *
  • *
  • *

    * 16384 (16vCPU) - Available memory values: 32GB and 120 GB in 8 GB increments *

    *

    * This option requires Linux platform 1.4.0 or later. *

    *
  • *
* * @return The number of cpu units used by the task. If you use the EC2 launch type, this field is * optional. Any value can be used. If you use the Fargate launch type, this field is required. You must use * one of the following values. The value that you choose determines your range of valid values for the * memory parameter.

*

* The CPU units cannot be less than 1 vCPU when you use Windows containers on Fargate. *

*
    *
  • *

    * 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) *

    *
  • *
  • *

    * 512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) *

    *
  • *
  • *

    * 1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), * 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) *

    *
  • *
  • *

    * 2048 (2 vCPU) - Available memory values: 4096 (4 GB) and 16384 (16 GB) in increments of 1024 * (1 GB) *

    *
  • *
  • *

    * 4096 (4 vCPU) - Available memory values: 8192 (8 GB) and 30720 (30 GB) in increments of 1024 * (1 GB) *

    *
  • *
  • *

    * 8192 (8 vCPU) - Available memory values: 16 GB and 60 GB in 4 GB increments *

    *

    * This option requires Linux platform 1.4.0 or later. *

    *
  • *
  • *

    * 16384 (16vCPU) - Available memory values: 32GB and 120 GB in 8 GB increments *

    *

    * This option requires Linux platform 1.4.0 or later. *

    *
  • */ public final String cpu() { return cpu; } /** *

    * The amount (in MiB) of memory used by the task. *

    *

    * If your tasks runs on Amazon EC2 instances, you must specify either a task-level memory value or a * container-level memory value. This field is optional and any value can be used. If a task-level memory value is * specified, the container-level memory value is optional. For more information regarding container-level memory * and memory reservation, see ContainerDefinition. *

    *

    * If your tasks runs on Fargate, this field is required. You must use one of the following values. The value you * choose determines your range of valid values for the cpu parameter. *

    *
      *
    • *

      * 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU) *

      *
    • *
    • *

      * 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU) *

      *
    • *
    • *

      * 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available * cpu values: 1024 (1 vCPU) *

      *
    • *
    • *

      * Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 * vCPU) *

      *
    • *
    • *

      * Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 * vCPU) *

      *
    • *
    • *

      * Between 16 GB and 60 GB in 4 GB increments - Available cpu values: 8192 (8 vCPU) *

      *

      * This option requires Linux platform 1.4.0 or later. *

      *
    • *
    • *

      * Between 32GB and 120 GB in 8 GB increments - Available cpu values: 16384 (16 vCPU) *

      *

      * This option requires Linux platform 1.4.0 or later. *

      *
    • *
    * * @return The amount (in MiB) of memory used by the task.

    *

    * If your tasks runs on Amazon EC2 instances, you must specify either a task-level memory value or a * container-level memory value. This field is optional and any value can be used. If a task-level memory * value is specified, the container-level memory value is optional. For more information regarding * container-level memory and memory reservation, see ContainerDefinition. *

    *

    * If your tasks runs on Fargate, this field is required. You must use one of the following values. The * value you choose determines your range of valid values for the cpu parameter. *

    *
      *
    • *

      * 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU) *

      *
    • *
    • *

      * 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU) *

      *
    • *
    • *

      * 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available * cpu values: 1024 (1 vCPU) *

      *
    • *
    • *

      * Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: * 2048 (2 vCPU) *

      *
    • *
    • *

      * Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: * 4096 (4 vCPU) *

      *
    • *
    • *

      * Between 16 GB and 60 GB in 4 GB increments - Available cpu values: 8192 (8 vCPU) *

      *

      * This option requires Linux platform 1.4.0 or later. *

      *
    • *
    • *

      * Between 32GB and 120 GB in 8 GB increments - Available cpu values: 16384 (16 vCPU) *

      *

      * This option requires Linux platform 1.4.0 or later. *

      *
    • */ public final String memory() { return memory; } /** * For responses, this returns true if the service returned a value for the InferenceAccelerators property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasInferenceAccelerators() { return inferenceAccelerators != null && !(inferenceAccelerators instanceof SdkAutoConstructList); } /** *

      * The Elastic Inference accelerator that's associated with the task. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasInferenceAccelerators} method. *

      * * @return The Elastic Inference accelerator that's associated with the task. */ public final List inferenceAccelerators() { return inferenceAccelerators; } /** *

      * The process namespace to use for the containers in the task. The valid values are host or * task. On Fargate for Linux containers, the only valid value is task. For example, * monitoring sidecars might need pidMode to access information about other containers running in the * same task. *

      *

      * If host is specified, all containers within the tasks that specified the host PID mode * on the same container instance share the same process namespace with the host Amazon EC2 instance. *

      *

      * If task is specified, all containers within the specified task share the same process namespace. *

      *

      * If no value is specified, the default is a private namespace for each container. For more information, see PID settings in the Docker run * reference. *

      *

      * If the host PID mode is used, there's a heightened risk of undesired process namespace exposure. For * more information, see Docker security. *

      * *

      * This parameter is not supported for Windows containers. *

      *
      *

      * This parameter is only supported for tasks that are hosted on Fargate if the tasks are using platform version * 1.4.0 or later (Linux). This isn't supported for Windows containers on Fargate. *

      *
      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #pidMode} will * return {@link PidMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #pidModeAsString}. *

      * * @return The process namespace to use for the containers in the task. The valid values are host or * task. On Fargate for Linux containers, the only valid value is task. For * example, monitoring sidecars might need pidMode to access information about other containers * running in the same task.

      *

      * If host is specified, all containers within the tasks that specified the host * PID mode on the same container instance share the same process namespace with the host Amazon EC2 * instance. *

      *

      * If task is specified, all containers within the specified task share the same process * namespace. *

      *

      * If no value is specified, the default is a private namespace for each container. For more information, * see PID settings in the * Docker run reference. *

      *

      * If the host PID mode is used, there's a heightened risk of undesired process namespace * exposure. For more information, see Docker * security. *

      * *

      * This parameter is not supported for Windows containers. *

      *
      *

      * This parameter is only supported for tasks that are hosted on Fargate if the tasks are using platform * version 1.4.0 or later (Linux). This isn't supported for Windows containers on Fargate. *

      * @see PidMode */ public final PidMode pidMode() { return PidMode.fromValue(pidMode); } /** *

      * The process namespace to use for the containers in the task. The valid values are host or * task. On Fargate for Linux containers, the only valid value is task. For example, * monitoring sidecars might need pidMode to access information about other containers running in the * same task. *

      *

      * If host is specified, all containers within the tasks that specified the host PID mode * on the same container instance share the same process namespace with the host Amazon EC2 instance. *

      *

      * If task is specified, all containers within the specified task share the same process namespace. *

      *

      * If no value is specified, the default is a private namespace for each container. For more information, see PID settings in the Docker run * reference. *

      *

      * If the host PID mode is used, there's a heightened risk of undesired process namespace exposure. For * more information, see Docker security. *

      * *

      * This parameter is not supported for Windows containers. *

      *
      *

      * This parameter is only supported for tasks that are hosted on Fargate if the tasks are using platform version * 1.4.0 or later (Linux). This isn't supported for Windows containers on Fargate. *

      *
      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #pidMode} will * return {@link PidMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #pidModeAsString}. *

      * * @return The process namespace to use for the containers in the task. The valid values are host or * task. On Fargate for Linux containers, the only valid value is task. For * example, monitoring sidecars might need pidMode to access information about other containers * running in the same task.

      *

      * If host is specified, all containers within the tasks that specified the host * PID mode on the same container instance share the same process namespace with the host Amazon EC2 * instance. *

      *

      * If task is specified, all containers within the specified task share the same process * namespace. *

      *

      * If no value is specified, the default is a private namespace for each container. For more information, * see PID settings in the * Docker run reference. *

      *

      * If the host PID mode is used, there's a heightened risk of undesired process namespace * exposure. For more information, see Docker * security. *

      * *

      * This parameter is not supported for Windows containers. *

      *
      *

      * This parameter is only supported for tasks that are hosted on Fargate if the tasks are using platform * version 1.4.0 or later (Linux). This isn't supported for Windows containers on Fargate. *

      * @see PidMode */ public final String pidModeAsString() { return pidMode; } /** *

      * The IPC resource namespace to use for the containers in the task. The valid values are host, * task, or none. If host is specified, then all containers within the tasks * that specified the host IPC mode on the same container instance share the same IPC resources with * the host Amazon EC2 instance. If task is specified, all containers within the specified task share * the same IPC resources. If none is specified, then IPC resources within the containers of a task are * private and not shared with other containers in a task or on the container instance. If no value is specified, * then the IPC resource namespace sharing depends on the Docker daemon setting on the container instance. For more * information, see IPC settings in * the Docker run reference. *

      *

      * If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC namespace * expose. For more information, see Docker * security. *

      *

      * If you are setting namespaced kernel parameters using systemControls for the containers in the task, * the following will apply to your IPC resource namespace. For more information, see System * Controls in the Amazon Elastic Container Service Developer Guide. *

      *
        *
      • *

        * For tasks that use the host IPC mode, IPC namespace related systemControls are not * supported. *

        *
      • *
      • *

        * For tasks that use the task IPC mode, IPC namespace related systemControls will apply * to all containers within a task. *

        *
      • *
      * *

      * This parameter is not supported for Windows containers or tasks run on Fargate. *

      *
      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #ipcMode} will * return {@link IpcMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #ipcModeAsString}. *

      * * @return The IPC resource namespace to use for the containers in the task. The valid values are host, * task, or none. If host is specified, then all containers within * the tasks that specified the host IPC mode on the same container instance share the same IPC * resources with the host Amazon EC2 instance. If task is specified, all containers within the * specified task share the same IPC resources. If none is specified, then IPC resources within * the containers of a task are private and not shared with other containers in a task or on the container * instance. If no value is specified, then the IPC resource namespace sharing depends on the Docker daemon * setting on the container instance. For more information, see IPC settings in the Docker * run reference.

      *

      * If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC * namespace expose. For more information, see Docker security. *

      *

      * If you are setting namespaced kernel parameters using systemControls for the containers in * the task, the following will apply to your IPC resource namespace. For more information, see System * Controls in the Amazon Elastic Container Service Developer Guide. *

      *
        *
      • *

        * For tasks that use the host IPC mode, IPC namespace related systemControls are * not supported. *

        *
      • *
      • *

        * For tasks that use the task IPC mode, IPC namespace related systemControls will * apply to all containers within a task. *

        *
      • *
      * *

      * This parameter is not supported for Windows containers or tasks run on Fargate. *

      * @see IpcMode */ public final IpcMode ipcMode() { return IpcMode.fromValue(ipcMode); } /** *

      * The IPC resource namespace to use for the containers in the task. The valid values are host, * task, or none. If host is specified, then all containers within the tasks * that specified the host IPC mode on the same container instance share the same IPC resources with * the host Amazon EC2 instance. If task is specified, all containers within the specified task share * the same IPC resources. If none is specified, then IPC resources within the containers of a task are * private and not shared with other containers in a task or on the container instance. If no value is specified, * then the IPC resource namespace sharing depends on the Docker daemon setting on the container instance. For more * information, see IPC settings in * the Docker run reference. *

      *

      * If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC namespace * expose. For more information, see Docker * security. *

      *

      * If you are setting namespaced kernel parameters using systemControls for the containers in the task, * the following will apply to your IPC resource namespace. For more information, see System * Controls in the Amazon Elastic Container Service Developer Guide. *

      *
        *
      • *

        * For tasks that use the host IPC mode, IPC namespace related systemControls are not * supported. *

        *
      • *
      • *

        * For tasks that use the task IPC mode, IPC namespace related systemControls will apply * to all containers within a task. *

        *
      • *
      * *

      * This parameter is not supported for Windows containers or tasks run on Fargate. *

      *
      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #ipcMode} will * return {@link IpcMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #ipcModeAsString}. *

      * * @return The IPC resource namespace to use for the containers in the task. The valid values are host, * task, or none. If host is specified, then all containers within * the tasks that specified the host IPC mode on the same container instance share the same IPC * resources with the host Amazon EC2 instance. If task is specified, all containers within the * specified task share the same IPC resources. If none is specified, then IPC resources within * the containers of a task are private and not shared with other containers in a task or on the container * instance. If no value is specified, then the IPC resource namespace sharing depends on the Docker daemon * setting on the container instance. For more information, see IPC settings in the Docker * run reference.

      *

      * If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC * namespace expose. For more information, see Docker security. *

      *

      * If you are setting namespaced kernel parameters using systemControls for the containers in * the task, the following will apply to your IPC resource namespace. For more information, see System * Controls in the Amazon Elastic Container Service Developer Guide. *

      *
        *
      • *

        * For tasks that use the host IPC mode, IPC namespace related systemControls are * not supported. *

        *
      • *
      • *

        * For tasks that use the task IPC mode, IPC namespace related systemControls will * apply to all containers within a task. *

        *
      • *
      * *

      * This parameter is not supported for Windows containers or tasks run on Fargate. *

      * @see IpcMode */ public final String ipcModeAsString() { return ipcMode; } /** *

      * The configuration details for the App Mesh proxy. *

      *

      * Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at least version * 1.26.0-1 of the ecs-init package to use a proxy configuration. If your container instances are * launched from the Amazon ECS optimized AMI version 20190301 or later, they contain the required * versions of the container agent and ecs-init. For more information, see Amazon ECS-optimized * Linux AMI in the Amazon Elastic Container Service Developer Guide. *

      * * @return The configuration details for the App Mesh proxy.

      *

      * Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at least * version 1.26.0-1 of the ecs-init package to use a proxy configuration. If your container * instances are launched from the Amazon ECS optimized AMI version 20190301 or later, they * contain the required versions of the container agent and ecs-init. For more information, see * Amazon * ECS-optimized Linux AMI in the Amazon Elastic Container Service Developer Guide. */ public final ProxyConfiguration proxyConfiguration() { return proxyConfiguration; } /** *

      * The Unix timestamp for the time when the task definition was registered. *

      * * @return The Unix timestamp for the time when the task definition was registered. */ public final Instant registeredAt() { return registeredAt; } /** *

      * The Unix timestamp for the time when the task definition was deregistered. *

      * * @return The Unix timestamp for the time when the task definition was deregistered. */ public final Instant deregisteredAt() { return deregisteredAt; } /** *

      * The principal that registered the task definition. *

      * * @return The principal that registered the task definition. */ public final String registeredBy() { return registeredBy; } /** *

      * The ephemeral storage settings to use for tasks run with the task definition. *

      * * @return The ephemeral storage settings to use for tasks run with the task definition. */ public final EphemeralStorage ephemeralStorage() { return ephemeralStorage; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(taskDefinitionArn()); hashCode = 31 * hashCode + Objects.hashCode(hasContainerDefinitions() ? containerDefinitions() : null); hashCode = 31 * hashCode + Objects.hashCode(family()); hashCode = 31 * hashCode + Objects.hashCode(taskRoleArn()); hashCode = 31 * hashCode + Objects.hashCode(executionRoleArn()); hashCode = 31 * hashCode + Objects.hashCode(networkModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(revision()); hashCode = 31 * hashCode + Objects.hashCode(hasVolumes() ? volumes() : null); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasRequiresAttributes() ? requiresAttributes() : null); hashCode = 31 * hashCode + Objects.hashCode(hasPlacementConstraints() ? placementConstraints() : null); hashCode = 31 * hashCode + Objects.hashCode(hasCompatibilities() ? compatibilitiesAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(runtimePlatform()); hashCode = 31 * hashCode + Objects.hashCode(hasRequiresCompatibilities() ? requiresCompatibilitiesAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(cpu()); hashCode = 31 * hashCode + Objects.hashCode(memory()); hashCode = 31 * hashCode + Objects.hashCode(hasInferenceAccelerators() ? inferenceAccelerators() : null); hashCode = 31 * hashCode + Objects.hashCode(pidModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(ipcModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(proxyConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(registeredAt()); hashCode = 31 * hashCode + Objects.hashCode(deregisteredAt()); hashCode = 31 * hashCode + Objects.hashCode(registeredBy()); hashCode = 31 * hashCode + Objects.hashCode(ephemeralStorage()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof TaskDefinition)) { return false; } TaskDefinition other = (TaskDefinition) obj; return Objects.equals(taskDefinitionArn(), other.taskDefinitionArn()) && hasContainerDefinitions() == other.hasContainerDefinitions() && Objects.equals(containerDefinitions(), other.containerDefinitions()) && Objects.equals(family(), other.family()) && Objects.equals(taskRoleArn(), other.taskRoleArn()) && Objects.equals(executionRoleArn(), other.executionRoleArn()) && Objects.equals(networkModeAsString(), other.networkModeAsString()) && Objects.equals(revision(), other.revision()) && hasVolumes() == other.hasVolumes() && Objects.equals(volumes(), other.volumes()) && Objects.equals(statusAsString(), other.statusAsString()) && hasRequiresAttributes() == other.hasRequiresAttributes() && Objects.equals(requiresAttributes(), other.requiresAttributes()) && hasPlacementConstraints() == other.hasPlacementConstraints() && Objects.equals(placementConstraints(), other.placementConstraints()) && hasCompatibilities() == other.hasCompatibilities() && Objects.equals(compatibilitiesAsStrings(), other.compatibilitiesAsStrings()) && Objects.equals(runtimePlatform(), other.runtimePlatform()) && hasRequiresCompatibilities() == other.hasRequiresCompatibilities() && Objects.equals(requiresCompatibilitiesAsStrings(), other.requiresCompatibilitiesAsStrings()) && Objects.equals(cpu(), other.cpu()) && Objects.equals(memory(), other.memory()) && hasInferenceAccelerators() == other.hasInferenceAccelerators() && Objects.equals(inferenceAccelerators(), other.inferenceAccelerators()) && Objects.equals(pidModeAsString(), other.pidModeAsString()) && Objects.equals(ipcModeAsString(), other.ipcModeAsString()) && Objects.equals(proxyConfiguration(), other.proxyConfiguration()) && Objects.equals(registeredAt(), other.registeredAt()) && Objects.equals(deregisteredAt(), other.deregisteredAt()) && Objects.equals(registeredBy(), other.registeredBy()) && Objects.equals(ephemeralStorage(), other.ephemeralStorage()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("TaskDefinition").add("TaskDefinitionArn", taskDefinitionArn()) .add("ContainerDefinitions", hasContainerDefinitions() ? containerDefinitions() : null).add("Family", family()) .add("TaskRoleArn", taskRoleArn()).add("ExecutionRoleArn", executionRoleArn()) .add("NetworkMode", networkModeAsString()).add("Revision", revision()) .add("Volumes", hasVolumes() ? volumes() : null).add("Status", statusAsString()) .add("RequiresAttributes", hasRequiresAttributes() ? requiresAttributes() : null) .add("PlacementConstraints", hasPlacementConstraints() ? placementConstraints() : null) .add("Compatibilities", hasCompatibilities() ? compatibilitiesAsStrings() : null) .add("RuntimePlatform", runtimePlatform()) .add("RequiresCompatibilities", hasRequiresCompatibilities() ? requiresCompatibilitiesAsStrings() : null) .add("Cpu", cpu()).add("Memory", memory()) .add("InferenceAccelerators", hasInferenceAccelerators() ? inferenceAccelerators() : null) .add("PidMode", pidModeAsString()).add("IpcMode", ipcModeAsString()) .add("ProxyConfiguration", proxyConfiguration()).add("RegisteredAt", registeredAt()) .add("DeregisteredAt", deregisteredAt()).add("RegisteredBy", registeredBy()) .add("EphemeralStorage", ephemeralStorage()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "taskDefinitionArn": return Optional.ofNullable(clazz.cast(taskDefinitionArn())); case "containerDefinitions": return Optional.ofNullable(clazz.cast(containerDefinitions())); case "family": return Optional.ofNullable(clazz.cast(family())); case "taskRoleArn": return Optional.ofNullable(clazz.cast(taskRoleArn())); case "executionRoleArn": return Optional.ofNullable(clazz.cast(executionRoleArn())); case "networkMode": return Optional.ofNullable(clazz.cast(networkModeAsString())); case "revision": return Optional.ofNullable(clazz.cast(revision())); case "volumes": return Optional.ofNullable(clazz.cast(volumes())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "requiresAttributes": return Optional.ofNullable(clazz.cast(requiresAttributes())); case "placementConstraints": return Optional.ofNullable(clazz.cast(placementConstraints())); case "compatibilities": return Optional.ofNullable(clazz.cast(compatibilitiesAsStrings())); case "runtimePlatform": return Optional.ofNullable(clazz.cast(runtimePlatform())); case "requiresCompatibilities": return Optional.ofNullable(clazz.cast(requiresCompatibilitiesAsStrings())); case "cpu": return Optional.ofNullable(clazz.cast(cpu())); case "memory": return Optional.ofNullable(clazz.cast(memory())); case "inferenceAccelerators": return Optional.ofNullable(clazz.cast(inferenceAccelerators())); case "pidMode": return Optional.ofNullable(clazz.cast(pidModeAsString())); case "ipcMode": return Optional.ofNullable(clazz.cast(ipcModeAsString())); case "proxyConfiguration": return Optional.ofNullable(clazz.cast(proxyConfiguration())); case "registeredAt": return Optional.ofNullable(clazz.cast(registeredAt())); case "deregisteredAt": return Optional.ofNullable(clazz.cast(deregisteredAt())); case "registeredBy": return Optional.ofNullable(clazz.cast(registeredBy())); case "ephemeralStorage": return Optional.ofNullable(clazz.cast(ephemeralStorage())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((TaskDefinition) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The full Amazon Resource Name (ARN) of the task definition. *

      * * @param taskDefinitionArn * The full Amazon Resource Name (ARN) of the task definition. * @return Returns a reference to this object so that method calls can be chained together. */ Builder taskDefinitionArn(String taskDefinitionArn); /** *

      * A list of container definitions in JSON format that describe the different containers that make up your task. * For more information about container definition parameters and defaults, see Amazon ECS Task * Definitions in the Amazon Elastic Container Service Developer Guide. *

      * * @param containerDefinitions * A list of container definitions in JSON format that describe the different containers that make up * your task. For more information about container definition parameters and defaults, see Amazon ECS * Task Definitions in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder containerDefinitions(Collection containerDefinitions); /** *

      * A list of container definitions in JSON format that describe the different containers that make up your task. * For more information about container definition parameters and defaults, see Amazon ECS Task * Definitions in the Amazon Elastic Container Service Developer Guide. *

      * * @param containerDefinitions * A list of container definitions in JSON format that describe the different containers that make up * your task. For more information about container definition parameters and defaults, see Amazon ECS * Task Definitions in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder containerDefinitions(ContainerDefinition... containerDefinitions); /** *

      * A list of container definitions in JSON format that describe the different containers that make up your task. * For more information about container definition parameters and defaults, see Amazon ECS Task * Definitions in the Amazon Elastic Container Service Developer Guide. *

      * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ecs.model.ContainerDefinition.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.ecs.model.ContainerDefinition#builder()}. * *

      * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ecs.model.ContainerDefinition.Builder#build()} is called immediately * and its result is passed to {@link #containerDefinitions(List)}. * * @param containerDefinitions * a consumer that will call methods on * {@link software.amazon.awssdk.services.ecs.model.ContainerDefinition.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #containerDefinitions(java.util.Collection) */ Builder containerDefinitions(Consumer... containerDefinitions); /** *

      * The name of a family that this task definition is registered to. Up to 255 characters are allowed. Letters * (both uppercase and lowercase letters), numbers, hyphens (-), and underscores (_) are allowed. *

      *

      * A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that you * registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each task * definition that you add. *

      * * @param family * The name of a family that this task definition is registered to. Up to 255 characters are allowed. * Letters (both uppercase and lowercase letters), numbers, hyphens (-), and underscores (_) are * allowed.

      *

      * A family groups multiple versions of a task definition. Amazon ECS gives the first task definition * that you registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers * to each task definition that you add. * @return Returns a reference to this object so that method calls can be chained together. */ Builder family(String family); /** *

      * The short name or full Amazon Resource Name (ARN) of the Identity and Access Management role that grants * containers in the task permission to call Amazon Web Services APIs on your behalf. For more information, see * Amazon ECS Task * Role in the Amazon Elastic Container Service Developer Guide. *

      *

      * IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you launch * the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code to use the * feature. For more information, see Windows IAM * roles for tasks in the Amazon Elastic Container Service Developer Guide. *

      * * @param taskRoleArn * The short name or full Amazon Resource Name (ARN) of the Identity and Access Management role that * grants containers in the task permission to call Amazon Web Services APIs on your behalf. For more * information, see Amazon ECS Task * Role in the Amazon Elastic Container Service Developer Guide.

      *

      * IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you * launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code to * use the feature. For more information, see Windows * IAM roles for tasks in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder taskRoleArn(String taskRoleArn); /** *

      * The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent * permission to make Amazon Web Services API calls on your behalf. The task execution IAM role is required * depending on the requirements of your task. For more information, see Amazon ECS * task execution IAM role in the Amazon Elastic Container Service Developer Guide. *

      * * @param executionRoleArn * The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent * permission to make Amazon Web Services API calls on your behalf. The task execution IAM role is * required depending on the requirements of your task. For more information, see Amazon * ECS task execution IAM role in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder executionRoleArn(String executionRoleArn); /** *

      * The Docker networking mode to use for the containers in the task. The valid values are none, * bridge, awsvpc, and host. If no network mode is specified, the default * is bridge. *

      *

      * For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks on * Amazon EC2 Linux instances, any network mode can be used. For Amazon ECS tasks on Amazon EC2 Windows * instances, <default> or awsvpc can be used. If the network mode is set to * none, you cannot specify port mappings in your container definitions, and the tasks containers * do not have external connectivity. The host and awsvpc network modes offer the * highest networking performance for containers because they use the EC2 network stack instead of the * virtualized network stack provided by the bridge mode. *

      *

      * With the host and awsvpc network modes, exposed container ports are mapped directly * to the corresponding host port (for the host network mode) or the attached elastic network * interface port (for the awsvpc network mode), so you cannot take advantage of dynamic host port * mappings. *

      * *

      * When using the host network mode, you should not run containers using the root user (UID 0). It * is considered best practice to use a non-root user. *

      *
      *

      * If the network mode is awsvpc, the task is allocated an elastic network interface, and you must * specify a NetworkConfiguration value 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. *

      *

      * If the network mode is host, you cannot run multiple instantiations of the same task on a single * container instance when port mappings are used. *

      *

      * For more information, see Network * settings in the Docker run reference. *

      * * @param networkMode * The Docker networking mode to use for the containers in the task. The valid values are * none, bridge, awsvpc, and host. If no network mode * is specified, the default is bridge.

      *

      * For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS * tasks on Amazon EC2 Linux instances, any network mode can be used. For Amazon ECS tasks on Amazon EC2 * Windows instances, <default> or awsvpc can be used. If the network * mode is set to none, you cannot specify port mappings in your container definitions, and * the tasks containers do not have external connectivity. The host and awsvpc * network modes offer the highest networking performance for containers because they use the EC2 network * stack instead of the virtualized network stack provided by the bridge mode. *

      *

      * With the host and awsvpc network modes, exposed container ports are mapped * directly to the corresponding host port (for the host network mode) or the attached * elastic network interface port (for the awsvpc network mode), so you cannot take * advantage of dynamic host port mappings. *

      * *

      * When using the host network mode, you should not run containers using the root user (UID * 0). It is considered best practice to use a non-root user. *

      *
      *

      * If the network mode is awsvpc, the task is allocated an elastic network interface, and * you must specify a NetworkConfiguration value 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. *

      *

      * If the network mode is host, you cannot run multiple instantiations of the same task on a * single container instance when port mappings are used. *

      *

      * For more information, see Network settings in the * Docker run reference. * @see NetworkMode * @return Returns a reference to this object so that method calls can be chained together. * @see NetworkMode */ Builder networkMode(String networkMode); /** *

      * The Docker networking mode to use for the containers in the task. The valid values are none, * bridge, awsvpc, and host. If no network mode is specified, the default * is bridge. *

      *

      * For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks on * Amazon EC2 Linux instances, any network mode can be used. For Amazon ECS tasks on Amazon EC2 Windows * instances, <default> or awsvpc can be used. If the network mode is set to * none, you cannot specify port mappings in your container definitions, and the tasks containers * do not have external connectivity. The host and awsvpc network modes offer the * highest networking performance for containers because they use the EC2 network stack instead of the * virtualized network stack provided by the bridge mode. *

      *

      * With the host and awsvpc network modes, exposed container ports are mapped directly * to the corresponding host port (for the host network mode) or the attached elastic network * interface port (for the awsvpc network mode), so you cannot take advantage of dynamic host port * mappings. *

      * *

      * When using the host network mode, you should not run containers using the root user (UID 0). It * is considered best practice to use a non-root user. *

      *
      *

      * If the network mode is awsvpc, the task is allocated an elastic network interface, and you must * specify a NetworkConfiguration value 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. *

      *

      * If the network mode is host, you cannot run multiple instantiations of the same task on a single * container instance when port mappings are used. *

      *

      * For more information, see Network * settings in the Docker run reference. *

      * * @param networkMode * The Docker networking mode to use for the containers in the task. The valid values are * none, bridge, awsvpc, and host. If no network mode * is specified, the default is bridge.

      *

      * For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS * tasks on Amazon EC2 Linux instances, any network mode can be used. For Amazon ECS tasks on Amazon EC2 * Windows instances, <default> or awsvpc can be used. If the network * mode is set to none, you cannot specify port mappings in your container definitions, and * the tasks containers do not have external connectivity. The host and awsvpc * network modes offer the highest networking performance for containers because they use the EC2 network * stack instead of the virtualized network stack provided by the bridge mode. *

      *

      * With the host and awsvpc network modes, exposed container ports are mapped * directly to the corresponding host port (for the host network mode) or the attached * elastic network interface port (for the awsvpc network mode), so you cannot take * advantage of dynamic host port mappings. *

      * *

      * When using the host network mode, you should not run containers using the root user (UID * 0). It is considered best practice to use a non-root user. *

      *
      *

      * If the network mode is awsvpc, the task is allocated an elastic network interface, and * you must specify a NetworkConfiguration value 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. *

      *

      * If the network mode is host, you cannot run multiple instantiations of the same task on a * single container instance when port mappings are used. *

      *

      * For more information, see Network settings in the * Docker run reference. * @see NetworkMode * @return Returns a reference to this object so that method calls can be chained together. * @see NetworkMode */ Builder networkMode(NetworkMode networkMode); /** *

      * The revision of the task in a particular family. The revision is a version number of a task definition in a * family. When you register a task definition for the first time, the revision is 1. Each time * that you register a new revision of a task definition in the same family, the revision value always increases * by one. This is even if you deregistered previous revisions in this family. *

      * * @param revision * The revision of the task in a particular family. The revision is a version number of a task definition * in a family. When you register a task definition for the first time, the revision is 1. * Each time that you register a new revision of a task definition in the same family, the revision value * always increases by one. This is even if you deregistered previous revisions in this family. * @return Returns a reference to this object so that method calls can be chained together. */ Builder revision(Integer revision); /** *

      * The list of data volume definitions for the task. For more information, see Using data volumes * in tasks in the Amazon Elastic Container Service Developer Guide. *

      * *

      * The host and sourcePath parameters aren't supported for tasks run on Fargate. *

      *
      * * @param volumes * The list of data volume definitions for the task. For more information, see Using data * volumes in tasks in the Amazon Elastic Container Service Developer Guide.

      *

      * The host and sourcePath parameters aren't supported for tasks run on * Fargate. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder volumes(Collection volumes); /** *

      * The list of data volume definitions for the task. For more information, see Using data volumes * in tasks in the Amazon Elastic Container Service Developer Guide. *

      * *

      * The host and sourcePath parameters aren't supported for tasks run on Fargate. *

      *
      * * @param volumes * The list of data volume definitions for the task. For more information, see Using data * volumes in tasks in the Amazon Elastic Container Service Developer Guide.

      *

      * The host and sourcePath parameters aren't supported for tasks run on * Fargate. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder volumes(Volume... volumes); /** *

      * The list of data volume definitions for the task. For more information, see Using data volumes * in tasks in the Amazon Elastic Container Service Developer Guide. *

      * *

      * The host and sourcePath parameters aren't supported for tasks run on Fargate. *

      *
      This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ecs.model.Volume.Builder} avoiding the need to create one manually via * {@link software.amazon.awssdk.services.ecs.model.Volume#builder()}. * *

      * When the {@link Consumer} completes, {@link software.amazon.awssdk.services.ecs.model.Volume.Builder#build()} * is called immediately and its result is passed to {@link #volumes(List)}. * * @param volumes * a consumer that will call methods on {@link software.amazon.awssdk.services.ecs.model.Volume.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #volumes(java.util.Collection) */ Builder volumes(Consumer... volumes); /** *

      * The status of the task definition. *

      * * @param status * The status of the task definition. * @see TaskDefinitionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TaskDefinitionStatus */ Builder status(String status); /** *

      * The status of the task definition. *

      * * @param status * The status of the task definition. * @see TaskDefinitionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TaskDefinitionStatus */ Builder status(TaskDefinitionStatus status); /** *

      * The container instance attributes required by your task. When an Amazon EC2 instance is registered to your * cluster, the Amazon ECS container agent assigns some standard attributes to the instance. You can apply * custom attributes. These are specified as key-value pairs using the Amazon ECS console or the * PutAttributes API. These attributes are used when determining task placement for tasks hosted on * Amazon EC2 instances. For more information, see Attributes in the Amazon Elastic Container Service Developer Guide. *

      * *

      * This parameter isn't supported for tasks run on Fargate. *

      *
      * * @param requiresAttributes * The container instance attributes required by your task. When an Amazon EC2 instance is registered to * your cluster, the Amazon ECS container agent assigns some standard attributes to the instance. You can * apply custom attributes. These are specified as key-value pairs using the Amazon ECS console or the * PutAttributes API. These attributes are used when determining task placement for tasks hosted * on Amazon EC2 instances. For more information, see Attributes in the Amazon Elastic Container Service Developer Guide.

      *

      * This parameter isn't supported for tasks run on Fargate. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder requiresAttributes(Collection requiresAttributes); /** *

      * The container instance attributes required by your task. When an Amazon EC2 instance is registered to your * cluster, the Amazon ECS container agent assigns some standard attributes to the instance. You can apply * custom attributes. These are specified as key-value pairs using the Amazon ECS console or the * PutAttributes API. These attributes are used when determining task placement for tasks hosted on * Amazon EC2 instances. For more information, see Attributes in the Amazon Elastic Container Service Developer Guide. *

      * *

      * This parameter isn't supported for tasks run on Fargate. *

      *
      * * @param requiresAttributes * The container instance attributes required by your task. When an Amazon EC2 instance is registered to * your cluster, the Amazon ECS container agent assigns some standard attributes to the instance. You can * apply custom attributes. These are specified as key-value pairs using the Amazon ECS console or the * PutAttributes API. These attributes are used when determining task placement for tasks hosted * on Amazon EC2 instances. For more information, see Attributes in the Amazon Elastic Container Service Developer Guide.

      *

      * This parameter isn't supported for tasks run on Fargate. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder requiresAttributes(Attribute... requiresAttributes); /** *

      * The container instance attributes required by your task. When an Amazon EC2 instance is registered to your * cluster, the Amazon ECS container agent assigns some standard attributes to the instance. You can apply * custom attributes. These are specified as key-value pairs using the Amazon ECS console or the * PutAttributes API. These attributes are used when determining task placement for tasks hosted on * Amazon EC2 instances. For more information, see Attributes in the Amazon Elastic Container Service Developer Guide. *

      * *

      * This parameter isn't supported for tasks run on Fargate. *

      *
      This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ecs.model.Attribute.Builder} avoiding the need to create one manually * via {@link software.amazon.awssdk.services.ecs.model.Attribute#builder()}. * *

      * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ecs.model.Attribute.Builder#build()} is called immediately and its * result is passed to {@link #requiresAttributes(List)}. * * @param requiresAttributes * a consumer that will call methods on * {@link software.amazon.awssdk.services.ecs.model.Attribute.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #requiresAttributes(java.util.Collection) */ Builder requiresAttributes(Consumer... requiresAttributes); /** *

      * An array of placement constraint objects to use for tasks. *

      * *

      * This parameter isn't supported for tasks run on Fargate. *

      *
      * * @param placementConstraints * An array of placement constraint objects to use for tasks.

      *

      * This parameter isn't supported for tasks run on Fargate. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder placementConstraints(Collection placementConstraints); /** *

      * An array of placement constraint objects to use for tasks. *

      * *

      * This parameter isn't supported for tasks run on Fargate. *

      *
      * * @param placementConstraints * An array of placement constraint objects to use for tasks.

      *

      * This parameter isn't supported for tasks run on Fargate. *

      * @return Returns a reference to this object so that method calls can be chained together. */ Builder placementConstraints(TaskDefinitionPlacementConstraint... placementConstraints); /** *

      * An array of placement constraint objects to use for tasks. *

      * *

      * This parameter isn't supported for tasks run on Fargate. *

      *
      This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ecs.model.TaskDefinitionPlacementConstraint.Builder} avoiding the need * to create one manually via * {@link software.amazon.awssdk.services.ecs.model.TaskDefinitionPlacementConstraint#builder()}. * *

      * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ecs.model.TaskDefinitionPlacementConstraint.Builder#build()} is called * immediately and its result is passed to {@link * #placementConstraints(List)}. * * @param placementConstraints * a consumer that will call methods on * {@link software.amazon.awssdk.services.ecs.model.TaskDefinitionPlacementConstraint.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #placementConstraints(java.util.Collection) */ Builder placementConstraints(Consumer... placementConstraints); /** *

      * The task launch types the task definition validated against during task definition registration. For more * information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. *

      * * @param compatibilities * The task launch types the task definition validated against during task definition registration. For * more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder compatibilitiesWithStrings(Collection compatibilities); /** *

      * The task launch types the task definition validated against during task definition registration. For more * information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. *

      * * @param compatibilities * The task launch types the task definition validated against during task definition registration. For * more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder compatibilitiesWithStrings(String... compatibilities); /** *

      * The task launch types the task definition validated against during task definition registration. For more * information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. *

      * * @param compatibilities * The task launch types the task definition validated against during task definition registration. For * more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder compatibilities(Collection compatibilities); /** *

      * The task launch types the task definition validated against during task definition registration. For more * information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. *

      * * @param compatibilities * The task launch types the task definition validated against during task definition registration. For * more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder compatibilities(Compatibility... compatibilities); /** *

      * The operating system that your task definitions are running on. A platform family is specified only for tasks * using the Fargate launch type. *

      *

      * When you specify a task in a service, this value must match the runtimePlatform value of the * service. *

      * * @param runtimePlatform * The operating system that your task definitions are running on. A platform family is specified only * for tasks using the Fargate launch type.

      *

      * When you specify a task in a service, this value must match the runtimePlatform value of * the service. * @return Returns a reference to this object so that method calls can be chained together. */ Builder runtimePlatform(RuntimePlatform runtimePlatform); /** *

      * The operating system that your task definitions are running on. A platform family is specified only for tasks * using the Fargate launch type. *

      *

      * When you specify a task in a service, this value must match the runtimePlatform value of the * service. *

      * This is a convenience method that creates an instance of the {@link RuntimePlatform.Builder} avoiding the * need to create one manually via {@link RuntimePlatform#builder()}. * *

      * When the {@link Consumer} completes, {@link RuntimePlatform.Builder#build()} is called immediately and its * result is passed to {@link #runtimePlatform(RuntimePlatform)}. * * @param runtimePlatform * a consumer that will call methods on {@link RuntimePlatform.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #runtimePlatform(RuntimePlatform) */ default Builder runtimePlatform(Consumer runtimePlatform) { return runtimePlatform(RuntimePlatform.builder().applyMutation(runtimePlatform).build()); } /** *

      * The task launch types the task definition was validated against. The valid values are EC2, * FARGATE, and EXTERNAL. For more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. *

      * * @param requiresCompatibilities * The task launch types the task definition was validated against. The valid values are EC2 * , FARGATE, and EXTERNAL. For more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder requiresCompatibilitiesWithStrings(Collection requiresCompatibilities); /** *

      * The task launch types the task definition was validated against. The valid values are EC2, * FARGATE, and EXTERNAL. For more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. *

      * * @param requiresCompatibilities * The task launch types the task definition was validated against. The valid values are EC2 * , FARGATE, and EXTERNAL. For more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder requiresCompatibilitiesWithStrings(String... requiresCompatibilities); /** *

      * The task launch types the task definition was validated against. The valid values are EC2, * FARGATE, and EXTERNAL. For more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. *

      * * @param requiresCompatibilities * The task launch types the task definition was validated against. The valid values are EC2 * , FARGATE, and EXTERNAL. For more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder requiresCompatibilities(Collection requiresCompatibilities); /** *

      * The task launch types the task definition was validated against. The valid values are EC2, * FARGATE, and EXTERNAL. For more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. *

      * * @param requiresCompatibilities * The task launch types the task definition was validated against. The valid values are EC2 * , FARGATE, and EXTERNAL. For more information, see Amazon ECS launch * types in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder requiresCompatibilities(Compatibility... requiresCompatibilities); /** *

      * The number of cpu units used by the task. If you use the EC2 launch type, this field is * optional. Any value can be used. If you use the Fargate launch type, this field is required. You must use one * of the following values. The value that you choose determines your range of valid values for the * memory parameter. *

      *

      * The CPU units cannot be less than 1 vCPU when you use Windows containers on Fargate. *

      *
        *
      • *

        * 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) *

        *
      • *
      • *

        * 512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) *

        *
      • *
      • *

        * 1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), * 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) *

        *
      • *
      • *

        * 2048 (2 vCPU) - Available memory values: 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 * GB) *

        *
      • *
      • *

        * 4096 (4 vCPU) - Available memory values: 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 * GB) *

        *
      • *
      • *

        * 8192 (8 vCPU) - Available memory values: 16 GB and 60 GB in 4 GB increments *

        *

        * This option requires Linux platform 1.4.0 or later. *

        *
      • *
      • *

        * 16384 (16vCPU) - Available memory values: 32GB and 120 GB in 8 GB increments *

        *

        * This option requires Linux platform 1.4.0 or later. *

        *
      • *
      * * @param cpu * The number of cpu units used by the task. If you use the EC2 launch type, this field is * optional. Any value can be used. If you use the Fargate launch type, this field is required. You must * use one of the following values. The value that you choose determines your range of valid values for * the memory parameter.

      *

      * The CPU units cannot be less than 1 vCPU when you use Windows containers on Fargate. *

      *
        *
      • *

        * 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) *

        *
      • *
      • *

        * 512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 * GB) *

        *
      • *
      • *

        * 1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 * GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) *

        *
      • *
      • *

        * 2048 (2 vCPU) - Available memory values: 4096 (4 GB) and 16384 (16 GB) in increments of * 1024 (1 GB) *

        *
      • *
      • *

        * 4096 (4 vCPU) - Available memory values: 8192 (8 GB) and 30720 (30 GB) in increments of * 1024 (1 GB) *

        *
      • *
      • *

        * 8192 (8 vCPU) - Available memory values: 16 GB and 60 GB in 4 GB increments *

        *

        * This option requires Linux platform 1.4.0 or later. *

        *
      • *
      • *

        * 16384 (16vCPU) - Available memory values: 32GB and 120 GB in 8 GB increments *

        *

        * This option requires Linux platform 1.4.0 or later. *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. */ Builder cpu(String cpu); /** *

        * The amount (in MiB) of memory used by the task. *

        *

        * If your tasks runs on Amazon EC2 instances, you must specify either a task-level memory value or a * container-level memory value. This field is optional and any value can be used. If a task-level memory value * is specified, the container-level memory value is optional. For more information regarding container-level * memory and memory reservation, see ContainerDefinition. *

        *

        * If your tasks runs on Fargate, this field is required. You must use one of the following values. The value * you choose determines your range of valid values for the cpu parameter. *

        *
          *
        • *

          * 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU) *

          *
        • *
        • *

          * 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU) *

          *
        • *
        • *

          * 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available * cpu values: 1024 (1 vCPU) *

          *
        • *
        • *

          * Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 * (2 vCPU) *

          *
        • *
        • *

          * Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 * (4 vCPU) *

          *
        • *
        • *

          * Between 16 GB and 60 GB in 4 GB increments - Available cpu values: 8192 (8 vCPU) *

          *

          * This option requires Linux platform 1.4.0 or later. *

          *
        • *
        • *

          * Between 32GB and 120 GB in 8 GB increments - Available cpu values: 16384 (16 vCPU) *

          *

          * This option requires Linux platform 1.4.0 or later. *

          *
        • *
        * * @param memory * The amount (in MiB) of memory used by the task.

        *

        * If your tasks runs on Amazon EC2 instances, you must specify either a task-level memory value or a * container-level memory value. This field is optional and any value can be used. If a task-level memory * value is specified, the container-level memory value is optional. For more information regarding * container-level memory and memory reservation, see ContainerDefinition. *

        *

        * If your tasks runs on Fargate, this field is required. You must use one of the following values. The * value you choose determines your range of valid values for the cpu parameter. *

        *
          *
        • *

          * 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU) *

          *
        • *
        • *

          * 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU) *

          *
        • *
        • *

          * 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available * cpu values: 1024 (1 vCPU) *

          *
        • *
        • *

          * Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu * values: 2048 (2 vCPU) *

          *
        • *
        • *

          * Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu * values: 4096 (4 vCPU) *

          *
        • *
        • *

          * Between 16 GB and 60 GB in 4 GB increments - Available cpu values: 8192 (8 vCPU) *

          *

          * This option requires Linux platform 1.4.0 or later. *

          *
        • *
        • *

          * Between 32GB and 120 GB in 8 GB increments - Available cpu values: 16384 (16 vCPU) *

          *

          * This option requires Linux platform 1.4.0 or later. *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. */ Builder memory(String memory); /** *

          * The Elastic Inference accelerator that's associated with the task. *

          * * @param inferenceAccelerators * The Elastic Inference accelerator that's associated with the task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inferenceAccelerators(Collection inferenceAccelerators); /** *

          * The Elastic Inference accelerator that's associated with the task. *

          * * @param inferenceAccelerators * The Elastic Inference accelerator that's associated with the task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inferenceAccelerators(InferenceAccelerator... inferenceAccelerators); /** *

          * The Elastic Inference accelerator that's associated with the task. *

          * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ecs.model.InferenceAccelerator.Builder} avoiding the need to create * one manually via {@link software.amazon.awssdk.services.ecs.model.InferenceAccelerator#builder()}. * *

          * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ecs.model.InferenceAccelerator.Builder#build()} is called immediately * and its result is passed to {@link #inferenceAccelerators(List)}. * * @param inferenceAccelerators * a consumer that will call methods on * {@link software.amazon.awssdk.services.ecs.model.InferenceAccelerator.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #inferenceAccelerators(java.util.Collection) */ Builder inferenceAccelerators(Consumer... inferenceAccelerators); /** *

          * The process namespace to use for the containers in the task. The valid values are host or * task. On Fargate for Linux containers, the only valid value is task. For example, * monitoring sidecars might need pidMode to access information about other containers running in * the same task. *

          *

          * If host is specified, all containers within the tasks that specified the host PID * mode on the same container instance share the same process namespace with the host Amazon EC2 instance. *

          *

          * If task is specified, all containers within the specified task share the same process namespace. *

          *

          * If no value is specified, the default is a private namespace for each container. For more information, see PID settings in the Docker run * reference. *

          *

          * If the host PID mode is used, there's a heightened risk of undesired process namespace exposure. * For more information, see Docker security. *

          * *

          * This parameter is not supported for Windows containers. *

          *
          *

          * This parameter is only supported for tasks that are hosted on Fargate if the tasks are using platform version * 1.4.0 or later (Linux). This isn't supported for Windows containers on Fargate. *

          *
          * * @param pidMode * The process namespace to use for the containers in the task. The valid values are host or * task. On Fargate for Linux containers, the only valid value is task. For * example, monitoring sidecars might need pidMode to access information about other * containers running in the same task.

          *

          * If host is specified, all containers within the tasks that specified the * host PID mode on the same container instance share the same process namespace with the * host Amazon EC2 instance. *

          *

          * If task is specified, all containers within the specified task share the same process * namespace. *

          *

          * If no value is specified, the default is a private namespace for each container. For more information, * see PID settings in the * Docker run reference. *

          *

          * If the host PID mode is used, there's a heightened risk of undesired process namespace * exposure. For more information, see Docker * security. *

          * *

          * This parameter is not supported for Windows containers. *

          *
          *

          * This parameter is only supported for tasks that are hosted on Fargate if the tasks are using platform * version 1.4.0 or later (Linux). This isn't supported for Windows containers on Fargate. *

          * @see PidMode * @return Returns a reference to this object so that method calls can be chained together. * @see PidMode */ Builder pidMode(String pidMode); /** *

          * The process namespace to use for the containers in the task. The valid values are host or * task. On Fargate for Linux containers, the only valid value is task. For example, * monitoring sidecars might need pidMode to access information about other containers running in * the same task. *

          *

          * If host is specified, all containers within the tasks that specified the host PID * mode on the same container instance share the same process namespace with the host Amazon EC2 instance. *

          *

          * If task is specified, all containers within the specified task share the same process namespace. *

          *

          * If no value is specified, the default is a private namespace for each container. For more information, see PID settings in the Docker run * reference. *

          *

          * If the host PID mode is used, there's a heightened risk of undesired process namespace exposure. * For more information, see Docker security. *

          * *

          * This parameter is not supported for Windows containers. *

          *
          *

          * This parameter is only supported for tasks that are hosted on Fargate if the tasks are using platform version * 1.4.0 or later (Linux). This isn't supported for Windows containers on Fargate. *

          *
          * * @param pidMode * The process namespace to use for the containers in the task. The valid values are host or * task. On Fargate for Linux containers, the only valid value is task. For * example, monitoring sidecars might need pidMode to access information about other * containers running in the same task.

          *

          * If host is specified, all containers within the tasks that specified the * host PID mode on the same container instance share the same process namespace with the * host Amazon EC2 instance. *

          *

          * If task is specified, all containers within the specified task share the same process * namespace. *

          *

          * If no value is specified, the default is a private namespace for each container. For more information, * see PID settings in the * Docker run reference. *

          *

          * If the host PID mode is used, there's a heightened risk of undesired process namespace * exposure. For more information, see Docker * security. *

          * *

          * This parameter is not supported for Windows containers. *

          *
          *

          * This parameter is only supported for tasks that are hosted on Fargate if the tasks are using platform * version 1.4.0 or later (Linux). This isn't supported for Windows containers on Fargate. *

          * @see PidMode * @return Returns a reference to this object so that method calls can be chained together. * @see PidMode */ Builder pidMode(PidMode pidMode); /** *

          * The IPC resource namespace to use for the containers in the task. The valid values are host, * task, or none. If host is specified, then all containers within the * tasks that specified the host IPC mode on the same container instance share the same IPC * resources with the host Amazon EC2 instance. If task is specified, all containers within the * specified task share the same IPC resources. If none is specified, then IPC resources within the * containers of a task are private and not shared with other containers in a task or on the container instance. * If no value is specified, then the IPC resource namespace sharing depends on the Docker daemon setting on the * container instance. For more information, see IPC settings in the Docker run * reference. *

          *

          * If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC * namespace expose. For more information, see Docker security. *

          *

          * If you are setting namespaced kernel parameters using systemControls for the containers in the * task, the following will apply to your IPC resource namespace. For more information, see System * Controls in the Amazon Elastic Container Service Developer Guide. *

          *
            *
          • *

            * For tasks that use the host IPC mode, IPC namespace related systemControls are not * supported. *

            *
          • *
          • *

            * For tasks that use the task IPC mode, IPC namespace related systemControls will * apply to all containers within a task. *

            *
          • *
          * *

          * This parameter is not supported for Windows containers or tasks run on Fargate. *

          *
          * * @param ipcMode * The IPC resource namespace to use for the containers in the task. The valid values are * host, task, or none. If host is specified, then * all containers within the tasks that specified the host IPC mode on the same container * instance share the same IPC resources with the host Amazon EC2 instance. If task is * specified, all containers within the specified task share the same IPC resources. If none * is specified, then IPC resources within the containers of a task are private and not shared with other * containers in a task or on the container instance. If no value is specified, then the IPC resource * namespace sharing depends on the Docker daemon setting on the container instance. For more * information, see IPC * settings in the Docker run reference.

          *

          * If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC * namespace expose. For more information, see Docker security. *

          *

          * If you are setting namespaced kernel parameters using systemControls for the containers * in the task, the following will apply to your IPC resource namespace. For more information, see System * Controls in the Amazon Elastic Container Service Developer Guide. *

          *
            *
          • *

            * For tasks that use the host IPC mode, IPC namespace related systemControls * are not supported. *

            *
          • *
          • *

            * For tasks that use the task IPC mode, IPC namespace related systemControls * will apply to all containers within a task. *

            *
          • *
          * *

          * This parameter is not supported for Windows containers or tasks run on Fargate. *

          * @see IpcMode * @return Returns a reference to this object so that method calls can be chained together. * @see IpcMode */ Builder ipcMode(String ipcMode); /** *

          * The IPC resource namespace to use for the containers in the task. The valid values are host, * task, or none. If host is specified, then all containers within the * tasks that specified the host IPC mode on the same container instance share the same IPC * resources with the host Amazon EC2 instance. If task is specified, all containers within the * specified task share the same IPC resources. If none is specified, then IPC resources within the * containers of a task are private and not shared with other containers in a task or on the container instance. * If no value is specified, then the IPC resource namespace sharing depends on the Docker daemon setting on the * container instance. For more information, see IPC settings in the Docker run * reference. *

          *

          * If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC * namespace expose. For more information, see Docker security. *

          *

          * If you are setting namespaced kernel parameters using systemControls for the containers in the * task, the following will apply to your IPC resource namespace. For more information, see System * Controls in the Amazon Elastic Container Service Developer Guide. *

          *
            *
          • *

            * For tasks that use the host IPC mode, IPC namespace related systemControls are not * supported. *

            *
          • *
          • *

            * For tasks that use the task IPC mode, IPC namespace related systemControls will * apply to all containers within a task. *

            *
          • *
          * *

          * This parameter is not supported for Windows containers or tasks run on Fargate. *

          *
          * * @param ipcMode * The IPC resource namespace to use for the containers in the task. The valid values are * host, task, or none. If host is specified, then * all containers within the tasks that specified the host IPC mode on the same container * instance share the same IPC resources with the host Amazon EC2 instance. If task is * specified, all containers within the specified task share the same IPC resources. If none * is specified, then IPC resources within the containers of a task are private and not shared with other * containers in a task or on the container instance. If no value is specified, then the IPC resource * namespace sharing depends on the Docker daemon setting on the container instance. For more * information, see IPC * settings in the Docker run reference.

          *

          * If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC * namespace expose. For more information, see Docker security. *

          *

          * If you are setting namespaced kernel parameters using systemControls for the containers * in the task, the following will apply to your IPC resource namespace. For more information, see System * Controls in the Amazon Elastic Container Service Developer Guide. *

          *
            *
          • *

            * For tasks that use the host IPC mode, IPC namespace related systemControls * are not supported. *

            *
          • *
          • *

            * For tasks that use the task IPC mode, IPC namespace related systemControls * will apply to all containers within a task. *

            *
          • *
          * *

          * This parameter is not supported for Windows containers or tasks run on Fargate. *

          * @see IpcMode * @return Returns a reference to this object so that method calls can be chained together. * @see IpcMode */ Builder ipcMode(IpcMode ipcMode); /** *

          * The configuration details for the App Mesh proxy. *

          *

          * Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at least * version 1.26.0-1 of the ecs-init package to use a proxy configuration. If your container * instances are launched from the Amazon ECS optimized AMI version 20190301 or later, they contain * the required versions of the container agent and ecs-init. For more information, see Amazon * ECS-optimized Linux AMI in the Amazon Elastic Container Service Developer Guide. *

          * * @param proxyConfiguration * The configuration details for the App Mesh proxy.

          *

          * Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at * least version 1.26.0-1 of the ecs-init package to use a proxy configuration. If your * container instances are launched from the Amazon ECS optimized AMI version 20190301 or * later, they contain the required versions of the container agent and ecs-init. For more * information, see Amazon * ECS-optimized Linux AMI in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder proxyConfiguration(ProxyConfiguration proxyConfiguration); /** *

          * The configuration details for the App Mesh proxy. *

          *

          * Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at least * version 1.26.0-1 of the ecs-init package to use a proxy configuration. If your container * instances are launched from the Amazon ECS optimized AMI version 20190301 or later, they contain * the required versions of the container agent and ecs-init. For more information, see Amazon * ECS-optimized Linux AMI in the Amazon Elastic Container Service Developer Guide. *

          * This is a convenience method that creates an instance of the {@link ProxyConfiguration.Builder} avoiding the * need to create one manually via {@link ProxyConfiguration#builder()}. * *

          * When the {@link Consumer} completes, {@link ProxyConfiguration.Builder#build()} is called immediately and its * result is passed to {@link #proxyConfiguration(ProxyConfiguration)}. * * @param proxyConfiguration * a consumer that will call methods on {@link ProxyConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #proxyConfiguration(ProxyConfiguration) */ default Builder proxyConfiguration(Consumer proxyConfiguration) { return proxyConfiguration(ProxyConfiguration.builder().applyMutation(proxyConfiguration).build()); } /** *

          * The Unix timestamp for the time when the task definition was registered. *

          * * @param registeredAt * The Unix timestamp for the time when the task definition was registered. * @return Returns a reference to this object so that method calls can be chained together. */ Builder registeredAt(Instant registeredAt); /** *

          * The Unix timestamp for the time when the task definition was deregistered. *

          * * @param deregisteredAt * The Unix timestamp for the time when the task definition was deregistered. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deregisteredAt(Instant deregisteredAt); /** *

          * The principal that registered the task definition. *

          * * @param registeredBy * The principal that registered the task definition. * @return Returns a reference to this object so that method calls can be chained together. */ Builder registeredBy(String registeredBy); /** *

          * The ephemeral storage settings to use for tasks run with the task definition. *

          * * @param ephemeralStorage * The ephemeral storage settings to use for tasks run with the task definition. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ephemeralStorage(EphemeralStorage ephemeralStorage); /** *

          * The ephemeral storage settings to use for tasks run with the task definition. *

          * This is a convenience method that creates an instance of the {@link EphemeralStorage.Builder} avoiding the * need to create one manually via {@link EphemeralStorage#builder()}. * *

          * When the {@link Consumer} completes, {@link EphemeralStorage.Builder#build()} is called immediately and its * result is passed to {@link #ephemeralStorage(EphemeralStorage)}. * * @param ephemeralStorage * a consumer that will call methods on {@link EphemeralStorage.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #ephemeralStorage(EphemeralStorage) */ default Builder ephemeralStorage(Consumer ephemeralStorage) { return ephemeralStorage(EphemeralStorage.builder().applyMutation(ephemeralStorage).build()); } } static final class BuilderImpl implements Builder { private String taskDefinitionArn; private List containerDefinitions = DefaultSdkAutoConstructList.getInstance(); private String family; private String taskRoleArn; private String executionRoleArn; private String networkMode; private Integer revision; private List volumes = DefaultSdkAutoConstructList.getInstance(); private String status; private List requiresAttributes = DefaultSdkAutoConstructList.getInstance(); private List placementConstraints = DefaultSdkAutoConstructList.getInstance(); private List compatibilities = DefaultSdkAutoConstructList.getInstance(); private RuntimePlatform runtimePlatform; private List requiresCompatibilities = DefaultSdkAutoConstructList.getInstance(); private String cpu; private String memory; private List inferenceAccelerators = DefaultSdkAutoConstructList.getInstance(); private String pidMode; private String ipcMode; private ProxyConfiguration proxyConfiguration; private Instant registeredAt; private Instant deregisteredAt; private String registeredBy; private EphemeralStorage ephemeralStorage; private BuilderImpl() { } private BuilderImpl(TaskDefinition model) { taskDefinitionArn(model.taskDefinitionArn); containerDefinitions(model.containerDefinitions); family(model.family); taskRoleArn(model.taskRoleArn); executionRoleArn(model.executionRoleArn); networkMode(model.networkMode); revision(model.revision); volumes(model.volumes); status(model.status); requiresAttributes(model.requiresAttributes); placementConstraints(model.placementConstraints); compatibilitiesWithStrings(model.compatibilities); runtimePlatform(model.runtimePlatform); requiresCompatibilitiesWithStrings(model.requiresCompatibilities); cpu(model.cpu); memory(model.memory); inferenceAccelerators(model.inferenceAccelerators); pidMode(model.pidMode); ipcMode(model.ipcMode); proxyConfiguration(model.proxyConfiguration); registeredAt(model.registeredAt); deregisteredAt(model.deregisteredAt); registeredBy(model.registeredBy); ephemeralStorage(model.ephemeralStorage); } public final String getTaskDefinitionArn() { return taskDefinitionArn; } public final void setTaskDefinitionArn(String taskDefinitionArn) { this.taskDefinitionArn = taskDefinitionArn; } @Override public final Builder taskDefinitionArn(String taskDefinitionArn) { this.taskDefinitionArn = taskDefinitionArn; return this; } public final List getContainerDefinitions() { List result = ContainerDefinitionsCopier.copyToBuilder(this.containerDefinitions); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setContainerDefinitions(Collection containerDefinitions) { this.containerDefinitions = ContainerDefinitionsCopier.copyFromBuilder(containerDefinitions); } @Override public final Builder containerDefinitions(Collection containerDefinitions) { this.containerDefinitions = ContainerDefinitionsCopier.copy(containerDefinitions); return this; } @Override @SafeVarargs public final Builder containerDefinitions(ContainerDefinition... containerDefinitions) { containerDefinitions(Arrays.asList(containerDefinitions)); return this; } @Override @SafeVarargs public final Builder containerDefinitions(Consumer... containerDefinitions) { containerDefinitions(Stream.of(containerDefinitions).map(c -> ContainerDefinition.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getFamily() { return family; } public final void setFamily(String family) { this.family = family; } @Override public final Builder family(String family) { this.family = family; return this; } public final String getTaskRoleArn() { return taskRoleArn; } public final void setTaskRoleArn(String taskRoleArn) { this.taskRoleArn = taskRoleArn; } @Override public final Builder taskRoleArn(String taskRoleArn) { this.taskRoleArn = taskRoleArn; return this; } public final String getExecutionRoleArn() { return executionRoleArn; } public final void setExecutionRoleArn(String executionRoleArn) { this.executionRoleArn = executionRoleArn; } @Override public final Builder executionRoleArn(String executionRoleArn) { this.executionRoleArn = executionRoleArn; return this; } public final String getNetworkMode() { return networkMode; } public final void setNetworkMode(String networkMode) { this.networkMode = networkMode; } @Override public final Builder networkMode(String networkMode) { this.networkMode = networkMode; return this; } @Override public final Builder networkMode(NetworkMode networkMode) { this.networkMode(networkMode == null ? null : networkMode.toString()); return this; } public final Integer getRevision() { return revision; } public final void setRevision(Integer revision) { this.revision = revision; } @Override public final Builder revision(Integer revision) { this.revision = revision; return this; } public final List getVolumes() { List result = VolumeListCopier.copyToBuilder(this.volumes); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setVolumes(Collection volumes) { this.volumes = VolumeListCopier.copyFromBuilder(volumes); } @Override public final Builder volumes(Collection volumes) { this.volumes = VolumeListCopier.copy(volumes); return this; } @Override @SafeVarargs public final Builder volumes(Volume... volumes) { volumes(Arrays.asList(volumes)); return this; } @Override @SafeVarargs public final Builder volumes(Consumer... volumes) { volumes(Stream.of(volumes).map(c -> Volume.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(TaskDefinitionStatus status) { this.status(status == null ? null : status.toString()); return this; } public final List getRequiresAttributes() { List result = RequiresAttributesCopier.copyToBuilder(this.requiresAttributes); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setRequiresAttributes(Collection requiresAttributes) { this.requiresAttributes = RequiresAttributesCopier.copyFromBuilder(requiresAttributes); } @Override public final Builder requiresAttributes(Collection requiresAttributes) { this.requiresAttributes = RequiresAttributesCopier.copy(requiresAttributes); return this; } @Override @SafeVarargs public final Builder requiresAttributes(Attribute... requiresAttributes) { requiresAttributes(Arrays.asList(requiresAttributes)); return this; } @Override @SafeVarargs public final Builder requiresAttributes(Consumer... requiresAttributes) { requiresAttributes(Stream.of(requiresAttributes).map(c -> Attribute.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final List getPlacementConstraints() { List result = TaskDefinitionPlacementConstraintsCopier .copyToBuilder(this.placementConstraints); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setPlacementConstraints(Collection placementConstraints) { this.placementConstraints = TaskDefinitionPlacementConstraintsCopier.copyFromBuilder(placementConstraints); } @Override public final Builder placementConstraints(Collection placementConstraints) { this.placementConstraints = TaskDefinitionPlacementConstraintsCopier.copy(placementConstraints); return this; } @Override @SafeVarargs public final Builder placementConstraints(TaskDefinitionPlacementConstraint... placementConstraints) { placementConstraints(Arrays.asList(placementConstraints)); return this; } @Override @SafeVarargs public final Builder placementConstraints(Consumer... placementConstraints) { placementConstraints(Stream.of(placementConstraints) .map(c -> TaskDefinitionPlacementConstraint.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final Collection getCompatibilities() { if (compatibilities instanceof SdkAutoConstructList) { return null; } return compatibilities; } public final void setCompatibilities(Collection compatibilities) { this.compatibilities = CompatibilityListCopier.copy(compatibilities); } @Override public final Builder compatibilitiesWithStrings(Collection compatibilities) { this.compatibilities = CompatibilityListCopier.copy(compatibilities); return this; } @Override @SafeVarargs public final Builder compatibilitiesWithStrings(String... compatibilities) { compatibilitiesWithStrings(Arrays.asList(compatibilities)); return this; } @Override public final Builder compatibilities(Collection compatibilities) { this.compatibilities = CompatibilityListCopier.copyEnumToString(compatibilities); return this; } @Override @SafeVarargs public final Builder compatibilities(Compatibility... compatibilities) { compatibilities(Arrays.asList(compatibilities)); return this; } public final RuntimePlatform.Builder getRuntimePlatform() { return runtimePlatform != null ? runtimePlatform.toBuilder() : null; } public final void setRuntimePlatform(RuntimePlatform.BuilderImpl runtimePlatform) { this.runtimePlatform = runtimePlatform != null ? runtimePlatform.build() : null; } @Override public final Builder runtimePlatform(RuntimePlatform runtimePlatform) { this.runtimePlatform = runtimePlatform; return this; } public final Collection getRequiresCompatibilities() { if (requiresCompatibilities instanceof SdkAutoConstructList) { return null; } return requiresCompatibilities; } public final void setRequiresCompatibilities(Collection requiresCompatibilities) { this.requiresCompatibilities = CompatibilityListCopier.copy(requiresCompatibilities); } @Override public final Builder requiresCompatibilitiesWithStrings(Collection requiresCompatibilities) { this.requiresCompatibilities = CompatibilityListCopier.copy(requiresCompatibilities); return this; } @Override @SafeVarargs public final Builder requiresCompatibilitiesWithStrings(String... requiresCompatibilities) { requiresCompatibilitiesWithStrings(Arrays.asList(requiresCompatibilities)); return this; } @Override public final Builder requiresCompatibilities(Collection requiresCompatibilities) { this.requiresCompatibilities = CompatibilityListCopier.copyEnumToString(requiresCompatibilities); return this; } @Override @SafeVarargs public final Builder requiresCompatibilities(Compatibility... requiresCompatibilities) { requiresCompatibilities(Arrays.asList(requiresCompatibilities)); return this; } public final String getCpu() { return cpu; } public final void setCpu(String cpu) { this.cpu = cpu; } @Override public final Builder cpu(String cpu) { this.cpu = cpu; return this; } public final String getMemory() { return memory; } public final void setMemory(String memory) { this.memory = memory; } @Override public final Builder memory(String memory) { this.memory = memory; return this; } public final List getInferenceAccelerators() { List result = InferenceAcceleratorsCopier.copyToBuilder(this.inferenceAccelerators); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setInferenceAccelerators(Collection inferenceAccelerators) { this.inferenceAccelerators = InferenceAcceleratorsCopier.copyFromBuilder(inferenceAccelerators); } @Override public final Builder inferenceAccelerators(Collection inferenceAccelerators) { this.inferenceAccelerators = InferenceAcceleratorsCopier.copy(inferenceAccelerators); return this; } @Override @SafeVarargs public final Builder inferenceAccelerators(InferenceAccelerator... inferenceAccelerators) { inferenceAccelerators(Arrays.asList(inferenceAccelerators)); return this; } @Override @SafeVarargs public final Builder inferenceAccelerators(Consumer... inferenceAccelerators) { inferenceAccelerators(Stream.of(inferenceAccelerators) .map(c -> InferenceAccelerator.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final String getPidMode() { return pidMode; } public final void setPidMode(String pidMode) { this.pidMode = pidMode; } @Override public final Builder pidMode(String pidMode) { this.pidMode = pidMode; return this; } @Override public final Builder pidMode(PidMode pidMode) { this.pidMode(pidMode == null ? null : pidMode.toString()); return this; } public final String getIpcMode() { return ipcMode; } public final void setIpcMode(String ipcMode) { this.ipcMode = ipcMode; } @Override public final Builder ipcMode(String ipcMode) { this.ipcMode = ipcMode; return this; } @Override public final Builder ipcMode(IpcMode ipcMode) { this.ipcMode(ipcMode == null ? null : ipcMode.toString()); return this; } public final ProxyConfiguration.Builder getProxyConfiguration() { return proxyConfiguration != null ? proxyConfiguration.toBuilder() : null; } public final void setProxyConfiguration(ProxyConfiguration.BuilderImpl proxyConfiguration) { this.proxyConfiguration = proxyConfiguration != null ? proxyConfiguration.build() : null; } @Override public final Builder proxyConfiguration(ProxyConfiguration proxyConfiguration) { this.proxyConfiguration = proxyConfiguration; return this; } public final Instant getRegisteredAt() { return registeredAt; } public final void setRegisteredAt(Instant registeredAt) { this.registeredAt = registeredAt; } @Override public final Builder registeredAt(Instant registeredAt) { this.registeredAt = registeredAt; return this; } public final Instant getDeregisteredAt() { return deregisteredAt; } public final void setDeregisteredAt(Instant deregisteredAt) { this.deregisteredAt = deregisteredAt; } @Override public final Builder deregisteredAt(Instant deregisteredAt) { this.deregisteredAt = deregisteredAt; return this; } public final String getRegisteredBy() { return registeredBy; } public final void setRegisteredBy(String registeredBy) { this.registeredBy = registeredBy; } @Override public final Builder registeredBy(String registeredBy) { this.registeredBy = registeredBy; return this; } public final EphemeralStorage.Builder getEphemeralStorage() { return ephemeralStorage != null ? ephemeralStorage.toBuilder() : null; } public final void setEphemeralStorage(EphemeralStorage.BuilderImpl ephemeralStorage) { this.ephemeralStorage = ephemeralStorage != null ? ephemeralStorage.build() : null; } @Override public final Builder ephemeralStorage(EphemeralStorage ephemeralStorage) { this.ephemeralStorage = ephemeralStorage; return this; } @Override public TaskDefinition build() { return new TaskDefinition(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy