startActivityStream method

Future<StartActivityStreamResponse> startActivityStream({
  1. required String kmsKeyId,
  2. required ActivityStreamMode mode,
  3. required String resourceArn,
  4. bool? applyImmediately,
})

Starts a database activity stream to monitor activity on the database. For more information, see Database Activity Streams in the Amazon Aurora User Guide.

May throw InvalidDBInstanceStateFault. May throw InvalidDBClusterStateFault. May throw ResourceNotFoundFault. May throw DBClusterNotFoundFault. May throw DBInstanceNotFoundFault. May throw KMSKeyNotAccessibleFault.

Parameter kmsKeyId : The AWS KMS key identifier for encrypting messages in the database activity stream. The AWS KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the AWS KMS customer master key (CMK).

Parameter mode : Specifies the mode of the database activity stream. Database events such as a change or access generate an activity stream event. The database session can handle these events either synchronously or asynchronously.

Parameter resourceArn : The Amazon Resource Name (ARN) of the DB cluster, for example, arn:aws:rds:us-east-1:12345667890:cluster:das-cluster.

Parameter applyImmediately : Specifies whether or not the database activity stream is to start as soon as possible, regardless of the maintenance window for the database.

Implementation

Future<StartActivityStreamResponse> startActivityStream({
  required String kmsKeyId,
  required ActivityStreamMode mode,
  required String resourceArn,
  bool? applyImmediately,
}) async {
  ArgumentError.checkNotNull(kmsKeyId, 'kmsKeyId');
  ArgumentError.checkNotNull(mode, 'mode');
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  final $request = <String, dynamic>{};
  $request['KmsKeyId'] = kmsKeyId;
  $request['Mode'] = mode.toValue();
  $request['ResourceArn'] = resourceArn;
  applyImmediately?.also((arg) => $request['ApplyImmediately'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'StartActivityStream',
    version: '2014-10-31',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['StartActivityStreamRequest'],
    shapes: shapes,
    resultWrapper: 'StartActivityStreamResult',
  );
  return StartActivityStreamResponse.fromXml($result);
}