addKeyReplicationRegions method
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 key replication 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 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 for which to add replication
regions.
This key must exist and be in a valid state for replication operations.
Parameter replicationRegions :
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.
Implementation
Future<AddKeyReplicationRegionsOutput> addKeyReplicationRegions({
required String keyIdentifier,
required List<String> replicationRegions,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'PaymentCryptographyControlPlane.AddKeyReplicationRegions'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'KeyIdentifier': keyIdentifier,
'ReplicationRegions': replicationRegions,
},
);
return AddKeyReplicationRegionsOutput.fromJson(jsonResponse.body);
}