Skip to content

/AWS1/IF_ECS=>REGISTERTASKDEFINITION()

About RegisterTaskDefinition

Registers a new task definition from the supplied family and containerDefinitions. Optionally, you can add data volumes to your containers with the volumes parameter. For more information about task definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon Elastic Container Service Developer Guide.

You can specify a role for your task with the taskRoleArn parameter. When you specify a role for a task, its containers can then use the latest versions of the CLI or SDKs to make API requests to the Amazon Web Services services that are specified in the policy that's associated with the role. For more information, see IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide.

You can specify a Docker networking mode for the containers in your task definition with the networkMode parameter. If you specify the awsvpc network mode, the task is allocated an elastic network interface, and you must specify a NetworkConfiguration when you create a service or run a task with the task definition. For more information, see Task Networking in the Amazon Elastic Container Service Developer Guide.

Method Signature

METHODS /AWS1/IF_ECS~REGISTERTASKDEFINITION
  IMPORTING
    !IV_FAMILY TYPE /AWS1/ECSSTRING OPTIONAL
    !IV_TASKROLEARN TYPE /AWS1/ECSSTRING OPTIONAL
    !IV_EXECUTIONROLEARN TYPE /AWS1/ECSSTRING OPTIONAL
    !IV_NETWORKMODE TYPE /AWS1/ECSNETWORKMODE OPTIONAL
    !IT_CONTAINERDEFINITIONS TYPE /AWS1/CL_ECSCONTAINERDEFN=>TT_CONTAINERDEFINITIONS OPTIONAL
    !IT_VOLUMES TYPE /AWS1/CL_ECSVOLUME=>TT_VOLUMELIST OPTIONAL
    !IT_PLACEMENTCONSTRAINTS TYPE /AWS1/CL_ECSTASKDEFPLCCNS=>TT_TASKDEFNPLACEMENTCNSTRNTS OPTIONAL
    !IT_REQUIRESCOMPATIBILITIES TYPE /AWS1/CL_ECSCOMPATIBILITYLST_W=>TT_COMPATIBILITYLIST OPTIONAL
    !IV_CPU TYPE /AWS1/ECSSTRING OPTIONAL
    !IV_MEMORY TYPE /AWS1/ECSSTRING OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_ECSTAG=>TT_TAGS OPTIONAL
    !IV_PIDMODE TYPE /AWS1/ECSPIDMODE OPTIONAL
    !IV_IPCMODE TYPE /AWS1/ECSIPCMODE OPTIONAL
    !IO_PROXYCONFIGURATION TYPE REF TO /AWS1/CL_ECSPROXYCONFIGURATION OPTIONAL
    !IT_INFERENCEACCELERATORS TYPE /AWS1/CL_ECSINFERENCEACCELER00=>TT_INFERENCEACCELERATORS OPTIONAL
    !IO_EPHEMERALSTORAGE TYPE REF TO /AWS1/CL_ECSEPHEMERALSTORAGE OPTIONAL
    !IO_RUNTIMEPLATFORM TYPE REF TO /AWS1/CL_ECSRUNTIMEPLATFORM OPTIONAL
    !IV_ENABLEFAULTINJECTION TYPE /AWS1/ECSBOXEDBOOLEAN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ecsregtaskdefnrsp
  RAISING
    /AWS1/CX_ECSCLIENTEXCEPTION
    /AWS1/CX_ECSINVALIDPARAMETEREX
    /AWS1/CX_ECSSERVEREXCEPTION
    /AWS1/CX_ECSCLIENTEXC
    /AWS1/CX_ECSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_family TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING

You must specify a family for a task definition. You can use it track multiple versions of the same task definition. The family is used as a name for your task definition. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.

it_containerdefinitions TYPE /AWS1/CL_ECSCONTAINERDEFN=>TT_CONTAINERDEFINITIONS TT_CONTAINERDEFINITIONS

A list of container definitions in JSON format that describe the different containers that make up your task.

Optional arguments:

iv_taskrolearn TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING

The short name or full Amazon Resource Name (ARN) of the IAM role that containers in this task can assume. All containers in this task are granted the permissions that are specified in this role. For more information, see IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide.

iv_executionrolearn TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING

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. For informationabout the required IAM roles for Amazon ECS, see IAM roles for Amazon ECS in the Amazon Elastic Container Service Developer Guide.

iv_networkmode TYPE /AWS1/ECSNETWORKMODE /AWS1/ECSNETWORKMODE

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, 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.

it_volumes TYPE /AWS1/CL_ECSVOLUME=>TT_VOLUMELIST TT_VOLUMELIST

A list of volume definitions in JSON format that containers in your task might use.

it_placementconstraints TYPE /AWS1/CL_ECSTASKDEFPLCCNS=>TT_TASKDEFNPLACEMENTCNSTRNTS TT_TASKDEFNPLACEMENTCNSTRNTS

An array of placement constraint objects to use for the task. You can specify a maximum of 10 constraints for each task. This limit includes constraints in the task definition and those specified at runtime.

it_requirescompatibilities TYPE /AWS1/CL_ECSCOMPATIBILITYLST_W=>TT_COMPATIBILITYLIST TT_COMPATIBILITYLIST

The task launch type that Amazon ECS validates the task definition against. A client exception is returned if the task definition doesn't validate against the compatibilities specified. If no value is specified, the parameter is omitted from the response.

iv_cpu TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING

The number of CPU units used by the task. It can be expressed as an integer using CPU units (for example, 1024) or as a string using vCPUs (for example, 1 vCPU or 1 vcpu) in a task definition. String values are converted to an integer indicating the CPU units when the task definition is registered.

Task-level CPU and memory parameters are ignored for Windows containers. We recommend specifying container-level resources for Windows containers.

If you're using the EC2 launch type or external launch type, this field is optional. Supported values are between 128 CPU units (0.125 vCPUs) and 196608 CPU units (192 vCPUs). If you do not specify a value, the parameter is ignored.

This field is required for Fargate. For information about the valid values, see Task size in the Amazon Elastic Container Service Developer Guide.

iv_memory TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING

The amount of memory (in MiB) used by the task. It can be expressed as an integer using MiB (for example ,1024) or as a string using GB (for example, 1GB or 1 GB) in a task definition. String values are converted to an integer indicating the MiB when the task definition is registered.

Task-level CPU and memory parameters are ignored for Windows containers. We recommend specifying container-level resources for Windows containers.

If using the EC2 launch type, this field is optional.

If using the Fargate launch type, this field is required and you must use one of the following values. This determines your range of supported values for the cpu parameter.

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

  • 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.

it_tags TYPE /AWS1/CL_ECSTAG=>TT_TAGS TT_TAGS

The metadata that you apply to the task definition to help you categorize and organize them. Each tag consists of a key and an optional value. You define both of them.

The following basic restrictions apply to tags:

  • Maximum number of tags per resource - 50

  • For each resource, each tag key must be unique, and each tag key can have only one value.

  • Maximum key length - 128 Unicode characters in UTF-8

  • Maximum value length - 256 Unicode characters in UTF-8

  • If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.

  • Tag keys and values are case-sensitive.

  • Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.

iv_pidmode TYPE /AWS1/ECSPIDMODE /AWS1/ECSPIDMODE

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 The default is a private namespace for each container.

If the host PID mode is used, there's a heightened risk of undesired process namespace exposure.

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.

iv_ipcmode TYPE /AWS1/ECSIPCMODE /AWS1/ECSIPCMODE

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.

If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC namespace expose.

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.

io_proxyconfiguration TYPE REF TO /AWS1/CL_ECSPROXYCONFIGURATION /AWS1/CL_ECSPROXYCONFIGURATION

The configuration details for the App Mesh proxy.

For tasks hosted on Amazon EC2 instances, the 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, then they contain the required versions of the container agent and ecs-init. For more information, see Amazon ECS-optimized AMI versions in the Amazon Elastic Container Service Developer Guide.

it_inferenceaccelerators TYPE /AWS1/CL_ECSINFERENCEACCELER00=>TT_INFERENCEACCELERATORS TT_INFERENCEACCELERATORS

The Elastic Inference accelerators to use for the containers in the task.

io_ephemeralstorage TYPE REF TO /AWS1/CL_ECSEPHEMERALSTORAGE /AWS1/CL_ECSEPHEMERALSTORAGE

The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on Fargate. For more information, see Using data volumes in tasks in the Amazon ECS Developer Guide.

For tasks using the Fargate launch type, the task requires the following platforms:

  • Linux platform version 1.4.0 or later.

  • Windows platform version 1.0.0 or later.

io_runtimeplatform TYPE REF TO /AWS1/CL_ECSRUNTIMEPLATFORM /AWS1/CL_ECSRUNTIMEPLATFORM

The operating system that your tasks definitions run on.

iv_enablefaultinjection TYPE /AWS1/ECSBOXEDBOOLEAN /AWS1/ECSBOXEDBOOLEAN

Enables fault injection when you register your task definition and allows for fault injection requests to be accepted from the task's containers. The default value is false.

RETURNING

oo_output TYPE REF TO /aws1/cl_ecsregtaskdefnrsp /AWS1/CL_ECSREGTASKDEFNRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->registertaskdefinition(
  io_ephemeralstorage = new /aws1/cl_ecsephemeralstorage( 123 )
  io_proxyconfiguration = new /aws1/cl_ecsproxyconfiguration(
    it_properties = VALUE /aws1/cl_ecskeyvaluepair=>tt_proxyconfproperties(
      (
        new /aws1/cl_ecskeyvaluepair(
          iv_name = |string|
          iv_value = |string|
        )
      )
    )
    iv_containername = |string|
    iv_type = |string|
  )
  io_runtimeplatform = new /aws1/cl_ecsruntimeplatform(
    iv_cpuarchitecture = |string|
    iv_operatingsystemfamily = |string|
  )
  it_containerdefinitions = VALUE /aws1/cl_ecscontainerdefn=>tt_containerdefinitions(
    (
      new /aws1/cl_ecscontainerdefn(
        io_firelensconfiguration = new /aws1/cl_ecsfirelensconf(
          it_options = VALUE /aws1/cl_ecsfirelensconfopts00=>tt_firelensconfoptionsmap(
            (
              VALUE /aws1/cl_ecsfirelensconfopts00=>ts_firelensconfoptsmap_maprow(
                key = |string|
                value = new /aws1/cl_ecsfirelensconfopts00( |string| )
              )
            )
          )
          iv_type = |string|
        )
        io_healthcheck = new /aws1/cl_ecshealthcheck(
          it_command = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
            ( new /aws1/cl_ecsstringlist_w( |string| ) )
          )
          iv_interval = 123
          iv_retries = 123
          iv_startperiod = 123
          iv_timeout = 123
        )
        io_linuxparameters = new /aws1/cl_ecslinuxparameters(
          io_capabilities = new /aws1/cl_ecskernelcapabilities(
            it_add = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
              ( new /aws1/cl_ecsstringlist_w( |string| ) )
            )
            it_drop = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
              ( new /aws1/cl_ecsstringlist_w( |string| ) )
            )
          )
          it_devices = VALUE /aws1/cl_ecsdevice=>tt_deviceslist(
            (
              new /aws1/cl_ecsdevice(
                it_permissions = VALUE /aws1/cl_ecsdevcgroupperms_w=>tt_devicecgrouppermissions(
                  ( new /aws1/cl_ecsdevcgroupperms_w( |string| ) )
                )
                iv_containerpath = |string|
                iv_hostpath = |string|
              )
            )
          )
          it_tmpfs = VALUE /aws1/cl_ecstmpfs=>tt_tmpfslist(
            (
              new /aws1/cl_ecstmpfs(
                it_mountoptions = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
                  ( new /aws1/cl_ecsstringlist_w( |string| ) )
                )
                iv_containerpath = |string|
                iv_size = 123
              )
            )
          )
          iv_initprocessenabled = ABAP_TRUE
          iv_maxswap = 123
          iv_sharedmemorysize = 123
          iv_swappiness = 123
        )
        io_logconfiguration = new /aws1/cl_ecslogconfiguration(
          it_options = VALUE /aws1/cl_ecslogconfoptsmap_w=>tt_logconfigurationoptionsmap(
            (
              VALUE /aws1/cl_ecslogconfoptsmap_w=>ts_logconfoptionsmap_maprow(
                value = new /aws1/cl_ecslogconfoptsmap_w( |string| )
                key = |string|
              )
            )
          )
          it_secretoptions = VALUE /aws1/cl_ecssecret=>tt_secretlist(
            (
              new /aws1/cl_ecssecret(
                iv_name = |string|
                iv_valuefrom = |string|
              )
            )
          )
          iv_logdriver = |string|
        )
        io_repositorycredentials = new /aws1/cl_ecsrepositorycreds( |string| )
        io_restartpolicy = new /aws1/cl_ecscontainerrestrtply(
          it_ignoredexitcodes = VALUE /aws1/cl_ecsintegerlist_w=>tt_integerlist(
            ( new /aws1/cl_ecsintegerlist_w( 123 ) )
          )
          iv_enabled = ABAP_TRUE
          iv_restartattemptperiod = 123
        )
        it_command = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
          ( new /aws1/cl_ecsstringlist_w( |string| ) )
        )
        it_credentialspecs = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
          ( new /aws1/cl_ecsstringlist_w( |string| ) )
        )
        it_dependson = VALUE /aws1/cl_ecscontainerdepende00=>tt_containerdependencies(
          (
            new /aws1/cl_ecscontainerdepende00(
              iv_condition = |string|
              iv_containername = |string|
            )
          )
        )
        it_dnssearchdomains = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
          ( new /aws1/cl_ecsstringlist_w( |string| ) )
        )
        it_dnsservers = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
          ( new /aws1/cl_ecsstringlist_w( |string| ) )
        )
        it_dockerlabels = VALUE /aws1/cl_ecsdockerlabelsmap_w=>tt_dockerlabelsmap(
          (
            VALUE /aws1/cl_ecsdockerlabelsmap_w=>ts_dockerlabelsmap_maprow(
              key = |string|
              value = new /aws1/cl_ecsdockerlabelsmap_w( |string| )
            )
          )
        )
        it_dockersecurityoptions = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
          ( new /aws1/cl_ecsstringlist_w( |string| ) )
        )
        it_entrypoint = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
          ( new /aws1/cl_ecsstringlist_w( |string| ) )
        )
        it_environment = VALUE /aws1/cl_ecskeyvaluepair=>tt_environmentvariables(
          (
            new /aws1/cl_ecskeyvaluepair(
              iv_name = |string|
              iv_value = |string|
            )
          )
        )
        it_environmentfiles = VALUE /aws1/cl_ecsenvironmentfile=>tt_environmentfiles(
          (
            new /aws1/cl_ecsenvironmentfile(
              iv_type = |string|
              iv_value = |string|
            )
          )
        )
        it_extrahosts = VALUE /aws1/cl_ecshostentry=>tt_hostentrylist(
          (
            new /aws1/cl_ecshostentry(
              iv_hostname = |string|
              iv_ipaddress = |string|
            )
          )
        )
        it_links = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
          ( new /aws1/cl_ecsstringlist_w( |string| ) )
        )
        it_mountpoints = VALUE /aws1/cl_ecsmountpoint=>tt_mountpointlist(
          (
            new /aws1/cl_ecsmountpoint(
              iv_containerpath = |string|
              iv_readonly = ABAP_TRUE
              iv_sourcevolume = |string|
            )
          )
        )
        it_portmappings = VALUE /aws1/cl_ecsportmapping=>tt_portmappinglist(
          (
            new /aws1/cl_ecsportmapping(
              iv_appprotocol = |string|
              iv_containerport = 123
              iv_containerportrange = |string|
              iv_hostport = 123
              iv_name = |string|
              iv_protocol = |string|
            )
          )
        )
        it_resourcerequirements = VALUE /aws1/cl_ecsresrcrequirement=>tt_resourcerequirements(
          (
            new /aws1/cl_ecsresrcrequirement(
              iv_type = |string|
              iv_value = |string|
            )
          )
        )
        it_secrets = VALUE /aws1/cl_ecssecret=>tt_secretlist(
          (
            new /aws1/cl_ecssecret(
              iv_name = |string|
              iv_valuefrom = |string|
            )
          )
        )
        it_systemcontrols = VALUE /aws1/cl_ecssystemcontrol=>tt_systemcontrols(
          (
            new /aws1/cl_ecssystemcontrol(
              iv_namespace = |string|
              iv_value = |string|
            )
          )
        )
        it_ulimits = VALUE /aws1/cl_ecsulimit=>tt_ulimitlist(
          (
            new /aws1/cl_ecsulimit(
              iv_hardlimit = 123
              iv_name = |string|
              iv_softlimit = 123
            )
          )
        )
        it_volumesfrom = VALUE /aws1/cl_ecsvolumefrom=>tt_volumefromlist(
          (
            new /aws1/cl_ecsvolumefrom(
              iv_readonly = ABAP_TRUE
              iv_sourcecontainer = |string|
            )
          )
        )
        iv_cpu = 123
        iv_disablenetworking = ABAP_TRUE
        iv_essential = ABAP_TRUE
        iv_hostname = |string|
        iv_image = |string|
        iv_interactive = ABAP_TRUE
        iv_memory = 123
        iv_memoryreservation = 123
        iv_name = |string|
        iv_privileged = ABAP_TRUE
        iv_pseudoterminal = ABAP_TRUE
        iv_readonlyrootfilesystem = ABAP_TRUE
        iv_starttimeout = 123
        iv_stoptimeout = 123
        iv_user = |string|
        iv_versionconsistency = |string|
        iv_workingdirectory = |string|
      )
    )
  )
  it_inferenceaccelerators = VALUE /aws1/cl_ecsinferenceacceler00=>tt_inferenceaccelerators(
    (
      new /aws1/cl_ecsinferenceacceler00(
        iv_devicename = |string|
        iv_devicetype = |string|
      )
    )
  )
  it_placementconstraints = VALUE /aws1/cl_ecstaskdefplccns=>tt_taskdefnplacementcnstrnts(
    (
      new /aws1/cl_ecstaskdefplccns(
        iv_expression = |string|
        iv_type = |string|
      )
    )
  )
  it_requirescompatibilities = VALUE /aws1/cl_ecscompatibilitylst_w=>tt_compatibilitylist(
    ( new /aws1/cl_ecscompatibilitylst_w( |string| ) )
  )
  it_tags = VALUE /aws1/cl_ecstag=>tt_tags(
    (
      new /aws1/cl_ecstag(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
  it_volumes = VALUE /aws1/cl_ecsvolume=>tt_volumelist(
    (
      new /aws1/cl_ecsvolume(
        io_dockervolumeconfiguration = new /aws1/cl_ecsdockervolumeconf(
          it_driveropts = VALUE /aws1/cl_ecsstringmap_w=>tt_stringmap(
            (
              VALUE /aws1/cl_ecsstringmap_w=>ts_stringmap_maprow(
                value = new /aws1/cl_ecsstringmap_w( |string| )
                key = |string|
              )
            )
          )
          it_labels = VALUE /aws1/cl_ecsstringmap_w=>tt_stringmap(
            (
              VALUE /aws1/cl_ecsstringmap_w=>ts_stringmap_maprow(
                value = new /aws1/cl_ecsstringmap_w( |string| )
                key = |string|
              )
            )
          )
          iv_autoprovision = ABAP_TRUE
          iv_driver = |string|
          iv_scope = |string|
        )
        io_efsvolumeconfiguration = new /aws1/cl_ecsefsvolumeconf(
          io_authorizationconfig = new /aws1/cl_ecsefsauthconfig(
            iv_accesspointid = |string|
            iv_iam = |string|
          )
          iv_filesystemid = |string|
          iv_rootdirectory = |string|
          iv_transitencryption = |string|
          iv_transitencryptionport = 123
        )
        io_fsxwindowsfileservervol00 = new /aws1/cl_ecsfsxwindowsfilese00(
          io_authorizationconfig = new /aws1/cl_ecsfsxwindowsfilese01(
            iv_credentialsparameter = |string|
            iv_domain = |string|
          )
          iv_filesystemid = |string|
          iv_rootdirectory = |string|
        )
        io_host = new /aws1/cl_ecshostvolumeprps( |string| )
        iv_configuredatlaunch = ABAP_TRUE
        iv_name = |string|
      )
    )
  )
  iv_cpu = |string|
  iv_enablefaultinjection = ABAP_TRUE
  iv_executionrolearn = |string|
  iv_family = |string|
  iv_ipcmode = |string|
  iv_memory = |string|
  iv_networkmode = |string|
  iv_pidmode = |string|
  iv_taskrolearn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_taskdefinition = lo_result->get_taskdefinition( ).
  IF lo_taskdefinition IS NOT INITIAL.
    lv_string = lo_taskdefinition->get_taskdefinitionarn( ).
    LOOP AT lo_taskdefinition->get_containerdefinitions( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_string = lo_row_1->get_name( ).
        lv_string = lo_row_1->get_image( ).
        lo_repositorycredentials = lo_row_1->get_repositorycredentials( ).
        IF lo_repositorycredentials IS NOT INITIAL.
          lv_string = lo_repositorycredentials->get_credentialsparameter( ).
        ENDIF.
        lv_integer = lo_row_1->get_cpu( ).
        lv_boxedinteger = lo_row_1->get_memory( ).
        lv_boxedinteger = lo_row_1->get_memoryreservation( ).
        LOOP AT lo_row_1->get_links( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_string = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_portmappings( ) into lo_row_4.
          lo_row_5 = lo_row_4.
          IF lo_row_5 IS NOT INITIAL.
            lv_boxedinteger = lo_row_5->get_containerport( ).
            lv_boxedinteger = lo_row_5->get_hostport( ).
            lv_transportprotocol = lo_row_5->get_protocol( ).
            lv_string = lo_row_5->get_name( ).
            lv_applicationprotocol = lo_row_5->get_appprotocol( ).
            lv_string = lo_row_5->get_containerportrange( ).
          ENDIF.
        ENDLOOP.
        lv_boxedboolean = lo_row_1->get_essential( ).
        lo_containerrestartpolicy = lo_row_1->get_restartpolicy( ).
        IF lo_containerrestartpolicy IS NOT INITIAL.
          lv_boxedboolean = lo_containerrestartpolicy->get_enabled( ).
          LOOP AT lo_containerrestartpolicy->get_ignoredexitcodes( ) into lo_row_6.
            lo_row_7 = lo_row_6.
            IF lo_row_7 IS NOT INITIAL.
              lv_boxedinteger = lo_row_7->get_value( ).
            ENDIF.
          ENDLOOP.
          lv_boxedinteger = lo_containerrestartpolicy->get_restartattemptperiod( ).
        ENDIF.
        LOOP AT lo_row_1->get_entrypoint( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_string = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_command( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_string = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_environment( ) into lo_row_8.
          lo_row_9 = lo_row_8.
          IF lo_row_9 IS NOT INITIAL.
            lv_string = lo_row_9->get_name( ).
            lv_string = lo_row_9->get_value( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_environmentfiles( ) into lo_row_10.
          lo_row_11 = lo_row_10.
          IF lo_row_11 IS NOT INITIAL.
            lv_string = lo_row_11->get_value( ).
            lv_environmentfiletype = lo_row_11->get_type( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_mountpoints( ) into lo_row_12.
          lo_row_13 = lo_row_12.
          IF lo_row_13 IS NOT INITIAL.
            lv_string = lo_row_13->get_sourcevolume( ).
            lv_string = lo_row_13->get_containerpath( ).
            lv_boxedboolean = lo_row_13->get_readonly( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_volumesfrom( ) into lo_row_14.
          lo_row_15 = lo_row_14.
          IF lo_row_15 IS NOT INITIAL.
            lv_string = lo_row_15->get_sourcecontainer( ).
            lv_boxedboolean = lo_row_15->get_readonly( ).
          ENDIF.
        ENDLOOP.
        lo_linuxparameters = lo_row_1->get_linuxparameters( ).
        IF lo_linuxparameters IS NOT INITIAL.
          lo_kernelcapabilities = lo_linuxparameters->get_capabilities( ).
          IF lo_kernelcapabilities IS NOT INITIAL.
            LOOP AT lo_kernelcapabilities->get_add( ) into lo_row_2.
              lo_row_3 = lo_row_2.
              IF lo_row_3 IS NOT INITIAL.
                lv_string = lo_row_3->get_value( ).
              ENDIF.
            ENDLOOP.
            LOOP AT lo_kernelcapabilities->get_drop( ) into lo_row_2.
              lo_row_3 = lo_row_2.
              IF lo_row_3 IS NOT INITIAL.
                lv_string = lo_row_3->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
          LOOP AT lo_linuxparameters->get_devices( ) into lo_row_16.
            lo_row_17 = lo_row_16.
            IF lo_row_17 IS NOT INITIAL.
              lv_string = lo_row_17->get_hostpath( ).
              lv_string = lo_row_17->get_containerpath( ).
              LOOP AT lo_row_17->get_permissions( ) into lo_row_18.
                lo_row_19 = lo_row_18.
                IF lo_row_19 IS NOT INITIAL.
                  lv_devicecgrouppermission = lo_row_19->get_value( ).
                ENDIF.
              ENDLOOP.
            ENDIF.
          ENDLOOP.
          lv_boxedboolean = lo_linuxparameters->get_initprocessenabled( ).
          lv_boxedinteger = lo_linuxparameters->get_sharedmemorysize( ).
          LOOP AT lo_linuxparameters->get_tmpfs( ) into lo_row_20.
            lo_row_21 = lo_row_20.
            IF lo_row_21 IS NOT INITIAL.
              lv_string = lo_row_21->get_containerpath( ).
              lv_integer = lo_row_21->get_size( ).
              LOOP AT lo_row_21->get_mountoptions( ) into lo_row_2.
                lo_row_3 = lo_row_2.
                IF lo_row_3 IS NOT INITIAL.
                  lv_string = lo_row_3->get_value( ).
                ENDIF.
              ENDLOOP.
            ENDIF.
          ENDLOOP.
          lv_boxedinteger = lo_linuxparameters->get_maxswap( ).
          lv_boxedinteger = lo_linuxparameters->get_swappiness( ).
        ENDIF.
        LOOP AT lo_row_1->get_secrets( ) into lo_row_22.
          lo_row_23 = lo_row_22.
          IF lo_row_23 IS NOT INITIAL.
            lv_string = lo_row_23->get_name( ).
            lv_string = lo_row_23->get_valuefrom( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_dependson( ) into lo_row_24.
          lo_row_25 = lo_row_24.
          IF lo_row_25 IS NOT INITIAL.
            lv_string = lo_row_25->get_containername( ).
            lv_containercondition = lo_row_25->get_condition( ).
          ENDIF.
        ENDLOOP.
        lv_boxedinteger = lo_row_1->get_starttimeout( ).
        lv_boxedinteger = lo_row_1->get_stoptimeout( ).
        lv_versionconsistency = lo_row_1->get_versionconsistency( ).
        lv_string = lo_row_1->get_hostname( ).
        lv_string = lo_row_1->get_user( ).
        lv_string = lo_row_1->get_workingdirectory( ).
        lv_boxedboolean = lo_row_1->get_disablenetworking( ).
        lv_boxedboolean = lo_row_1->get_privileged( ).
        lv_boxedboolean = lo_row_1->get_readonlyrootfilesystem( ).
        LOOP AT lo_row_1->get_dnsservers( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_string = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_dnssearchdomains( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_string = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_extrahosts( ) into lo_row_26.
          lo_row_27 = lo_row_26.
          IF lo_row_27 IS NOT INITIAL.
            lv_string = lo_row_27->get_hostname( ).
            lv_string = lo_row_27->get_ipaddress( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_dockersecurityoptions( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_string = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
        lv_boxedboolean = lo_row_1->get_interactive( ).
        lv_boxedboolean = lo_row_1->get_pseudoterminal( ).
        LOOP AT lo_row_1->get_dockerlabels( ) into ls_row_28.
          lv_key = ls_row_28-key.
          lo_value = ls_row_28-value.
          IF lo_value IS NOT INITIAL.
            lv_string = lo_value->get_value( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_ulimits( ) into lo_row_29.
          lo_row_30 = lo_row_29.
          IF lo_row_30 IS NOT INITIAL.
            lv_ulimitname = lo_row_30->get_name( ).
            lv_integer = lo_row_30->get_softlimit( ).
            lv_integer = lo_row_30->get_hardlimit( ).
          ENDIF.
        ENDLOOP.
        lo_logconfiguration = lo_row_1->get_logconfiguration( ).
        IF lo_logconfiguration IS NOT INITIAL.
          lv_logdriver = lo_logconfiguration->get_logdriver( ).
          LOOP AT lo_logconfiguration->get_options( ) into ls_row_31.
            lv_key = ls_row_31-key.
            lo_value_1 = ls_row_31-value.
            IF lo_value_1 IS NOT INITIAL.
              lv_string = lo_value_1->get_value( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_logconfiguration->get_secretoptions( ) into lo_row_22.
            lo_row_23 = lo_row_22.
            IF lo_row_23 IS NOT INITIAL.
              lv_string = lo_row_23->get_name( ).
              lv_string = lo_row_23->get_valuefrom( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
        lo_healthcheck = lo_row_1->get_healthcheck( ).
        IF lo_healthcheck IS NOT INITIAL.
          LOOP AT lo_healthcheck->get_command( ) into lo_row_2.
            lo_row_3 = lo_row_2.
            IF lo_row_3 IS NOT INITIAL.
              lv_string = lo_row_3->get_value( ).
            ENDIF.
          ENDLOOP.
          lv_boxedinteger = lo_healthcheck->get_interval( ).
          lv_boxedinteger = lo_healthcheck->get_timeout( ).
          lv_boxedinteger = lo_healthcheck->get_retries( ).
          lv_boxedinteger = lo_healthcheck->get_startperiod( ).
        ENDIF.
        LOOP AT lo_row_1->get_systemcontrols( ) into lo_row_32.
          lo_row_33 = lo_row_32.
          IF lo_row_33 IS NOT INITIAL.
            lv_string = lo_row_33->get_namespace( ).
            lv_string = lo_row_33->get_value( ).
          ENDIF.
        ENDLOOP.
        LOOP AT lo_row_1->get_resourcerequirements( ) into lo_row_34.
          lo_row_35 = lo_row_34.
          IF lo_row_35 IS NOT INITIAL.
            lv_string = lo_row_35->get_value( ).
            lv_resourcetype = lo_row_35->get_type( ).
          ENDIF.
        ENDLOOP.
        lo_firelensconfiguration = lo_row_1->get_firelensconfiguration( ).
        IF lo_firelensconfiguration IS NOT INITIAL.
          lv_firelensconfigurationty = lo_firelensconfiguration->get_type( ).
          LOOP AT lo_firelensconfiguration->get_options( ) into ls_row_36.
            lv_key = ls_row_36-key.
            lo_value_2 = ls_row_36-value.
            IF lo_value_2 IS NOT INITIAL.
              lv_string = lo_value_2->get_value( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
        LOOP AT lo_row_1->get_credentialspecs( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_string = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    lv_string = lo_taskdefinition->get_family( ).
    lv_string = lo_taskdefinition->get_taskrolearn( ).
    lv_string = lo_taskdefinition->get_executionrolearn( ).
    lv_networkmode = lo_taskdefinition->get_networkmode( ).
    lv_integer = lo_taskdefinition->get_revision( ).
    LOOP AT lo_taskdefinition->get_volumes( ) into lo_row_37.
      lo_row_38 = lo_row_37.
      IF lo_row_38 IS NOT INITIAL.
        lv_string = lo_row_38->get_name( ).
        lo_hostvolumeproperties = lo_row_38->get_host( ).
        IF lo_hostvolumeproperties IS NOT INITIAL.
          lv_string = lo_hostvolumeproperties->get_sourcepath( ).
        ENDIF.
        lo_dockervolumeconfigurati = lo_row_38->get_dockervolumeconf( ).
        IF lo_dockervolumeconfigurati IS NOT INITIAL.
          lv_scope = lo_dockervolumeconfigurati->get_scope( ).
          lv_boxedboolean = lo_dockervolumeconfigurati->get_autoprovision( ).
          lv_string = lo_dockervolumeconfigurati->get_driver( ).
          LOOP AT lo_dockervolumeconfigurati->get_driveropts( ) into ls_row_39.
            lv_key = ls_row_39-key.
            lo_value_3 = ls_row_39-value.
            IF lo_value_3 IS NOT INITIAL.
              lv_string = lo_value_3->get_value( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_dockervolumeconfigurati->get_labels( ) into ls_row_39.
            lv_key = ls_row_39-key.
            lo_value_3 = ls_row_39-value.
            IF lo_value_3 IS NOT INITIAL.
              lv_string = lo_value_3->get_value( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
        lo_efsvolumeconfiguration = lo_row_38->get_efsvolumeconfiguration( ).
        IF lo_efsvolumeconfiguration IS NOT INITIAL.
          lv_string = lo_efsvolumeconfiguration->get_filesystemid( ).
          lv_string = lo_efsvolumeconfiguration->get_rootdirectory( ).
          lv_efstransitencryption = lo_efsvolumeconfiguration->get_transitencryption( ).
          lv_boxedinteger = lo_efsvolumeconfiguration->get_transitencryptionport( ).
          lo_efsauthorizationconfig = lo_efsvolumeconfiguration->get_authorizationconfig( ).
          IF lo_efsauthorizationconfig IS NOT INITIAL.
            lv_string = lo_efsauthorizationconfig->get_accesspointid( ).
            lv_efsauthorizationconfigi = lo_efsauthorizationconfig->get_iam( ).
          ENDIF.
        ENDIF.
        lo_fsxwindowsfileservervol = lo_row_38->get_fsxwindowsfileservervo00( ).
        IF lo_fsxwindowsfileservervol IS NOT INITIAL.
          lv_string = lo_fsxwindowsfileservervol->get_filesystemid( ).
          lv_string = lo_fsxwindowsfileservervol->get_rootdirectory( ).
          lo_fsxwindowsfileserveraut = lo_fsxwindowsfileservervol->get_authorizationconfig( ).
          IF lo_fsxwindowsfileserveraut IS NOT INITIAL.
            lv_string = lo_fsxwindowsfileserveraut->get_credentialsparameter( ).
            lv_string = lo_fsxwindowsfileserveraut->get_domain( ).
          ENDIF.
        ENDIF.
        lv_boxedboolean = lo_row_38->get_configuredatlaunch( ).
      ENDIF.
    ENDLOOP.
    lv_taskdefinitionstatus = lo_taskdefinition->get_status( ).
    LOOP AT lo_taskdefinition->get_requiresattributes( ) into lo_row_40.
      lo_row_41 = lo_row_40.
      IF lo_row_41 IS NOT INITIAL.
        lv_string = lo_row_41->get_name( ).
        lv_string = lo_row_41->get_value( ).
        lv_targettype = lo_row_41->get_targettype( ).
        lv_string = lo_row_41->get_targetid( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_taskdefinition->get_placementconstraints( ) into lo_row_42.
      lo_row_43 = lo_row_42.
      IF lo_row_43 IS NOT INITIAL.
        lv_taskdefinitionplacement = lo_row_43->get_type( ).
        lv_string = lo_row_43->get_expression( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_taskdefinition->get_compatibilities( ) into lo_row_44.
      lo_row_45 = lo_row_44.
      IF lo_row_45 IS NOT INITIAL.
        lv_compatibility = lo_row_45->get_value( ).
      ENDIF.
    ENDLOOP.
    lo_runtimeplatform = lo_taskdefinition->get_runtimeplatform( ).
    IF lo_runtimeplatform IS NOT INITIAL.
      lv_cpuarchitecture = lo_runtimeplatform->get_cpuarchitecture( ).
      lv_osfamily = lo_runtimeplatform->get_operatingsystemfamily( ).
    ENDIF.
    LOOP AT lo_taskdefinition->get_requirescompatibilities( ) into lo_row_44.
      lo_row_45 = lo_row_44.
      IF lo_row_45 IS NOT INITIAL.
        lv_compatibility = lo_row_45->get_value( ).
      ENDIF.
    ENDLOOP.
    lv_string = lo_taskdefinition->get_cpu( ).
    lv_string = lo_taskdefinition->get_memory( ).
    LOOP AT lo_taskdefinition->get_inferenceaccelerators( ) into lo_row_46.
      lo_row_47 = lo_row_46.
      IF lo_row_47 IS NOT INITIAL.
        lv_string = lo_row_47->get_devicename( ).
        lv_string = lo_row_47->get_devicetype( ).
      ENDIF.
    ENDLOOP.
    lv_pidmode = lo_taskdefinition->get_pidmode( ).
    lv_ipcmode = lo_taskdefinition->get_ipcmode( ).
    lo_proxyconfiguration = lo_taskdefinition->get_proxyconfiguration( ).
    IF lo_proxyconfiguration IS NOT INITIAL.
      lv_proxyconfigurationtype = lo_proxyconfiguration->get_type( ).
      lv_string = lo_proxyconfiguration->get_containername( ).
      LOOP AT lo_proxyconfiguration->get_properties( ) into lo_row_8.
        lo_row_9 = lo_row_8.
        IF lo_row_9 IS NOT INITIAL.
          lv_string = lo_row_9->get_name( ).
          lv_string = lo_row_9->get_value( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
    lv_timestamp = lo_taskdefinition->get_registeredat( ).
    lv_timestamp = lo_taskdefinition->get_deregisteredat( ).
    lv_string = lo_taskdefinition->get_registeredby( ).
    lo_ephemeralstorage = lo_taskdefinition->get_ephemeralstorage( ).
    IF lo_ephemeralstorage IS NOT INITIAL.
      lv_integer = lo_ephemeralstorage->get_sizeingib( ).
    ENDIF.
    lv_boxedboolean = lo_taskdefinition->get_enablefaultinjection( ).
  ENDIF.
  LOOP AT lo_result->get_tags( ) into lo_row_48.
    lo_row_49 = lo_row_48.
    IF lo_row_49 IS NOT INITIAL.
      lv_tagkey = lo_row_49->get_key( ).
      lv_tagvalue = lo_row_49->get_value( ).
    ENDIF.
  ENDLOOP.
ENDIF.

To register a task definition

This example registers a task definition to the specified family.

DATA(lo_result) = lo_client->registertaskdefinition(
  it_containerdefinitions = VALUE /aws1/cl_ecscontainerdefn=>tt_containerdefinitions(
    (
      new /aws1/cl_ecscontainerdefn(
        it_command = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
          ( new /aws1/cl_ecsstringlist_w( |sleep| ) )
          ( new /aws1/cl_ecsstringlist_w( |360| ) )
        )
        iv_cpu = 10
        iv_essential = ABAP_TRUE
        iv_image = |public.ecr.aws/docker/library/busybox:latest|
        iv_memory = 10
        iv_name = |sleep|
      )
    )
  )
  it_volumes = VALUE /aws1/cl_ecsvolume=>tt_volumelist(
  )
  iv_family = |sleep360|
  iv_taskrolearn = ||
).