/AWS1/IF_XDD=>CREATECLUSTER()¶
About CreateCluster¶
The CreateCluster API allows you to create both single-Region clusters and multi-Region clusters. With the addition of the multiRegionProperties parameter, you can create a cluster with witness Region support and establish peer relationships with clusters in other Regions during creation.
Creating multi-Region clusters requires additional IAM permissions beyond those needed for single-Region clusters, as detailed in the Required permissions section below.
Required permissions
- dsql:CreateCluster
-
Required to create a cluster.
Resources:
arn:aws:dsql:region:account-id:cluster/* - dsql:TagResource
-
Permission to add tags to a resource.
Resources:
arn:aws:dsql:region:account-id:cluster/* - dsql:PutMultiRegionProperties
-
Permission to configure multi-Region properties for a cluster.
Resources:
arn:aws:dsql:region:account-id:cluster/* - dsql:AddPeerCluster
-
When specifying
multiRegionProperties.clusters, permission to add peer clusters.Resources:
-
Local cluster:
arn:aws:dsql:region:account-id:cluster/* -
Each peer cluster: exact ARN of each specified peer cluster
-
- dsql:PutWitnessRegion
-
When specifying
multiRegionProperties.witnessRegion, permission to set a witness Region. This permission is checked both in the cluster Region and in the witness Region.Resources:
arn:aws:dsql:region:account-id:cluster/*Condition Keys:
dsql:WitnessRegion(matching the specified witness region)
-
The witness Region specified in
multiRegionProperties.witnessRegioncannot be the same as the cluster's Region.
Method Signature¶
METHODS /AWS1/IF_XDD~CREATECLUSTER
IMPORTING
!IV_DELETIONPROTECTIONENABLED TYPE /AWS1/XDDDELETIONPROTECTIONE00 OPTIONAL
!IV_KMSENCRYPTIONKEY TYPE /AWS1/XDDKMSENCRYPTIONKEY OPTIONAL
!IT_TAGS TYPE /AWS1/CL_XDDTAGMAP_W=>TT_TAGMAP OPTIONAL
!IV_CLIENTTOKEN TYPE /AWS1/XDDCLIENTTOKEN OPTIONAL
!IO_MULTIREGIONPROPERTIES TYPE REF TO /AWS1/CL_XDDMULTIREGIONPROPS OPTIONAL
!IV_POLICY TYPE /AWS1/XDDPOLICYDOCUMENT OPTIONAL
!IV_BYPASSPLYLOCKOUTSAFETYCHK TYPE /AWS1/XDDBYPASSPLYLKOUTSAFET00 OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_xddcreateclustoutput
RAISING
/AWS1/CX_XDDACCESSDENIEDEX
/AWS1/CX_XDDINTERNALSERVEREX
/AWS1/CX_XDDTHROTTLINGEX
/AWS1/CX_XDDVALIDATIONEX
/AWS1/CX_XDDCONFLICTEXCEPTION
/AWS1/CX_XDDSERVICEQUOTAEXCDEX
/AWS1/CX_XDDCLIENTEXC
/AWS1/CX_XDDSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Optional arguments:¶
iv_deletionprotectionenabled TYPE /AWS1/XDDDELETIONPROTECTIONE00 /AWS1/XDDDELETIONPROTECTIONE00¶
If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.
iv_kmsencryptionkey TYPE /AWS1/XDDKMSENCRYPTIONKEY /AWS1/XDDKMSENCRYPTIONKEY¶
The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.
it_tags TYPE /AWS1/CL_XDDTAGMAP_W=>TT_TAGMAP TT_TAGMAP¶
A map of key and value pairs to use to tag your cluster.
iv_clienttoken TYPE /AWS1/XDDCLIENTTOKEN /AWS1/XDDCLIENTTOKEN¶
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.
If you don't specify a client token, the Amazon Web Services SDK automatically generates one.
io_multiregionproperties TYPE REF TO /AWS1/CL_XDDMULTIREGIONPROPS /AWS1/CL_XDDMULTIREGIONPROPS¶
The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.
iv_policy TYPE /AWS1/XDDPOLICYDOCUMENT /AWS1/XDDPOLICYDOCUMENT¶
An optional resource-based policy document in JSON format that defines access permissions for the cluster.
iv_bypassplylockoutsafetychk TYPE /AWS1/XDDBYPASSPLYLKOUTSAFET00 /AWS1/XDDBYPASSPLYLKOUTSAFET00¶
An optional field that controls whether to bypass the lockout prevention check. When set to true, this parameter allows you to apply a policy that might lock you out of the cluster. Use with caution.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_xddcreateclustoutput /AWS1/CL_XDDCREATECLUSTOUTPUT¶
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->createcluster(
io_multiregionproperties = new /aws1/cl_xddmultiregionprops(
it_clusters = VALUE /aws1/cl_xddclusterarnlist_w=>tt_clusterarnlist(
( new /aws1/cl_xddclusterarnlist_w( |string| ) )
)
iv_witnessregion = |string|
)
it_tags = VALUE /aws1/cl_xddtagmap_w=>tt_tagmap(
(
VALUE /aws1/cl_xddtagmap_w=>ts_tagmap_maprow(
key = |string|
value = new /aws1/cl_xddtagmap_w( |string| )
)
)
)
iv_bypassplylockoutsafetychk = ABAP_TRUE
iv_clienttoken = |string|
iv_deletionprotectionenabled = ABAP_TRUE
iv_kmsencryptionkey = |string|
iv_policy = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_clusterid = lo_result->get_identifier( ).
lv_clusterarn = lo_result->get_arn( ).
lv_clusterstatus = lo_result->get_status( ).
lv_clustercreationtime = lo_result->get_creationtime( ).
lo_multiregionproperties = lo_result->get_multiregionproperties( ).
IF lo_multiregionproperties IS NOT INITIAL.
lv_region = lo_multiregionproperties->get_witnessregion( ).
LOOP AT lo_multiregionproperties->get_clusters( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_clusterarn = lo_row_1->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.
lo_encryptiondetails = lo_result->get_encryptiondetails( ).
IF lo_encryptiondetails IS NOT INITIAL.
lv_encryptiontype = lo_encryptiondetails->get_encryptiontype( ).
lv_kmskeyarn = lo_encryptiondetails->get_kmskeyarn( ).
lv_encryptionstatus = lo_encryptiondetails->get_encryptionstatus( ).
ENDIF.
lv_deletionprotectionenabl = lo_result->get_deletionprotectionenbd( ).
lv_endpoint = lo_result->get_endpoint( ).
ENDIF.
Create Cluster¶
Create Cluster
DATA(lo_result) = lo_client->createcluster(
it_tags = VALUE /aws1/cl_xddtagmap_w=>tt_tagmap(
(
VALUE /aws1/cl_xddtagmap_w=>ts_tagmap_maprow(
key = |MyKey|
value = new /aws1/cl_xddtagmap_w( |MyValue| )
)
)
)
iv_deletionprotectionenabled = ABAP_FALSE
).