updateCluster method

Future<UpdateClusterOutput> updateCluster({
  1. required String identifier,
  2. String? clientToken,
  3. bool? deletionProtectionEnabled,
  4. String? kmsEncryptionKey,
  5. MultiRegionProperties? multiRegionProperties,
})

The UpdateCluster API allows you to modify both single-Region and multi-Region cluster configurations. With the multiRegionProperties parameter, you can add or modify witness Region support and manage peer relationships with clusters in other Regions. Required permissions

dsql:UpdateCluster
Permission to update a DSQL cluster.

Resources: arn:aws:dsql:region:account-id:cluster/cluster-id

dsql:PutMultiRegionProperties
Permission to configure multi-Region properties for a cluster.

Resources: arn:aws:dsql:region:account-id:cluster/cluster-id

dsql:GetCluster
Permission to retrieve cluster information.

Resources: arn:aws:dsql:region:account-id:cluster/cluster-id

dsql:AddPeerCluster
Permission to add peer clusters.

Resources:

  • Local cluster: arn:aws:dsql:region:account-id:cluster/cluster-id
  • Each peer cluster: exact ARN of each specified peer cluster
dsql:RemovePeerCluster
Permission to remove peer clusters. The dsql:RemovePeerCluster permission uses a wildcard ARN pattern to simplify permission management during updates.

Resources: arn:aws:dsql::account-id:cluster/

dsql:PutWitnessRegion
Permission to set a witness Region.

Resources: arn:aws:dsql:region:account-id:cluster/cluster-id

Condition Keys: dsql:WitnessRegion (matching the specified witness Region)

This permission is checked both in the cluster Region and in the witness Region.

May throw ConflictException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter identifier : The ID of the cluster you want to update.

Parameter clientToken : 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.

Parameter deletionProtectionEnabled : Specifies whether to enable deletion protection in your cluster.

Parameter kmsEncryptionKey : 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.

Parameter multiRegionProperties : The new multi-Region cluster configuration settings to be applied during an update operation.

Implementation

Future<UpdateClusterOutput> updateCluster({
  required String identifier,
  String? clientToken,
  bool? deletionProtectionEnabled,
  String? kmsEncryptionKey,
  MultiRegionProperties? multiRegionProperties,
}) async {
  final $payload = <String, dynamic>{
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (deletionProtectionEnabled != null)
      'deletionProtectionEnabled': deletionProtectionEnabled,
    if (kmsEncryptionKey != null) 'kmsEncryptionKey': kmsEncryptionKey,
    if (multiRegionProperties != null)
      'multiRegionProperties': multiRegionProperties,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/cluster/${Uri.encodeComponent(identifier)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateClusterOutput.fromJson(response);
}