Skip to content

/AWS1/IF_APS=>CREATEEXPORTIMAGETASK()

About CreateExportImageTask

Creates a task to export a WorkSpaces Applications image to an EC2 AMI. This allows you to use your customized WorkSpaces Applications images with other AWS services or for backup purposes.

Method Signature

METHODS /AWS1/IF_APS~CREATEEXPORTIMAGETASK
  IMPORTING
    !IV_IMAGENAME TYPE /AWS1/APSNAME OPTIONAL
    !IV_AMINAME TYPE /AWS1/APSAMINAME OPTIONAL
    !IV_IAMROLEARN TYPE /AWS1/APSARN OPTIONAL
    !IT_TAGSPECIFICATIONS TYPE /AWS1/CL_APSTAGS_W=>TT_TAGS OPTIONAL
    !IV_AMIDESCRIPTION TYPE /AWS1/APSDESCRIPTION OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_apscreexpimagetskrslt
  RAISING
    /AWS1/CX_APSCONCURRENTMODEX
    /AWS1/CX_APSINVACCTSTATUSEX
    /AWS1/CX_APSINVALIDROLEEX
    /AWS1/CX_APSLIMITEXCEEDEDEX
    /AWS1/CX_APSOPNOTPERMITTEDEX
    /AWS1/CX_APSRESRCNOTAVAILABL00
    /AWS1/CX_APSRESOURCENOTFOUNDEX
    /AWS1/CX_APSCLIENTEXC
    /AWS1/CX_APSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_imagename TYPE /AWS1/APSNAME /AWS1/APSNAME

The name of the WorkSpaces Applications image to export. The image must be in an available state and owned by your account.

iv_aminame TYPE /AWS1/APSAMINAME /AWS1/APSAMINAME

The name for the exported EC2 AMI. This is a required field that must be unique within your account and region.

iv_iamrolearn TYPE /AWS1/APSARN /AWS1/APSARN

The ARN of the IAM role that allows WorkSpaces Applications to create the AMI. The role must have permissions to copy images, describe images, and create tags, with a trust relationship allowing appstream.amazonaws.com to assume the role.

Optional arguments:

it_tagspecifications TYPE /AWS1/CL_APSTAGS_W=>TT_TAGS TT_TAGS

The tags to apply to the exported AMI. These tags help you organize and manage your EC2 AMIs.

iv_amidescription TYPE /AWS1/APSDESCRIPTION /AWS1/APSDESCRIPTION

An optional description for the exported AMI. This description will be applied to the resulting EC2 AMI.

RETURNING

oo_output TYPE REF TO /aws1/cl_apscreexpimagetskrslt /AWS1/CL_APSCREEXPIMAGETSKRSLT

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->createexportimagetask(
  it_tagspecifications = VALUE /aws1/cl_apstags_w=>tt_tags(
    (
      VALUE /aws1/cl_apstags_w=>ts_tags_maprow(
        key = |string|
        value = new /aws1/cl_apstags_w( |string| )
      )
    )
  )
  iv_amidescription = |string|
  iv_aminame = |string|
  iv_iamrolearn = |string|
  iv_imagename = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_exportimagetask = lo_result->get_exportimagetask( ).
  IF lo_exportimagetask IS NOT INITIAL.
    lv_uuid = lo_exportimagetask->get_taskid( ).
    lv_arn = lo_exportimagetask->get_imagearn( ).
    lv_aminame = lo_exportimagetask->get_aminame( ).
    lv_timestamp = lo_exportimagetask->get_createddate( ).
    lv_description = lo_exportimagetask->get_amidescription( ).
    lv_exportimagetaskstate = lo_exportimagetask->get_state( ).
    lv_photonamiid = lo_exportimagetask->get_amiid( ).
    LOOP AT lo_exportimagetask->get_tagspecifications( ) into ls_row.
      lv_key = ls_row-key.
      lo_value = ls_row-value.
      IF lo_value IS NOT INITIAL.
        lv_tagvalue = lo_value->get_value( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_exportimagetask->get_errordetails( ) into lo_row_1.
      lo_row_2 = lo_row_1.
      IF lo_row_2 IS NOT INITIAL.
        lv_string = lo_row_2->get_errorcode( ).
        lv_string = lo_row_2->get_errormessage( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDIF.