Skip to content

/AWS1/IF_EC2=>DESCRIBEIMAGEREFERENCES()

About DescribeImageReferences

Describes your Amazon Web Services resources that are referencing the specified images.

For more information, see Identify your resources referencing specified AMIs in the Amazon EC2 User Guide.

Method Signature

IMPORTING

Required arguments:

it_imageids TYPE /AWS1/CL_EC2DSCIMAGEREFERENC01=>TT_DSCIMAGEREFERENCESIMAGEID00 TT_DSCIMAGEREFERENCESIMAGEID00

The IDs of the images to check for resource references.

Optional arguments:

iv_includeallresourcetypes TYPE /AWS1/EC2BOOLEAN /AWS1/EC2BOOLEAN

Specifies whether to check all supported Amazon Web Services resource types for image references. When specified, default values are applied for ResourceTypeOptions. For the default values, see How AMI reference checks work in the Amazon EC2 User Guide. If you also specify ResourceTypes with ResourceTypeOptions, your specified values override the default values.

Supported resource types: ec2:Instance | ec2:LaunchTemplate | ssm:Parameter | imagebuilder:ImageRecipe | imagebuilder:ContainerRecipe

Either IncludeAllResourceTypes or ResourceTypes must be specified.

it_resourcetypes TYPE /AWS1/CL_EC2RESTYPEREQUEST=>TT_RESOURCETYPEREQUESTLIST TT_RESOURCETYPEREQUESTLIST

The Amazon Web Services resource types to check for image references.

Either IncludeAllResourceTypes or ResourceTypes must be specified.

iv_nexttoken TYPE /AWS1/EC2STRING /AWS1/EC2STRING

The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

iv_dryrun TYPE /AWS1/EC2BOOLEAN /AWS1/EC2BOOLEAN

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

iv_maxresults TYPE /AWS1/EC2DSCIMAGEREFERENCESM00 /AWS1/EC2DSCIMAGEREFERENCESM00

The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.

RETURNING

oo_output TYPE REF TO /aws1/cl_ec2dscimagereferenc02 /AWS1/CL_EC2DSCIMAGEREFERENC02

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->/aws1/if_ec2~describeimagereferences(
  it_imageids = VALUE /aws1/cl_ec2dscimagereferenc01=>tt_dscimagereferencesimageid00(
    ( new /aws1/cl_ec2dscimagereferenc01( |string| ) )
  )
  it_resourcetypes = VALUE /aws1/cl_ec2restyperequest=>tt_resourcetyperequestlist(
    (
      new /aws1/cl_ec2restyperequest(
        it_resourcetypeoptions = VALUE /aws1/cl_ec2resourcetypeoption=>tt_resourcetypeoptionlist(
          (
            new /aws1/cl_ec2resourcetypeoption(
              it_optionvalues = VALUE /aws1/cl_ec2restypeoptvalsls00=>tt_restypeoptionvalueslist(
                ( new /aws1/cl_ec2restypeoptvalsls00( |string| ) )
              )
              iv_optionname = |string|
            )
          )
        )
        iv_resourcetype = |string|
      )
    )
  )
  iv_dryrun = ABAP_TRUE
  iv_includeallresourcetypes = ABAP_TRUE
  iv_maxresults = 123
  iv_nexttoken = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_string = lo_result->get_nexttoken( ).
  LOOP AT lo_result->get_imagereferences( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_imageid = lo_row_1->get_imageid( ).
      lv_imagereferenceresourcet = lo_row_1->get_resourcetype( ).
      lv_string = lo_row_1->get_arn( ).
    ENDIF.
  ENDLOOP.
ENDIF.