Skip to content

/AWS1/CL_EC2=>CREATEINSTANCECONNECTENDPT()

About CreateInstanceConnectEndpoint

Creates an EC2 Instance Connect Endpoint.

An EC2 Instance Connect Endpoint allows you to connect to an instance, without requiring the instance to have a public IPv4 address. For more information, see Connect to your instances without requiring a public IPv4 address using EC2 Instance Connect Endpoint in the Amazon EC2 User Guide.

Method Signature

IMPORTING

Required arguments:

iv_subnetid TYPE /AWS1/EC2SUBNETID /AWS1/EC2SUBNETID

The ID of the subnet in which to create the EC2 Instance Connect Endpoint.

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.

it_securitygroupids TYPE /AWS1/CL_EC2SECGRIDSTRLSTREQ_W=>TT_SECGROUPIDSTRINGLISTREQUEST TT_SECGROUPIDSTRINGLISTREQUEST

One or more security groups to associate with the endpoint. If you don't specify a security group, the default security group for your VPC will be associated with the endpoint.

iv_preserveclientip TYPE /AWS1/EC2BOOLEAN /AWS1/EC2BOOLEAN

Indicates whether the client IP address is preserved as the source. The following are the possible values.

  • true - Use the client IP address as the source.

  • false - Use the network interface IP address as the source.

Default: false

iv_clienttoken TYPE /AWS1/EC2STRING /AWS1/EC2STRING

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

it_tagspecifications TYPE /AWS1/CL_EC2TAGSPECIFICATION=>TT_TAGSPECIFICATIONLIST TT_TAGSPECIFICATIONLIST

The tags to apply to the EC2 Instance Connect Endpoint during creation.

RETURNING

oo_output TYPE REF TO /aws1/cl_ec2creinstcnctendptrs /AWS1/CL_EC2CREINSTCNCTENDPTRS

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~createinstanceconnectendpt(
  it_securitygroupids = VALUE /aws1/cl_ec2secgridstrlstreq_w=>tt_secgroupidstringlistrequest(
    ( new /aws1/cl_ec2secgridstrlstreq_w( |string| ) )
  )
  it_tagspecifications = VALUE /aws1/cl_ec2tagspecification=>tt_tagspecificationlist(
    (
      new /aws1/cl_ec2tagspecification(
        it_tags = VALUE /aws1/cl_ec2tag=>tt_taglist(
          (
            new /aws1/cl_ec2tag(
              iv_key = |string|
              iv_value = |string|
            )
          )
        )
        iv_resourcetype = |string|
      )
    )
  )
  iv_clienttoken = |string|
  iv_dryrun = ABAP_TRUE
  iv_preserveclientip = ABAP_TRUE
  iv_subnetid = |string|
).

This is an example of reading all possible response values

lv_string = lo_ec2instanceconnectendpo->get_ownerid( ).
lv_instanceconnectendpoint = lo_ec2instanceconnectendpo->get_instanceconnectendptid( ).
lv_resourcearn = lo_ec2instanceconnectendpo->get_instanceconnectendptarn( ).
lv_ec2instanceconnectendpo_1 = lo_ec2instanceconnectendpo->get_state( ).
lv_string = lo_ec2instanceconnectendpo->get_statemessage( ).
lv_string = lo_ec2instanceconnectendpo->get_dnsname( ).
lv_string = lo_ec2instanceconnectendpo->get_fipsdnsname( ).
LOOP AT lo_ec2instanceconnectendpo->get_networkinterfaceids( ) into lo_row.
  lv_string = lo_row_1->get_value( ).
ENDLOOP.
lv_vpcid = lo_ec2instanceconnectendpo->get_vpcid( ).
lv_string = lo_ec2instanceconnectendpo->get_availabilityzone( ).
lv_milliseconddatetime = lo_ec2instanceconnectendpo->get_createdat( ).
lv_subnetid = lo_ec2instanceconnectendpo->get_subnetid( ).
lv_boolean = lo_ec2instanceconnectendpo->get_preserveclientip( ).
LOOP AT lo_ec2instanceconnectendpo->get_securitygroupids( ) into lo_row_2.
  lv_securitygroupid = lo_row_3->get_value( ).
ENDLOOP.
LOOP AT lo_ec2instanceconnectendpo->get_tags( ) into lo_row_4.
  lv_string = lo_row_5->get_key( ).
  lv_string = lo_row_5->get_value( ).
ENDLOOP.
lv_string = lo_result->get_clienttoken( ).