createAssociationBatch method

Future<CreateAssociationBatchResult> createAssociationBatch({
  1. required List<CreateAssociationBatchRequestEntry> entries,
})

Associates the specified Systems Manager document with the specified instances or targets.

When you associate a document with one or more instances using instance IDs or tags, SSM Agent running on the instance processes the document and configures the instance as specified.

If you associate a document with an instance that already has an associated document, the system returns the AssociationAlreadyExists exception.

May throw InternalServerError. May throw InvalidDocument. May throw InvalidDocumentVersion. May throw InvalidInstanceId. May throw InvalidParameters. May throw DuplicateInstanceId. May throw AssociationLimitExceeded. May throw UnsupportedPlatformType. May throw InvalidOutputLocation. May throw InvalidTarget. May throw InvalidSchedule.

Parameter entries : One or more associations.

Implementation

Future<CreateAssociationBatchResult> createAssociationBatch({
  required List<CreateAssociationBatchRequestEntry> entries,
}) async {
  ArgumentError.checkNotNull(entries, 'entries');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.CreateAssociationBatch'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Entries': entries,
    },
  );

  return CreateAssociationBatchResult.fromJson(jsonResponse.body);
}