deleteDocument method
Deletes the Amazon Web Services Systems Manager document (SSM document) and all managed node associations to the document.
Before you delete the document, we recommend that you use DeleteAssociation to disassociate all managed nodes that are associated with the document.
May throw AssociatedInstances.
May throw InternalServerError.
May throw InvalidDocument.
May throw InvalidDocumentOperation.
May throw TooManyUpdates.
Parameter name :
The name of the document.
Parameter documentVersion :
The version of the document that you want to delete. If not provided, all
versions of the document are deleted.
Parameter force :
Some SSM document types require that you specify a Force flag
before you can delete the document. For example, you must specify a
Force flag to delete a document of type
ApplicationConfigurationSchema. You can restrict access to
the Force flag in an Identity and Access Management (IAM)
policy.
Parameter versionName :
The version name of the document that you want to delete. If not provided,
all versions of the document are deleted.
Implementation
Future<void> deleteDocument({
required String name,
String? documentVersion,
bool? force,
String? versionName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonSSM.DeleteDocument'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Name': name,
if (documentVersion != null) 'DocumentVersion': documentVersion,
if (force != null) 'Force': force,
if (versionName != null) 'VersionName': versionName,
},
);
}