removeKeyReplicationRegions method

Future<RemoveKeyReplicationRegionsOutput> removeKeyReplicationRegions({
  1. required String keyIdentifier,
  2. required List<String> replicationRegions,
})

Removes Replication Regions from an existing Amazon Web Services Payment Cryptography key, disabling the key's availability for cryptographic operations in the specified Amazon Web Services Regions.

When you remove Replication Regions, the key material is securely deleted from those regions and can no longer be used for cryptographic operations there. This operation is irreversible for the specified Amazon Web Services Regions. For more information, see Multi-Region key replication. Cross-account use: This operation supports cross-account use when the key has a resource-based policy that grants access. For more information, see Resource-based policies.

Related operations:

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter keyIdentifier : The key identifier (ARN or alias) of the key from which to remove replication regions.

This key must exist and have replication enabled in the specified regions.

Parameter replicationRegions : The list of Amazon Web Services Regions to remove from the key's replication configuration.

The key will no longer be available for cryptographic operations in these regions after removal. Ensure no active operations depend on the key in these regions before removal.

Implementation

Future<RemoveKeyReplicationRegionsOutput> removeKeyReplicationRegions({
  required String keyIdentifier,
  required List<String> replicationRegions,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target':
        'PaymentCryptographyControlPlane.RemoveKeyReplicationRegions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'KeyIdentifier': keyIdentifier,
      'ReplicationRegions': replicationRegions,
    },
  );

  return RemoveKeyReplicationRegionsOutput.fromJson(jsonResponse.body);
}