deleteAssociation method

Future<void> deleteAssociation({
  1. String? associationId,
  2. String? instanceId,
  3. String? name,
})

Disassociates the specified Systems Manager document from the specified instance.

When you disassociate a document from an instance, it does not change the configuration of the instance. To change the configuration state of an instance after you disassociate a document, you must create a new document with the desired configuration and associate it with the instance.

May throw AssociationDoesNotExist. May throw InternalServerError. May throw InvalidDocument. May throw InvalidInstanceId. May throw TooManyUpdates.

Parameter associationId : The association ID that you want to delete.

Parameter instanceId : The ID of the instance.

Parameter name : The name of the Systems Manager document.

Implementation

Future<void> deleteAssociation({
  String? associationId,
  String? instanceId,
  String? name,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.DeleteAssociation'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (associationId != null) 'AssociationId': associationId,
      if (instanceId != null) 'InstanceId': instanceId,
      if (name != null) 'Name': name,
    },
  );
}