createAssociationBatch method
Associates the specified Amazon Web Services Systems Manager document (SSM document) with the specified managed nodes or targets.
When you associate a document with one or more managed nodes using IDs or tags, Amazon Web Services Systems Manager Agent (SSM Agent) running on the managed node processes the document and configures the node as specified.
If you associate a document with a managed node that already has an associated document, the system returns the AssociationAlreadyExists exception.
May throw AssociationLimitExceeded.
May throw DuplicateInstanceId.
May throw InternalServerError.
May throw InvalidDocument.
May throw InvalidDocumentVersion.
May throw InvalidInstanceId.
May throw InvalidOutputLocation.
May throw InvalidParameters.
May throw InvalidSchedule.
May throw InvalidTarget.
May throw InvalidTargetMaps.
May throw UnsupportedPlatformType.
Parameter entries :
One or more associations.
Parameter associationDispatchAssumeRole :
A role used by association to take actions on your behalf. State Manager
will assume this role and call required APIs when dispatching
configurations to nodes. If not specified,
service-linked role for Systems Manager will be used by default.
Service-linked role support in State Manager is being phased out. Associations relying on service-linked role may require updates in the future to continue functioning properly.
Implementation
Future<CreateAssociationBatchResult> createAssociationBatch({
required List<CreateAssociationBatchRequestEntry> entries,
String? associationDispatchAssumeRole,
}) async {
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,
if (associationDispatchAssumeRole != null)
'AssociationDispatchAssumeRole': associationDispatchAssumeRole,
},
);
return CreateAssociationBatchResult.fromJson(jsonResponse.body);
}