enableDefaultKeyReplicationRegions method

Future<EnableDefaultKeyReplicationRegionsOutput> enableDefaultKeyReplicationRegions({
  1. required List<String> replicationRegions,
})

Enables Multi-Region key replication settings for your Amazon Web Services account, causing new keys to be automatically replicated to the specified Amazon Web Services Regions when created.

When Multi-Region key replication are enabled, any new keys created in your account will automatically be replicated to these regions unless you explicitly override this behavior during key creation. This simplifies key management for applications that operate across multiple regions.

Existing keys are not affected by this operation - only keys created after enabling default replication will be automatically replicated.

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

Related operations:

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

Parameter replicationRegions : The list of Amazon Web Services Regions to enable as default replication regions for the Amazon Web Services account for Multi-Region key replication.

New keys created in this account will automatically be replicated to these regions unless explicitly overridden during key creation.

Implementation

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

  return EnableDefaultKeyReplicationRegionsOutput.fromJson(jsonResponse.body);
}