disassociateDatasetKmsKey method
Removes the customer managed Amazon Web Services Key Management Service (Amazon Web Services KMS) key association from the specified dataset. After this operation completes, data that you publish to the dataset is encrypted at rest using an Amazon Web Services owned key managed by Amazon CloudWatch.
Only the default dataset is supported. To call this
operation, the dataset must currently have a customer managed KMS key
associated with it. If the dataset has no associated KMS key, the
operation fails with ResourceNotFoundException.
Amazon CloudWatch performs a dry-run kms:Decrypt call on the
key as part of this operation. This verifies that the caller is authorized
to use the currently associated key. The caller must have
kms:Decrypt permission on the currently associated key, and
the key must be enabled and accessible. If the key has been disabled or
scheduled for deletion, you must first re-enable or restore it before you
can disassociate it from the dataset.
For more information about using customer managed keys with Amazon
CloudWatch, see Encryption
at rest with customer managed keys in the Amazon CloudWatch User
Guide.
May throw ConflictException.
May throw ResourceNotFoundException.
Parameter datasetIdentifier :
Specifies the identifier of the dataset from which to remove the KMS key
association. For the default dataset, you can specify either
default or the full dataset Amazon Resource Name (ARN) in the
format
arn:aws:cloudwatch:Region:account-id:dataset/default.
Implementation
Future<void> disassociateDatasetKmsKey({
required String datasetIdentifier,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'GraniteServiceVersion20100801.DisassociateDatasetKmsKey'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DatasetIdentifier': datasetIdentifier,
},
);
}