Skip to content

/AWS1/IF_PCY=>ADDKEYREPLICATIONREGIONS()

About AddKeyReplicationRegions

Adds replication Amazon Web Services Regions to an existing Amazon Web Services Payment Cryptography key, enabling the key to be used for cryptographic operations in additional Amazon Web Services Regions.

Multi-region keys allow you to use the same key material across multiple Amazon Web Services Regions, providing lower latency for applications distributed across regions. When you add Replication Regions, Amazon Web Services Payment Cryptography securely replicates the key material to the specified Amazon Web Services Regions.

The key must be in an active state to add Replication Regions. You can add multiple regions in a single operation, and the key will be available for use in those regions once replication is complete.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

Method Signature

IMPORTING

Required arguments:

iv_keyidentifier TYPE /AWS1/PCYKEYARNORKEYALIASTYPE /AWS1/PCYKEYARNORKEYALIASTYPE

The key identifier (ARN or alias) of the key for which to add replication regions.

This key must exist and be in a valid state for replication operations.

it_replicationregions TYPE /AWS1/CL_PCYREGIONS_W=>TT_REGIONS TT_REGIONS

The list of Amazon Web Services Regions to add to the key's replication configuration.

Each region must be a valid Amazon Web Services Region where Amazon Web Services Payment Cryptography is available. The key will be replicated to these regions, allowing cryptographic operations to be performed closer to your applications.

RETURNING

oo_output TYPE REF TO /aws1/cl_pcyaddkeyreplrgnsout /AWS1/CL_PCYADDKEYREPLRGNSOUT

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_pcy~addkeyreplicationregions(
  it_replicationregions = VALUE /aws1/cl_pcyregions_w=>tt_regions(
    ( new /aws1/cl_pcyregions_w( |string| ) )
  )
  iv_keyidentifier = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_key = lo_result->get_key( ).
  IF lo_key IS NOT INITIAL.
    lv_keyarn = lo_key->get_keyarn( ).
    lo_keyattributes = lo_key->get_keyattributes( ).
    IF lo_keyattributes IS NOT INITIAL.
      lv_keyusage = lo_keyattributes->get_keyusage( ).
      lv_keyclass = lo_keyattributes->get_keyclass( ).
      lv_keyalgorithm = lo_keyattributes->get_keyalgorithm( ).
      lo_keymodesofuse = lo_keyattributes->get_keymodesofuse( ).
      IF lo_keymodesofuse IS NOT INITIAL.
        lv_primitiveboolean = lo_keymodesofuse->get_encrypt( ).
        lv_primitiveboolean = lo_keymodesofuse->get_decrypt( ).
        lv_primitiveboolean = lo_keymodesofuse->get_wrap( ).
        lv_primitiveboolean = lo_keymodesofuse->get_unwrap( ).
        lv_primitiveboolean = lo_keymodesofuse->get_generate( ).
        lv_primitiveboolean = lo_keymodesofuse->get_sign( ).
        lv_primitiveboolean = lo_keymodesofuse->get_verify( ).
        lv_primitiveboolean = lo_keymodesofuse->get_derivekey( ).
        lv_primitiveboolean = lo_keymodesofuse->get_norestrictions( ).
      ENDIF.
    ENDIF.
    lv_keycheckvalue = lo_key->get_keycheckvalue( ).
    lv_keycheckvaluealgorithm = lo_key->get_keycheckvaluealgorithm( ).
    lv_boolean = lo_key->get_enabled( ).
    lv_boolean = lo_key->get_exportable( ).
    lv_keystate = lo_key->get_keystate( ).
    lv_keyorigin = lo_key->get_keyorigin( ).
    lv_timestamp = lo_key->get_createtimestamp( ).
    lv_timestamp = lo_key->get_usagestarttimestamp( ).
    lv_timestamp = lo_key->get_usagestoptimestamp( ).
    lv_timestamp = lo_key->get_deletependingtimestamp( ).
    lv_timestamp = lo_key->get_deletetimestamp( ).
    lv_derivekeyusage = lo_key->get_derivekeyusage( ).
    lv_multiregionkeytype = lo_key->get_multiregionkeytype( ).
    lv_region = lo_key->get_primaryregion( ).
    LOOP AT lo_key->get_replicationstatus( ) into ls_row.
      lv_key_1 = ls_row-key.
      lo_value = ls_row-value.
      IF lo_value IS NOT INITIAL.
        lv_keyreplicationstate = lo_value->get_status( ).
        lv_string = lo_value->get_statusmessage( ).
      ENDIF.
    ENDLOOP.
    lv_boolean = lo_key->get_usingdefaultreplregions( ).
  ENDIF.
ENDIF.