Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can click “Customize cookies” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To continue without accepting these cookies, click “Continue without accepting.” To make more detailed choices or learn more, click “Customize cookies.”

Skip to content

/AWS1/CL_EC2=>ACCEPTVPCPEERINGCONNECTION()

About AcceptVpcPeeringConnection

Accept a VPC peering connection request. To accept a request, the VPC peering connection must be in the pending-acceptance state, and you must be the owner of the peer VPC. Use DescribeVpcPeeringConnections to view your outstanding VPC peering connection requests.

For an inter-Region VPC peering connection request, you must accept the VPC peering connection in the Region of the accepter VPC.

Method Signature

IMPORTING

Required arguments:

iv_vpcpeeringconnectionid TYPE /AWS1/EC2VPCPEERINGCXNIDWRES00 /AWS1/EC2VPCPEERINGCXNIDWRES00

The ID of the VPC peering connection. You must specify this parameter in the request.

Optional arguments:

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.

RETURNING

oo_output TYPE REF TO /aws1/cl_ec2accvpcpeeringcxnrs /AWS1/CL_EC2ACCVPCPEERINGCXNRS

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~acceptvpcpeeringconnection(
  iv_dryrun = ABAP_TRUE
  iv_vpcpeeringconnectionid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_vpcpeeringconnection = lo_result->get_vpcpeeringconnection( ).
  IF lo_vpcpeeringconnection IS NOT INITIAL.
    lo_vpcpeeringconnectionvpc = lo_vpcpeeringconnection->get_acceptervpcinfo( ).
    IF lo_vpcpeeringconnectionvpc IS NOT INITIAL.
      lv_string = lo_vpcpeeringconnectionvpc->get_cidrblock( ).
      LOOP AT lo_vpcpeeringconnectionvpc->get_ipv6cidrblockset( ) into lo_row.
        lo_row_1 = lo_row.
        IF lo_row_1 IS NOT INITIAL.
          lv_string = lo_row_1->get_ipv6cidrblock( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_vpcpeeringconnectionvpc->get_cidrblockset( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_string = lo_row_3->get_cidrblock( ).
        ENDIF.
      ENDLOOP.
      lv_string = lo_vpcpeeringconnectionvpc->get_ownerid( ).
      lo_vpcpeeringconnectionopt = lo_vpcpeeringconnectionvpc->get_peeringoptions( ).
      IF lo_vpcpeeringconnectionopt IS NOT INITIAL.
        lv_boolean = lo_vpcpeeringconnectionopt->get_alwdnsresolutionfrmrem00( ).
        lv_boolean = lo_vpcpeeringconnectionopt->get_alwegrfrmlocalcliclink00( ).
        lv_boolean = lo_vpcpeeringconnectionopt->get_alwegrfrmlocalvpctorem00( ).
      ENDIF.
      lv_string = lo_vpcpeeringconnectionvpc->get_vpcid( ).
      lv_string = lo_vpcpeeringconnectionvpc->get_region( ).
    ENDIF.
    lv_datetime = lo_vpcpeeringconnection->get_expirationtime( ).
    lo_vpcpeeringconnectionvpc = lo_vpcpeeringconnection->get_requestervpcinfo( ).
    IF lo_vpcpeeringconnectionvpc IS NOT INITIAL.
      lv_string = lo_vpcpeeringconnectionvpc->get_cidrblock( ).
      LOOP AT lo_vpcpeeringconnectionvpc->get_ipv6cidrblockset( ) into lo_row.
        lo_row_1 = lo_row.
        IF lo_row_1 IS NOT INITIAL.
          lv_string = lo_row_1->get_ipv6cidrblock( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_vpcpeeringconnectionvpc->get_cidrblockset( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_string = lo_row_3->get_cidrblock( ).
        ENDIF.
      ENDLOOP.
      lv_string = lo_vpcpeeringconnectionvpc->get_ownerid( ).
      lo_vpcpeeringconnectionopt = lo_vpcpeeringconnectionvpc->get_peeringoptions( ).
      IF lo_vpcpeeringconnectionopt IS NOT INITIAL.
        lv_boolean = lo_vpcpeeringconnectionopt->get_alwdnsresolutionfrmrem00( ).
        lv_boolean = lo_vpcpeeringconnectionopt->get_alwegrfrmlocalcliclink00( ).
        lv_boolean = lo_vpcpeeringconnectionopt->get_alwegrfrmlocalvpctorem00( ).
      ENDIF.
      lv_string = lo_vpcpeeringconnectionvpc->get_vpcid( ).
      lv_string = lo_vpcpeeringconnectionvpc->get_region( ).
    ENDIF.
    lo_vpcpeeringconnectionsta = lo_vpcpeeringconnection->get_status( ).
    IF lo_vpcpeeringconnectionsta IS NOT INITIAL.
      lv_vpcpeeringconnectionsta_1 = lo_vpcpeeringconnectionsta->get_code( ).
      lv_string = lo_vpcpeeringconnectionsta->get_message( ).
    ENDIF.
    LOOP AT lo_vpcpeeringconnection->get_tags( ) into lo_row_4.
      lo_row_5 = lo_row_4.
      IF lo_row_5 IS NOT INITIAL.
        lv_string = lo_row_5->get_key( ).
        lv_string = lo_row_5->get_value( ).
      ENDIF.
    ENDLOOP.
    lv_string = lo_vpcpeeringconnection->get_vpcpeeringconnectionid( ).
  ENDIF.
ENDIF.