Skip to content

/AWS1/IF_LMD=>CREATECAPACITYPROVIDER()

About CreateCapacityProvider

Creates a capacity provider that manages compute resources for Lambda functions

Method Signature

METHODS /AWS1/IF_LMD~CREATECAPACITYPROVIDER
  IMPORTING
    !IV_CAPACITYPROVIDERNAME TYPE /AWS1/LMDCAPACITYPROVIDERNAME OPTIONAL
    !IO_VPCCONFIG TYPE REF TO /AWS1/CL_LMDCAPPVDRVPCCONFIG OPTIONAL
    !IO_PERMISSIONSCONFIG TYPE REF TO /AWS1/CL_LMDCAPPVDRPERMSCONFIG OPTIONAL
    !IO_INSTANCEREQUIREMENTS TYPE REF TO /AWS1/CL_LMDINSTANCEREQS OPTIONAL
    !IO_CAPACITYPVDRSCALINGCONFIG TYPE REF TO /AWS1/CL_LMDCAPPVDRSCACONFIG OPTIONAL
    !IV_KMSKEYARN TYPE /AWS1/LMDKMSKEYARNNONEMPTY OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_LMDTAGS_W=>TT_TAGS OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_lmdcreatecappvdrrsp
  RAISING
    /AWS1/CX_LMDCAPPVDRLIMITEXCDEX
    /AWS1/CX_LMDINVPARAMVALUEEX
    /AWS1/CX_LMDRESOURCECONFLICTEX
    /AWS1/CX_LMDSERVICEEXCEPTION
    /AWS1/CX_LMDTOOMANYREQUESTSEX
    /AWS1/CX_LMDCLIENTEXC
    /AWS1/CX_LMDSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_capacityprovidername TYPE /AWS1/LMDCAPACITYPROVIDERNAME /AWS1/LMDCAPACITYPROVIDERNAME

The name of the capacity provider.

io_vpcconfig TYPE REF TO /AWS1/CL_LMDCAPPVDRVPCCONFIG /AWS1/CL_LMDCAPPVDRVPCCONFIG

The VPC configuration for the capacity provider, including subnet IDs and security group IDs where compute instances will be launched.

io_permissionsconfig TYPE REF TO /AWS1/CL_LMDCAPPVDRPERMSCONFIG /AWS1/CL_LMDCAPPVDRPERMSCONFIG

The permissions configuration that specifies the IAM role ARN used by the capacity provider to manage compute resources.

Optional arguments:

io_instancerequirements TYPE REF TO /AWS1/CL_LMDINSTANCEREQS /AWS1/CL_LMDINSTANCEREQS

The instance requirements that specify the compute instance characteristics, including architectures and allowed or excluded instance types.

io_capacitypvdrscalingconfig TYPE REF TO /AWS1/CL_LMDCAPPVDRSCACONFIG /AWS1/CL_LMDCAPPVDRSCACONFIG

The scaling configuration that defines how the capacity provider scales compute instances, including maximum vCPU count and scaling policies.

iv_kmskeyarn TYPE /AWS1/LMDKMSKEYARNNONEMPTY /AWS1/LMDKMSKEYARNNONEMPTY

The ARN of the KMS key used to encrypt data associated with the capacity provider.

it_tags TYPE /AWS1/CL_LMDTAGS_W=>TT_TAGS TT_TAGS

A list of tags to associate with the capacity provider.

RETURNING

oo_output TYPE REF TO /aws1/cl_lmdcreatecappvdrrsp /AWS1/CL_LMDCREATECAPPVDRRSP

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_capacitypvdrscalingconfig = new /aws1/cl_lmdcappvdrscaconfig(
    it_scalingpolicies = VALUE /aws1/cl_lmdtargettrkscapolicy=>tt_capacitypvdrscalingpollist(
      (
        new /aws1/cl_lmdtargettrkscapolicy(
          iv_predefinedmetrictype = |string|
          iv_targetvalue = '0.1'
        )
      )
    )
    iv_maxvcpucount = 123
    iv_scalingmode = |string|
  )
  io_instancerequirements = new /aws1/cl_lmdinstancereqs(
    it_allowedinstancetypes = VALUE /aws1/cl_lmdinstancetypeset_w=>tt_instancetypeset(
      ( new /aws1/cl_lmdinstancetypeset_w( |string| ) )
    )
    it_architectures = VALUE /aws1/cl_lmdarchitectureslst_w=>tt_architectureslist(
      ( new /aws1/cl_lmdarchitectureslst_w( |string| ) )
    )
    it_excludedinstancetypes = VALUE /aws1/cl_lmdinstancetypeset_w=>tt_instancetypeset(
      ( new /aws1/cl_lmdinstancetypeset_w( |string| ) )
    )
  )
  io_permissionsconfig = new /aws1/cl_lmdcappvdrpermsconfig( |string| )
  io_vpcconfig = new /aws1/cl_lmdcappvdrvpcconfig(
    it_securitygroupids = VALUE /aws1/cl_lmdcappvdrsecgrpids_w=>tt_cappvdrsecuritygroupids(
      ( new /aws1/cl_lmdcappvdrsecgrpids_w( |string| ) )
    )
    it_subnetids = VALUE /aws1/cl_lmdcappvdrsubnetids_w=>tt_capacityprovidersubnetids(
      ( new /aws1/cl_lmdcappvdrsubnetids_w( |string| ) )
    )
  )
  it_tags = VALUE /aws1/cl_lmdtags_w=>tt_tags(
    (
      VALUE /aws1/cl_lmdtags_w=>ts_tags_maprow(
        value = new /aws1/cl_lmdtags_w( |string| )
        key = |string|
      )
    )
  )
  iv_capacityprovidername = |string|
  iv_kmskeyarn = |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_capacityproviderarn = lo_capacityprovider->get_capacityproviderarn( ).
    lv_capacityproviderstate = lo_capacityprovider->get_state( ).
    lo_capacityprovidervpcconf = lo_capacityprovider->get_vpcconfig( ).
    IF lo_capacityprovidervpcconf IS NOT INITIAL.
      LOOP AT lo_capacityprovidervpcconf->get_subnetids( ) into lo_row.
        lo_row_1 = lo_row.
        IF lo_row_1 IS NOT INITIAL.
          lv_subnetid = lo_row_1->get_value( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_capacityprovidervpcconf->get_securitygroupids( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_securitygroupid = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
    lo_capacityproviderpermiss = lo_capacityprovider->get_permissionsconfig( ).
    IF lo_capacityproviderpermiss IS NOT INITIAL.
      lv_rolearn = lo_capacityproviderpermiss->get_capacitypvdroprolearn( ).
    ENDIF.
    lo_instancerequirements = lo_capacityprovider->get_instancerequirements( ).
    IF lo_instancerequirements IS NOT INITIAL.
      LOOP AT lo_instancerequirements->get_architectures( ) into lo_row_4.
        lo_row_5 = lo_row_4.
        IF lo_row_5 IS NOT INITIAL.
          lv_architecture = lo_row_5->get_value( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_instancerequirements->get_allowedinstancetypes( ) into lo_row_6.
        lo_row_7 = lo_row_6.
        IF lo_row_7 IS NOT INITIAL.
          lv_instancetype = lo_row_7->get_value( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_instancerequirements->get_excludedinstancetypes( ) into lo_row_6.
        lo_row_7 = lo_row_6.
        IF lo_row_7 IS NOT INITIAL.
          lv_instancetype = lo_row_7->get_value( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
    lo_capacityproviderscaling = lo_capacityprovider->get_cappvdrscalingconfig( ).
    IF lo_capacityproviderscaling IS NOT INITIAL.
      lv_capacityprovidermaxvcpu = lo_capacityproviderscaling->get_maxvcpucount( ).
      lv_capacityproviderscaling_1 = lo_capacityproviderscaling->get_scalingmode( ).
      LOOP AT lo_capacityproviderscaling->get_scalingpolicies( ) into lo_row_8.
        lo_row_9 = lo_row_8.
        IF lo_row_9 IS NOT INITIAL.
          lv_capacityproviderpredefi = lo_row_9->get_predefinedmetrictype( ).
          lv_metrictargetvalue = lo_row_9->get_targetvalue( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
    lv_kmskeyarn = lo_capacityprovider->get_kmskeyarn( ).
    lv_timestamp = lo_capacityprovider->get_lastmodified( ).
  ENDIF.
ENDIF.