/AWS1/IF_VL=>CRESVCNETWORKVPCASSOCIATION()¶
About CreateServiceNetworkVpcAssociation¶
Associates a VPC with a service network. When you associate a VPC with the service network, it enables all the resources within that VPC to be clients and communicate with other services in the service network. For more information, see Manage VPC associations in the Amazon VPC Lattice User Guide.
You can't use this operation if there is a disassociation in progress. If the association fails, retry by deleting the association and recreating it.
As a result of this operation, the association gets created in the service network account and the VPC owner account.
If you add a security group to the service network and VPC association, the association must continue to always have at least one security group. You can add or edit security groups at any time. However, to remove all security groups, you must first delete the association and recreate it without security groups.
Method Signature¶
METHODS /AWS1/IF_VL~CRESVCNETWORKVPCASSOCIATION
IMPORTING
!IV_CLIENTTOKEN TYPE /AWS1/VL_CLIENTTOKEN OPTIONAL
!IV_SERVICENETWORKIDENTIFIER TYPE /AWS1/VL_SERVICENETWORKID OPTIONAL
!IV_VPCIDENTIFIER TYPE /AWS1/VL_VPCID OPTIONAL
!IV_PRIVATEDNSENABLED TYPE /AWS1/VL_BOOLEAN OPTIONAL
!IT_SECURITYGROUPIDS TYPE /AWS1/CL_VL_SECGROUPLIST_W=>TT_SECURITYGROUPLIST OPTIONAL
!IT_TAGS TYPE /AWS1/CL_VL_TAGMAP_W=>TT_TAGMAP OPTIONAL
!IO_DNSOPTIONS TYPE REF TO /AWS1/CL_VL_DNSOPTIONS OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_vl_cresvcnetworkvpc01
RAISING
/AWS1/CX_VL_ACCESSDENIEDEX
/AWS1/CX_VL_CONFLICTEXCEPTION
/AWS1/CX_VL_INTERNALSERVEREX
/AWS1/CX_VL_RESOURCENOTFOUNDEX
/AWS1/CX_VL_SERVICEQUOTAEXCDEX
/AWS1/CX_VL_THROTTLINGEX
/AWS1/CX_VL_VALIDATIONEX
/AWS1/CX_VL_CLIENTEXC
/AWS1/CX_VL_SERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_servicenetworkidentifier TYPE /AWS1/VL_SERVICENETWORKID /AWS1/VL_SERVICENETWORKID¶
The ID or ARN of the service network. You must use an ARN if the resources are in different accounts.
iv_vpcidentifier TYPE /AWS1/VL_VPCID /AWS1/VL_VPCID¶
The ID of the VPC.
Optional arguments:¶
iv_clienttoken TYPE /AWS1/VL_CLIENTTOKEN /AWS1/VL_CLIENTTOKEN¶
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.
iv_privatednsenabled TYPE /AWS1/VL_BOOLEAN /AWS1/VL_BOOLEAN¶
Indicates if private DNS is enabled for the VPC association.
it_securitygroupids TYPE /AWS1/CL_VL_SECGROUPLIST_W=>TT_SECURITYGROUPLIST TT_SECURITYGROUPLIST¶
The IDs of the security groups. Security groups aren't added by default. You can add a security group to apply network level controls to control which resources in a VPC are allowed to access the service network and its services. For more information, see Control traffic to resources using security groups in the Amazon VPC User Guide.
it_tags TYPE /AWS1/CL_VL_TAGMAP_W=>TT_TAGMAP TT_TAGMAP¶
The tags for the association.
io_dnsoptions TYPE REF TO /AWS1/CL_VL_DNSOPTIONS /AWS1/CL_VL_DNSOPTIONS¶
DNS options for the service network VPC association.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_vl_cresvcnetworkvpc01 /AWS1/CL_VL_CRESVCNETWORKVPC01¶
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->cresvcnetworkvpcassociation(
io_dnsoptions = new /aws1/cl_vl_dnsoptions(
it_pvtdnsspecifieddomains = VALUE /aws1/cl_vl_pvtdnsspecifiedd00=>tt_pvtdnsspecifieddomainslist(
( new /aws1/cl_vl_pvtdnsspecifiedd00( |string| ) )
)
iv_privatednspreference = |string|
)
it_securitygroupids = VALUE /aws1/cl_vl_secgrouplist_w=>tt_securitygrouplist(
( new /aws1/cl_vl_secgrouplist_w( |string| ) )
)
it_tags = VALUE /aws1/cl_vl_tagmap_w=>tt_tagmap(
(
VALUE /aws1/cl_vl_tagmap_w=>ts_tagmap_maprow(
value = new /aws1/cl_vl_tagmap_w( |string| )
key = |string|
)
)
)
iv_clienttoken = |string|
iv_privatednsenabled = ABAP_TRUE
iv_servicenetworkidentifier = |string|
iv_vpcidentifier = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_servicenetworkvpcassoci = lo_result->get_id( ).
lv_servicenetworkvpcassoci_1 = lo_result->get_status( ).
lv_servicenetworkvpcassoci_2 = lo_result->get_arn( ).
lv_accountid = lo_result->get_createdby( ).
LOOP AT lo_result->get_securitygroupids( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_securitygroupid = lo_row_1->get_value( ).
ENDIF.
ENDLOOP.
lv_boolean = lo_result->get_privatednsenabled( ).
lo_dnsoptions = lo_result->get_dnsoptions( ).
IF lo_dnsoptions IS NOT INITIAL.
lv_privatednspreference = lo_dnsoptions->get_privatednspreference( ).
LOOP AT lo_dnsoptions->get_pvtdnsspecifieddomains( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_privatednsspecifieddoma = lo_row_3->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.