disassociateKmsKey method

Future<void> disassociateKmsKey({
  1. required String logGroupName,
})

Disassociates the associated AWS Key Management Service (AWS KMS) customer master key (CMK) from the specified log group.

After the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested.

Note that it can take up to 5 minutes for this operation to take effect.

May throw InvalidParameterException. May throw ResourceNotFoundException. May throw OperationAbortedException. May throw ServiceUnavailableException.

Parameter logGroupName : The name of the log group.

Implementation

Future<void> disassociateKmsKey({
  required String logGroupName,
}) async {
  ArgumentError.checkNotNull(logGroupName, 'logGroupName');
  _s.validateStringLength(
    'logGroupName',
    logGroupName,
    1,
    512,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Logs_20140328.DisassociateKmsKey'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'logGroupName': logGroupName,
    },
  );
}