Skip to content

/AWS1/IF_BDO=>CREATECAPACITYPROVIDER()

About CreateCapacityProvider

Creates a capacity provider. A capacity provider defines the Amazon EC2 infrastructure for AgentCore Runtime, including the operating system, allowed instance types, networking, and storage. It also specifies the IAM permissions that AgentCore uses to manage those instances.

The capacity provider name must be unique within your account. After you create the capacity provider, it enters a CREATING state and transitions to READY when it is available for use.

Method Signature

METHODS /AWS1/IF_BDO~CREATECAPACITYPROVIDER
  IMPORTING
    !IV_NAME TYPE /AWS1/BDOCAPACITYPROVIDERNAME OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/BDODESCRIPTION OPTIONAL
    !IO_PERMISSIONSCONFIGURATION TYPE REF TO /AWS1/CL_BDOPERMISSIONSCONF OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/BDOCLIENTTOKEN OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_BDOTAGSMAP_W=>TT_TAGSMAP OPTIONAL
    !IO_COMPUTECONFIGURATION TYPE REF TO /AWS1/CL_BDOCOMPUTECONF OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bdocreatecappvdrout
  RAISING
    /AWS1/CX_BDOACCESSDENIEDEX
    /AWS1/CX_BDOCONFLICTEXCEPTION
    /AWS1/CX_BDOINTERNALSERVEREX
    /AWS1/CX_BDORESOURCENOTFOUNDEX
    /AWS1/CX_BDORETRYBLCONFLICTEX
    /AWS1/CX_BDOSERVICEQUOTAEXCDEX
    /AWS1/CX_BDOTHROTTLINGEX
    /AWS1/CX_BDOVALIDATIONEX
    /AWS1/CX_BDOCLIENTEXC
    /AWS1/CX_BDOSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_name TYPE /AWS1/BDOCAPACITYPROVIDERNAME /AWS1/BDOCAPACITYPROVIDERNAME

The name of the capacity provider. The name must be unique within your account.

io_permissionsconfiguration TYPE REF TO /AWS1/CL_BDOPERMISSIONSCONF /AWS1/CL_BDOPERMISSIONSCONF

The permissions configuration for the capacity provider. This specifies the IAM role that AgentCore uses to manage the Amazon EC2 instances on your behalf.

io_computeconfiguration TYPE REF TO /AWS1/CL_BDOCOMPUTECONF /AWS1/CL_BDOCOMPUTECONF

The compute configuration for the capacity provider. This defines the Amazon EC2 compute resources used to launch instances: the operating system, allowed instance types, networking, and storage.

Optional arguments:

iv_description TYPE /AWS1/BDODESCRIPTION /AWS1/BDODESCRIPTION

An optional description of the capacity provider. If you don't specify a description, the service creates the capacity provider without one.

iv_clienttoken TYPE /AWS1/BDOCLIENTTOKEN /AWS1/BDOCLIENTTOKEN

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency.

it_tags TYPE /AWS1/CL_BDOTAGSMAP_W=>TT_TAGSMAP TT_TAGSMAP

A map of tag keys and values to associate with the capacity provider. If you don't specify tags, the capacity provider is created with no tags.

RETURNING

oo_output TYPE REF TO /aws1/cl_bdocreatecappvdrout /AWS1/CL_BDOCREATECAPPVDROUT

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_computeconfiguration = new /aws1/cl_bdocomputeconf(
    io_ec2configuration = new /aws1/cl_bdoec2configuration(
      io_launchtemplatesource = new /aws1/cl_bdolaunchtmplource(
        io_launchparameters = new /aws1/cl_bdolaunchparameters(
          io_capacityreservationspec = new /aws1/cl_bdocapacityrsvpec(
            io_capacityreservationtarget = new /aws1/cl_bdocapacityresvtarget(
              iv_capacityreservationid = |string|
              iv_capresvresourcegrouparn = |string|
            )
            iv_capacityresvpreference = |string|
          )
          io_instancerequirements = new /aws1/cl_bdoinstancereqmnts(
            it_allowedinstancetypes = VALUE /aws1/cl_bdoinstancetypelist_w=>tt_instancetypelist(
              ( new /aws1/cl_bdoinstancetypelist_w( |string| ) )
            )
          )
          it_ephemeralvolumes = VALUE /aws1/cl_bdoephrblockdevicemap=>tt_ephrblockdevicemappinglist(
            (
              new /aws1/cl_bdoephrblockdevicemap(
                io_ebs = new /aws1/cl_bdoephrebsvolumeconf(
                  iv_ebscardindex = 123
                  iv_encrypted = ABAP_TRUE
                  iv_iops = 123
                  iv_kmskeyid = |string|
                  iv_snapshotid = |string|
                  iv_throughput = 123
                  iv_volumeinitializationrate = 123
                  iv_volumesize = 123
                  iv_volumetype = |string|
                )
                iv_devicename = |string|
                iv_virtualname = |string|
              )
            )
          )
          it_licensespecifications = VALUE /aws1/cl_bdolicensespec=>tt_licensespecificationlist(
            ( new /aws1/cl_bdolicensespec( |string| ) )
          )
          it_propagatedtags = VALUE /aws1/cl_bdotagsmap_w=>tt_tagsmap(
            (
              VALUE /aws1/cl_bdotagsmap_w=>ts_tagsmap_maprow(
                key = |string|
                value = new /aws1/cl_bdotagsmap_w( |string| )
              )
            )
          )
          iv_instanceprofilearn = |string|
          iv_monitoring = |string|
          iv_operatingsystem = |string|
          iv_sshkeyname = |string|
        )
      )
      io_lifecycleconfiguration = new /aws1/cl_bdoinstancelcconf(
        iv_idleinstancetimeout = 123
        iv_maxlifetime = 123
      )
      io_rootvolume = new /aws1/cl_bdorootvolumeconf(
        iv_encrypted = ABAP_TRUE
        iv_freespacegib = 123
        iv_iops = 123
        iv_kmskeyid = |string|
        iv_throughput = 123
        iv_volumetype = |string|
      )
      io_vpcconfiguration = new /aws1/cl_bdovpcconfiguration(
        it_securitygroups = VALUE /aws1/cl_bdosecgroupidlist_w=>tt_securitygroupidlist(
          ( new /aws1/cl_bdosecgroupidlist_w( |string| ) )
        )
        it_subnets = VALUE /aws1/cl_bdosubnetidlist_w=>tt_subnetidlist(
          ( new /aws1/cl_bdosubnetidlist_w( |string| ) )
        )
      )
      it_volumes = VALUE /aws1/cl_bdovolumeconf=>tt_volumeconfigurationlist(
        (
          new /aws1/cl_bdovolumeconf(
            io_ebsconfiguration = new /aws1/cl_bdoebsvolumeconf(
              iv_encrypted = ABAP_TRUE
              iv_iops = 123
              iv_kmskeyid = |string|
              iv_name = |string|
              iv_sizegib = 123
              iv_snapshotid = |string|
              iv_throughput = 123
              iv_volumetype = |string|
            )
          )
        )
      )
    )
  )
  io_permissionsconfiguration = new /aws1/cl_bdopermissionsconf( |string| )
  it_tags = VALUE /aws1/cl_bdotagsmap_w=>tt_tagsmap(
    (
      VALUE /aws1/cl_bdotagsmap_w=>ts_tagsmap_maprow(
        key = |string|
        value = new /aws1/cl_bdotagsmap_w( |string| )
      )
    )
  )
  iv_clienttoken = |string|
  iv_description = |string|
  iv_name = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_capacityproviderid = lo_result->get_capacityproviderid( ).
  lv_capacityproviderarn = lo_result->get_capacityproviderarn( ).
  lv_capacityprovidername = lo_result->get_name( ).
  lv_capacityproviderstatus = lo_result->get_status( ).
ENDIF.