Skip to content

/AWS1/CL_EC2=>CREATENETWORKACL()

About CreateNetworkAcl

Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC.

For more information, see Network ACLs in the Amazon VPC User Guide.

Method Signature

IMPORTING

Required arguments:

iv_vpcid TYPE /AWS1/EC2VPCID /AWS1/EC2VPCID

The ID of the VPC.

Optional arguments:

it_tagspecifications TYPE /AWS1/CL_EC2TAGSPECIFICATION=>TT_TAGSPECIFICATIONLIST TT_TAGSPECIFICATIONLIST

The tags to assign to the network ACL.

iv_clienttoken TYPE /AWS1/EC2STRING /AWS1/EC2STRING

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.

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_ec2crenetworkaclrslt /AWS1/CL_EC2CRENETWORKACLRSLT

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~createnetworkacl(
  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_vpcid = |string|
).

This is an example of reading all possible response values

LOOP AT lo_networkacl->get_associations( ) into lo_row.
  lv_string = lo_row_1->get_networkaclassociationid( ).
  lv_string = lo_row_1->get_networkaclid( ).
  lv_string = lo_row_1->get_subnetid( ).
ENDLOOP.
LOOP AT lo_networkacl->get_entries( ) into lo_row_2.
  lv_string = lo_row_3->get_cidrblock( ).
  lv_boolean = lo_row_3->get_egress( ).
  lv_integer = lo_icmptypecode->get_code( ).
  lv_integer = lo_icmptypecode->get_type( ).
  lv_string = lo_row_3->get_ipv6cidrblock( ).
  lv_integer = lo_portrange->get_from( ).
  lv_integer = lo_portrange->get_to( ).
  lv_string = lo_row_3->get_protocol( ).
  lv_ruleaction = lo_row_3->get_ruleaction( ).
  lv_integer = lo_row_3->get_rulenumber( ).
ENDLOOP.
lv_boolean = lo_networkacl->get_isdefault( ).
lv_string = lo_networkacl->get_networkaclid( ).
LOOP AT lo_networkacl->get_tags( ) into lo_row_4.
  lv_string = lo_row_5->get_key( ).
  lv_string = lo_row_5->get_value( ).
ENDLOOP.
lv_string = lo_networkacl->get_vpcid( ).
lv_string = lo_networkacl->get_ownerid( ).
lv_string = lo_result->get_clienttoken( ).

To create a network ACL

This example creates a network ACL for the specified VPC.

DATA(lo_result) = lo_client->/aws1/if_ec2~createnetworkacl( iv_vpcid = |vpc-a01106c2| ) .