Skip to content

/AWS1/IF_ECS=>DEREGISTERTASKDEFINITION()

About DeregisterTaskDefinition

Deregisters the specified task definition by family and revision. Upon deregistration, the task definition is marked as INACTIVE. Existing tasks and services that reference an INACTIVE task definition continue to run without disruption. Existing services that reference an INACTIVE task definition can still scale up or down by modifying the service's desired count. If you want to delete a task definition revision, you must first deregister the task definition revision.

You can't use an INACTIVE task definition to run new tasks or create new services, and you can't update an existing service to reference an INACTIVE task definition. However, there may be up to a 10-minute window following deregistration where these restrictions have not yet taken effect.

At this time, INACTIVE task definitions remain discoverable in your account indefinitely. However, this behavior is subject to change in the future. We don't recommend that you rely on INACTIVE task definitions persisting beyond the lifecycle of any associated tasks and services.

You must deregister a task definition revision before you delete it. For more information, see DeleteTaskDefinitions.

Method Signature

METHODS /AWS1/IF_ECS~DEREGISTERTASKDEFINITION
  IMPORTING
    !IV_TASKDEFINITION TYPE /AWS1/ECSSTRING OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ecsderegtaskdefnrsp
  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_taskdefinition TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING

The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition to deregister. You must specify a revision.

RETURNING

oo_output TYPE REF TO /aws1/cl_ecsderegtaskdefnrsp /AWS1/CL_ECSDEREGTASKDEFNRSP

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->deregistertaskdefinition( |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.
ENDIF.

To deregister a revision of a task definition

This example deregisters the first revision of the fargate-task task definition

DATA(lo_result) = lo_client->deregistertaskdefinition( |fargate-task:1| ).