Skip to content

/AWS1/IF_SAG=>CREATEPRIVATECONNECTION()

About CreatePrivateConnection

Creates a private connection for reaching a self-hosted provider instance over private networking using Amazon VPC Lattice.

Method Signature

METHODS /AWS1/IF_SAG~CREATEPRIVATECONNECTION
  IMPORTING
    !IV_PRIVATECONNECTIONNAME TYPE /AWS1/SAGPRIVATECONNECTIONNAME OPTIONAL
    !IO_MODE TYPE REF TO /AWS1/CL_SAGPRIVATECONNMODE OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_SAGTAGMAP_W=>TT_TAGMAP OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_sagcreatepvtconnout
  RAISING
    /AWS1/CX_SAGACCESSDENIEDEX
    /AWS1/CX_SAGCONFLICTEXCEPTION
    /AWS1/CX_SAGINTERNALSERVEREX
    /AWS1/CX_SAGRESOURCENOTFOUNDEX
    /AWS1/CX_SAGTHROTTLINGEX
    /AWS1/CX_SAGVLDTNEXCEPTION
    /AWS1/CX_SAGCLIENTEXC
    /AWS1/CX_SAGSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_privateconnectionname TYPE /AWS1/SAGPRIVATECONNECTIONNAME /AWS1/SAGPRIVATECONNECTIONNAME

A unique name for the private connection within your account.

io_mode TYPE REF TO /AWS1/CL_SAGPRIVATECONNMODE /AWS1/CL_SAGPRIVATECONNMODE

The configuration for the private connection. Specify either a service-managed or a self-managed mode.

Optional arguments:

it_tags TYPE /AWS1/CL_SAGTAGMAP_W=>TT_TAGMAP TT_TAGMAP

The tags to attach to the private connection.

RETURNING

oo_output TYPE REF TO /aws1/cl_sagcreatepvtconnout /AWS1/CL_SAGCREATEPVTCONNOUT

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->createprivateconnection(
  io_mode = new /aws1/cl_sagprivateconnmode(
    io_selfmanaged = new /aws1/cl_sagselfmanagedinput(
      iv_certificate = |string|
      iv_resourceconfigurationid = |string|
    )
    io_servicemanaged = new /aws1/cl_sagsvcmanagedinput(
      it_portranges = VALUE /aws1/cl_sagportranges_w=>tt_portranges(
        ( new /aws1/cl_sagportranges_w( |string| ) )
      )
      it_securitygroupids = VALUE /aws1/cl_sagpvtconnsecgrpids_w=>tt_privateconnsecuritygroupids(
        ( new /aws1/cl_sagpvtconnsecgrpids_w( |string| ) )
      )
      it_subnetids = VALUE /aws1/cl_sagpvtconnsubnetids_w=>tt_privateconnectionsubnetids(
        ( new /aws1/cl_sagpvtconnsubnetids_w( |string| ) )
      )
      iv_certificate = |string|
      iv_dnsresolution = |string|
      iv_hostaddress = |string|
      iv_ipaddresstype = |string|
      iv_ipv4addressespereni = 123
      iv_vpcid = |string|
    )
  )
  it_tags = VALUE /aws1/cl_sagtagmap_w=>tt_tagmap(
    (
      VALUE /aws1/cl_sagtagmap_w=>ts_tagmap_maprow(
        key = |string|
        value = new /aws1/cl_sagtagmap_w( |string| )
      )
    )
  )
  iv_privateconnectionname = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_privateconnectionname = lo_result->get_name( ).
  lv_privateconnectiontype = lo_result->get_type( ).
  lv_privateconnectionstatus = lo_result->get_status( ).
  lv_resourcegatewayid = lo_result->get_resourcegatewayid( ).
  lv_hostaddress = lo_result->get_hostaddress( ).
  lv_privateconnectionvpcid = lo_result->get_vpcid( ).
  lv_resourceconfigurationid = lo_result->get_resourceconfigurationid( ).
  lv_timestamp = lo_result->get_certificateexpirytime( ).
  lv_resourceconfigdnsresolu = lo_result->get_dnsresolution( ).
  lv_string = lo_result->get_failuremessage( ).
  LOOP AT lo_result->get_tags( ) 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.
ENDIF.