Skip to content

/AWS1/IF_LMW=>CREATEWEBFUNCTIONREVISION()

About CreateWebFunctionRevision

Creates an immutable revision for a web function. A revision represents a specific version of the function code and configuration.

To use this operation, you must have the CreateWebFunctionRevision permission on the web function, not on the revision being created.

This API is experimental and for internal AWS use only. It is not yet available to external customers.

Method Signature

METHODS /AWS1/IF_LMW~CREATEWEBFUNCTIONREVISION
  IMPORTING
    !IV_FUNCTIONNAME TYPE /AWS1/LMWFUNCTIONNAME OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/LMWDESCRIPTION OPTIONAL
    !IV_KMSKEYARN TYPE /AWS1/LMWKMSKEYARN OPTIONAL
    !IO_BUILDCONFIG TYPE REF TO /AWS1/CL_LMWBUILDCONFIG OPTIONAL
    !IO_SERVICECONFIG TYPE REF TO /AWS1/CL_LMWSERVICECONFIG OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_lmwcrewebfuncrevsnrsp
  RAISING
    /AWS1/CX_LMWACCESSDENIEDEX
    /AWS1/CX_LMWCONFLICTEXCEPTION
    /AWS1/CX_LMWINTERNALSERVEREX
    /AWS1/CX_LMWRESOURCENOTFOUNDEX
    /AWS1/CX_LMWSERVICEQUOTAEXCDEX
    /AWS1/CX_LMWTHROTTLINGEX
    /AWS1/CX_LMWVLDTNEXCEPTION
    /AWS1/CX_LMWCLIENTEXC
    /AWS1/CX_LMWSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_functionname TYPE /AWS1/LMWFUNCTIONNAME /AWS1/LMWFUNCTIONNAME

The name of the web function. You can specify the function name or the function ARN. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

io_buildconfig TYPE REF TO /AWS1/CL_LMWBUILDCONFIG /AWS1/CL_LMWBUILDCONFIG

The build configuration for the revision, including code location and runtime settings.

io_serviceconfig TYPE REF TO /AWS1/CL_LMWSERVICECONFIG /AWS1/CL_LMWSERVICECONFIG

The service configuration for the revision, including execution role, timeout, and concurrency settings.

Optional arguments:

iv_description TYPE /AWS1/LMWDESCRIPTION /AWS1/LMWDESCRIPTION

A description of the revision.

iv_kmskeyarn TYPE /AWS1/LMWKMSKEYARN /AWS1/LMWKMSKEYARN

The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) key used to encrypt the revision's code and environment variables.

RETURNING

oo_output TYPE REF TO /aws1/cl_lmwcrewebfuncrevsnrsp /AWS1/CL_LMWCREWEBFUNCREVSNRSP

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->createwebfunctionrevision(
  io_buildconfig = new /aws1/cl_lmwbuildconfig(
    io_codeconfig = new /aws1/cl_lmwcodeconfig(
      io_s3object = new /aws1/cl_lmws3object(
        iv_bucket = |string|
        iv_key = |string|
        iv_versionid = |string|
      )
    )
    io_runtimeconfig = new /aws1/cl_lmwruntimeconfig( |string| )
  )
  io_serviceconfig = new /aws1/cl_lmwserviceconfig(
    io_telemetryconfig = new /aws1/cl_lmwtelemetryconfig(
      io_loggingconfig = new /aws1/cl_lmwloggingconfig(
        iv_applicationloglevel = |string|
        iv_loggroup = |string|
        iv_systemloglevel = |string|
      )
    )
    it_environmentvariables = VALUE /aws1/cl_lmwenvvariables_w=>tt_environmentvariables(
      (
        VALUE /aws1/cl_lmwenvvariables_w=>ts_environmentvariables_maprow(
          key = |string|
          value = new /aws1/cl_lmwenvvariables_w( |string| )
        )
      )
    )
    iv_executionrolearn = |string|
    iv_maxconcrperenvironment = 123
    iv_timeoutseconds = 123
  )
  iv_description = |string|
  iv_functionname = |string|
  iv_kmskeyarn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_functionarn = lo_result->get_functionarn( ).
  lv_revisionarn = lo_result->get_revisionarn( ).
  lv_revisionid = lo_result->get_revisionid( ).
  lv_description = lo_result->get_description( ).
  lv_kmskeyarn = lo_result->get_kmskeyarn( ).
  lo_buildconfig = lo_result->get_buildconfig( ).
  IF lo_buildconfig IS NOT INITIAL.
    lo_codeconfig = lo_buildconfig->get_codeconfig( ).
    IF lo_codeconfig IS NOT INITIAL.
      lo_s3object = lo_codeconfig->get_s3object( ).
      IF lo_s3object IS NOT INITIAL.
        lv_string = lo_s3object->get_bucket( ).
        lv_string = lo_s3object->get_key( ).
        lv_string = lo_s3object->get_versionid( ).
      ENDIF.
    ENDIF.
    lo_runtimeconfig = lo_buildconfig->get_runtimeconfig( ).
    IF lo_runtimeconfig IS NOT INITIAL.
      lv_string = lo_runtimeconfig->get_runtime( ).
    ENDIF.
  ENDIF.
  lo_serviceconfig = lo_result->get_serviceconfig( ).
  IF lo_serviceconfig IS NOT INITIAL.
    lv_rolearn = lo_serviceconfig->get_executionrolearn( ).
    lv_integer = lo_serviceconfig->get_timeoutseconds( ).
    lv_integer = lo_serviceconfig->get_maxconcrperenvironment( ).
    LOOP AT lo_serviceconfig->get_environmentvariables( ) into ls_row.
      lv_key = ls_row-key.
      lo_value = ls_row-value.
      IF lo_value IS NOT INITIAL.
        lv_string = lo_value->get_value( ).
      ENDIF.
    ENDLOOP.
    lo_telemetryconfig = lo_serviceconfig->get_telemetryconfig( ).
    IF lo_telemetryconfig IS NOT INITIAL.
      lo_loggingconfig = lo_telemetryconfig->get_loggingconfig( ).
      IF lo_loggingconfig IS NOT INITIAL.
        lv_string = lo_loggingconfig->get_loggroup( ).
        lv_applicationloglevel = lo_loggingconfig->get_applicationloglevel( ).
        lv_systemloglevel = lo_loggingconfig->get_systemloglevel( ).
      ENDIF.
    ENDIF.
  ENDIF.
  lv_revisionstate = lo_result->get_state( ).
  lv_string = lo_result->get_statereason( ).
  LOOP AT lo_result->get_errors( ) into lo_row_1.
    lo_row_2 = lo_row_1.
    IF lo_row_2 IS NOT INITIAL.
      lv_string = lo_row_2->get_attribute( ).
      lv_string = lo_row_2->get_errorcode( ).
      lv_string = lo_row_2->get_errormessage( ).
    ENDIF.
  ENDLOOP.
  lv_datetime = lo_result->get_createdat( ).
ENDIF.