/AWS1/IF_ECS=>CREATECAPACITYPROVIDER()¶
About CreateCapacityProvider¶
Creates a capacity provider. Capacity providers are associated with a cluster and are
used in capacity provider strategies to facilitate cluster auto scaling. You can create
capacity providers for Amazon ECS Managed Instances and EC2 instances. Fargate has the
predefined FARGATE and FARGATE_SPOT capacity providers.
Method Signature¶
METHODS /AWS1/IF_ECS~CREATECAPACITYPROVIDER
  IMPORTING
    !IV_NAME TYPE /AWS1/ECSSTRING OPTIONAL
    !IV_CLUSTER TYPE /AWS1/ECSSTRING OPTIONAL
    !IO_AUTOSCALINGGROUPPROVIDER TYPE REF TO /AWS1/CL_ECSAUTOSCGROUPPVDR OPTIONAL
    !IO_MANAGEDINSTANCESPROVIDER TYPE REF TO /AWS1/CL_ECSCREMANAGEDINSPVD00 OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_ECSTAG=>TT_TAGS OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ecscreatecappvdrrsp
  RAISING
    /AWS1/CX_ECSCLIENTEXCEPTION
    /AWS1/CX_ECSCLUSTERNOTFOUNDEX
    /AWS1/CX_ECSINVALIDPARAMETEREX
    /AWS1/CX_ECSLIMITEXCEEDEDEX
    /AWS1/CX_ECSSERVEREXCEPTION
    /AWS1/CX_ECSUNSUPPEDFEATUREEX
    /AWS1/CX_ECSUPDATEINPROGRESSEX
    /AWS1/CX_ECSCLIENTEXC
    /AWS1/CX_ECSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_name TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING¶
The name of the capacity provider. Up to 255 characters are allowed. They include letters (both upper and lowercase letters), numbers, underscores (_), and hyphens (-). The name can't be prefixed with "
aws", "ecs", or "fargate".
Optional arguments:¶
iv_cluster TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING¶
The name of the cluster to associate with the capacity provider. When you create a capacity provider with Amazon ECS Managed Instances, it becomes available only within the specified cluster.
io_autoscalinggroupprovider TYPE REF TO /AWS1/CL_ECSAUTOSCGROUPPVDR /AWS1/CL_ECSAUTOSCGROUPPVDR¶
The details of the Auto Scaling group for the capacity provider.
io_managedinstancesprovider TYPE REF TO /AWS1/CL_ECSCREMANAGEDINSPVD00 /AWS1/CL_ECSCREMANAGEDINSPVD00¶
The configuration for the Amazon ECS Managed Instances provider. This configuration specifies how Amazon ECS manages Amazon EC2 instances on your behalf, including the infrastructure role, instance launch template, and tag propagation settings.
it_tags TYPE /AWS1/CL_ECSTAG=>TT_TAGS TT_TAGS¶
The metadata that you apply to the capacity provider to categorize and organize them more conveniently. 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.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_ecscreatecappvdrrsp /AWS1/CL_ECSCREATECAPPVDRRSP¶
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->createcapacityprovider(
  io_autoscalinggroupprovider = new /aws1/cl_ecsautoscgrouppvdr(
    io_managedscaling = new /aws1/cl_ecsmanagedscaling(
      iv_instancewarmupperiod = 123
      iv_maximumscalingstepsize = 123
      iv_minimumscalingstepsize = 123
      iv_status = |string|
      iv_targetcapacity = 123
    )
    iv_autoscalinggrouparn = |string|
    iv_manageddraining = |string|
    iv_managedterminationprote00 = |string|
  )
  io_managedinstancesprovider = new /aws1/cl_ecscremanagedinspvd00(
    io_instancelaunchtemplate = new /aws1/cl_ecsinstancelaunchtmpl(
      io_instancerequirements = new /aws1/cl_ecsinstreqsrequest(
        io_acceleratorcount = new /aws1/cl_ecsacceleratorcntreq(
          iv_max = 123
          iv_min = 123
        )
        io_acceleratortotalmemorymib = new /aws1/cl_ecsacceleratortotal00(
          iv_max = 123
          iv_min = 123
        )
        io_baselineebsbandwidthmbps = new /aws1/cl_ecsbaselineebsbandw00(
          iv_max = 123
          iv_min = 123
        )
        io_memorygibpervcpu = new /aws1/cl_ecsmemgibpervcpureq(
          iv_max = '0.1'
          iv_min = '0.1'
        )
        io_memorymib = new /aws1/cl_ecsmemorymibrequest(
          iv_max = 123
          iv_min = 123
        )
        io_networkbandwidthgbps = new /aws1/cl_ecsnetbandwidthgbps00(
          iv_max = '0.1'
          iv_min = '0.1'
        )
        io_networkinterfacecount = new /aws1/cl_ecsnetifacecountreq(
          iv_max = 123
          iv_min = 123
        )
        io_totallocalstoragegb = new /aws1/cl_ecstotallocalstrggb00(
          iv_max = '0.1'
          iv_min = '0.1'
        )
        io_vcpucount = new /aws1/cl_ecsvcpucountrangereq(
          iv_max = 123
          iv_min = 123
        )
        it_acceleratormanufacturers = VALUE /aws1/cl_ecsacceleratormanuf00=>tt_acceleratormanufacturerset(
          ( new /aws1/cl_ecsacceleratormanuf00( |string| ) )
        )
        it_acceleratornames = VALUE /aws1/cl_ecsacceleratornames00=>tt_acceleratornameset(
          ( new /aws1/cl_ecsacceleratornames00( |string| ) )
        )
        it_acceleratortypes = VALUE /aws1/cl_ecsacceleratortypes00=>tt_acceleratortypeset(
          ( new /aws1/cl_ecsacceleratortypes00( |string| ) )
        )
        it_allowedinstancetypes = VALUE /aws1/cl_ecsalwdinsttypeset_w=>tt_allowedinstancetypeset(
          ( new /aws1/cl_ecsalwdinsttypeset_w( |string| ) )
        )
        it_cpumanufacturers = VALUE /aws1/cl_ecscpumanufacturers00=>tt_cpumanufacturerset(
          ( new /aws1/cl_ecscpumanufacturers00( |string| ) )
        )
        it_excludedinstancetypes = VALUE /aws1/cl_ecsexcludedinsttype00=>tt_excludedinstancetypeset(
          ( new /aws1/cl_ecsexcludedinsttype00( |string| ) )
        )
        it_instancegenerations = VALUE /aws1/cl_ecsinstgenerationse00=>tt_instancegenerationset(
          ( new /aws1/cl_ecsinstgenerationse00( |string| ) )
        )
        it_localstoragetypes = VALUE /aws1/cl_ecslocalstrgtypeset_w=>tt_localstoragetypeset(
          ( new /aws1/cl_ecslocalstrgtypeset_w( |string| ) )
        )
        iv_baremetal = |string|
        iv_burstableperformance = |string|
        iv_localstorage = |string|
        iv_maxspotpriceaspercageof00 = 123
        iv_ondemmaxpricepercageove00 = 123
        iv_requirehibernatesupport = ABAP_TRUE
        iv_spotmaxpricepercageover00 = 123
      )
      io_networkconfiguration = new /aws1/cl_ecsmanagedinsnetconf(
        it_securitygroups = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
          ( new /aws1/cl_ecsstringlist_w( |string| ) )
        )
        it_subnets = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
          ( new /aws1/cl_ecsstringlist_w( |string| ) )
        )
      )
      io_storageconfiguration = new /aws1/cl_ecsmanagedinsstrgconf( 123 )
      iv_ec2instanceprofilearn = |string|
      iv_monitoring = |string|
    )
    iv_infrastructurerolearn = |string|
    iv_propagatetags = |string|
  )
  it_tags = VALUE /aws1/cl_ecstag=>tt_tags(
    (
      new /aws1/cl_ecstag(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
  iv_cluster = |string|
  iv_name = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_capacityprovider = lo_result->get_capacityprovider( ).
  IF lo_capacityprovider IS NOT INITIAL.
    lv_string = lo_capacityprovider->get_capacityproviderarn( ).
    lv_string = lo_capacityprovider->get_name( ).
    lv_string = lo_capacityprovider->get_cluster( ).
    lv_capacityproviderstatus = lo_capacityprovider->get_status( ).
    lo_autoscalinggroupprovide = lo_capacityprovider->get_autoscalinggroupprovider( ).
    IF lo_autoscalinggroupprovide IS NOT INITIAL.
      lv_string = lo_autoscalinggroupprovide->get_autoscalinggrouparn( ).
      lo_managedscaling = lo_autoscalinggroupprovide->get_managedscaling( ).
      IF lo_managedscaling IS NOT INITIAL.
        lv_managedscalingstatus = lo_managedscaling->get_status( ).
        lv_managedscalingtargetcap = lo_managedscaling->get_targetcapacity( ).
        lv_managedscalingstepsize = lo_managedscaling->get_minimumscalingstepsize( ).
        lv_managedscalingstepsize = lo_managedscaling->get_maximumscalingstepsize( ).
        lv_managedscalinginstancew = lo_managedscaling->get_instancewarmupperiod( ).
      ENDIF.
      lv_managedterminationprote = lo_autoscalinggroupprovide->get_managedterminationprot00( ).
      lv_manageddraining = lo_autoscalinggroupprovide->get_manageddraining( ).
    ENDIF.
    lo_managedinstancesprovide = lo_capacityprovider->get_managedinstancesprovider( ).
    IF lo_managedinstancesprovide IS NOT INITIAL.
      lv_string = lo_managedinstancesprovide->get_infrastructurerolearn( ).
      lo_instancelaunchtemplate = lo_managedinstancesprovide->get_instancelaunchtemplate( ).
      IF lo_instancelaunchtemplate IS NOT INITIAL.
        lv_string = lo_instancelaunchtemplate->get_ec2instanceprofilearn( ).
        lo_managedinstancesnetwork = lo_instancelaunchtemplate->get_networkconfiguration( ).
        IF lo_managedinstancesnetwork IS NOT INITIAL.
          LOOP AT lo_managedinstancesnetwork->get_subnets( ) into lo_row.
            lo_row_1 = lo_row.
            IF lo_row_1 IS NOT INITIAL.
              lv_string = lo_row_1->get_value( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_managedinstancesnetwork->get_securitygroups( ) into lo_row.
            lo_row_1 = lo_row.
            IF lo_row_1 IS NOT INITIAL.
              lv_string = lo_row_1->get_value( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
        lo_managedinstancesstorage = lo_instancelaunchtemplate->get_storageconfiguration( ).
        IF lo_managedinstancesstorage IS NOT INITIAL.
          lv_taskvolumestoragegib = lo_managedinstancesstorage->get_storagesizegib( ).
        ENDIF.
        lv_managedinstancesmonitor = lo_instancelaunchtemplate->get_monitoring( ).
        lo_instancerequirementsreq = lo_instancelaunchtemplate->get_instancerequirements( ).
        IF lo_instancerequirementsreq IS NOT INITIAL.
          lo_vcpucountrangerequest = lo_instancerequirementsreq->get_vcpucount( ).
          IF lo_vcpucountrangerequest IS NOT INITIAL.
            lv_boxedinteger = lo_vcpucountrangerequest->get_min( ).
            lv_boxedinteger = lo_vcpucountrangerequest->get_max( ).
          ENDIF.
          lo_memorymibrequest = lo_instancerequirementsreq->get_memorymib( ).
          IF lo_memorymibrequest IS NOT INITIAL.
            lv_boxedinteger = lo_memorymibrequest->get_min( ).
            lv_boxedinteger = lo_memorymibrequest->get_max( ).
          ENDIF.
          LOOP AT lo_instancerequirementsreq->get_cpumanufacturers( ) into lo_row_2.
            lo_row_3 = lo_row_2.
            IF lo_row_3 IS NOT INITIAL.
              lv_cpumanufacturer = lo_row_3->get_value( ).
            ENDIF.
          ENDLOOP.
          lo_memorygibpervcpurequest = lo_instancerequirementsreq->get_memorygibpervcpu( ).
          IF lo_memorygibpervcpurequest IS NOT INITIAL.
            lv_boxeddouble = lo_memorygibpervcpurequest->get_min( ).
            lv_boxeddouble = lo_memorygibpervcpurequest->get_max( ).
          ENDIF.
          LOOP AT lo_instancerequirementsreq->get_excludedinstancetypes( ) into lo_row_4.
            lo_row_5 = lo_row_4.
            IF lo_row_5 IS NOT INITIAL.
              lv_excludedinstancetype = lo_row_5->get_value( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_instancerequirementsreq->get_instancegenerations( ) into lo_row_6.
            lo_row_7 = lo_row_6.
            IF lo_row_7 IS NOT INITIAL.
              lv_instancegeneration = lo_row_7->get_value( ).
            ENDIF.
          ENDLOOP.
          lv_boxedinteger = lo_instancerequirementsreq->get_spotmaxpricepercageove00( ).
          lv_boxedinteger = lo_instancerequirementsreq->get_ondemmaxpricepercageov00( ).
          lv_baremetal = lo_instancerequirementsreq->get_baremetal( ).
          lv_burstableperformance = lo_instancerequirementsreq->get_burstableperformance( ).
          lv_boxedboolean = lo_instancerequirementsreq->get_requirehibernatesupport( ).
          lo_networkinterfacecountre = lo_instancerequirementsreq->get_networkinterfacecount( ).
          IF lo_networkinterfacecountre IS NOT INITIAL.
            lv_boxedinteger = lo_networkinterfacecountre->get_min( ).
            lv_boxedinteger = lo_networkinterfacecountre->get_max( ).
          ENDIF.
          lv_localstorage = lo_instancerequirementsreq->get_localstorage( ).
          LOOP AT lo_instancerequirementsreq->get_localstoragetypes( ) into lo_row_8.
            lo_row_9 = lo_row_8.
            IF lo_row_9 IS NOT INITIAL.
              lv_localstoragetype = lo_row_9->get_value( ).
            ENDIF.
          ENDLOOP.
          lo_totallocalstoragegbrequ = lo_instancerequirementsreq->get_totallocalstoragegb( ).
          IF lo_totallocalstoragegbrequ IS NOT INITIAL.
            lv_boxeddouble = lo_totallocalstoragegbrequ->get_min( ).
            lv_boxeddouble = lo_totallocalstoragegbrequ->get_max( ).
          ENDIF.
          lo_baselineebsbandwidthmbp = lo_instancerequirementsreq->get_baselineebsbandwidthmbps( ).
          IF lo_baselineebsbandwidthmbp IS NOT INITIAL.
            lv_boxedinteger = lo_baselineebsbandwidthmbp->get_min( ).
            lv_boxedinteger = lo_baselineebsbandwidthmbp->get_max( ).
          ENDIF.
          LOOP AT lo_instancerequirementsreq->get_acceleratortypes( ) into lo_row_10.
            lo_row_11 = lo_row_10.
            IF lo_row_11 IS NOT INITIAL.
              lv_acceleratortype = lo_row_11->get_value( ).
            ENDIF.
          ENDLOOP.
          lo_acceleratorcountrequest = lo_instancerequirementsreq->get_acceleratorcount( ).
          IF lo_acceleratorcountrequest IS NOT INITIAL.
            lv_boxedinteger = lo_acceleratorcountrequest->get_min( ).
            lv_boxedinteger = lo_acceleratorcountrequest->get_max( ).
          ENDIF.
          LOOP AT lo_instancerequirementsreq->get_acceleratormanufacturers( ) into lo_row_12.
            lo_row_13 = lo_row_12.
            IF lo_row_13 IS NOT INITIAL.
              lv_acceleratormanufacturer = lo_row_13->get_value( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_instancerequirementsreq->get_acceleratornames( ) into lo_row_14.
            lo_row_15 = lo_row_14.
            IF lo_row_15 IS NOT INITIAL.
              lv_acceleratorname = lo_row_15->get_value( ).
            ENDIF.
          ENDLOOP.
          lo_acceleratortotalmemorym = lo_instancerequirementsreq->get_acceleratortotalmemmib( ).
          IF lo_acceleratortotalmemorym IS NOT INITIAL.
            lv_boxedinteger = lo_acceleratortotalmemorym->get_min( ).
            lv_boxedinteger = lo_acceleratortotalmemorym->get_max( ).
          ENDIF.
          lo_networkbandwidthgbpsreq = lo_instancerequirementsreq->get_networkbandwidthgbps( ).
          IF lo_networkbandwidthgbpsreq IS NOT INITIAL.
            lv_boxeddouble = lo_networkbandwidthgbpsreq->get_min( ).
            lv_boxeddouble = lo_networkbandwidthgbpsreq->get_max( ).
          ENDIF.
          LOOP AT lo_instancerequirementsreq->get_allowedinstancetypes( ) into lo_row_16.
            lo_row_17 = lo_row_16.
            IF lo_row_17 IS NOT INITIAL.
              lv_allowedinstancetype = lo_row_17->get_value( ).
            ENDIF.
          ENDLOOP.
          lv_boxedinteger = lo_instancerequirementsreq->get_maxspotpriceaspercageo00( ).
        ENDIF.
      ENDIF.
      lv_propagatemitags = lo_managedinstancesprovide->get_propagatetags( ).
    ENDIF.
    lv_capacityproviderupdates = lo_capacityprovider->get_updatestatus( ).
    lv_string = lo_capacityprovider->get_updatestatusreason( ).
    LOOP AT lo_capacityprovider->get_tags( ) into lo_row_18.
      lo_row_19 = lo_row_18.
      IF lo_row_19 IS NOT INITIAL.
        lv_tagkey = lo_row_19->get_key( ).
        lv_tagvalue = lo_row_19->get_value( ).
      ENDIF.
    ENDLOOP.
    lv_capacityprovidertype = lo_capacityprovider->get_type( ).
  ENDIF.
ENDIF.
To create a capacity provider¶
This example creates a capacity provider that uses the specified Auto Scaling group MyASG and has managed scaling and manager termination protection enabled.
DATA(lo_result) = lo_client->createcapacityprovider(
  io_autoscalinggroupprovider = new /aws1/cl_ecsautoscgrouppvdr(
    io_managedscaling = new /aws1/cl_ecsmanagedscaling(
      iv_status = |ENABLED|
      iv_targetcapacity = 100
    )
    iv_autoscalinggrouparn = |arn:aws:autoscaling:us-east-1:123456789012:autoScalingGroup:57ffcb94-11f0-4d6d-bf60-3bac5EXAMPLE:autoScalingGroupName/MyASG|
    iv_managedterminationprote00 = |ENABLED|
  )
  iv_name = |MyCapacityProvider|
).