modifyClusterIamRoles method

Future<ModifyClusterIamRolesResult> modifyClusterIamRoles({
  1. required String clusterIdentifier,
  2. List<String>? addIamRoles,
  3. List<String>? removeIamRoles,
})

Modifies the list of AWS Identity and Access Management (IAM) roles that can be used by the cluster to access other AWS services.

A cluster can have up to 10 IAM roles associated at any time.

May throw InvalidClusterStateFault. May throw ClusterNotFoundFault.

Parameter clusterIdentifier : The unique identifier of the cluster for which you want to associate or disassociate IAM roles.

Parameter addIamRoles : Zero or more IAM roles to associate with the cluster. The roles must be in their Amazon Resource Name (ARN) format. You can associate up to 10 IAM roles with a single cluster in a single request.

Parameter removeIamRoles : Zero or more IAM roles in ARN format to disassociate from the cluster. You can disassociate up to 10 IAM roles from a single cluster in a single request.

Implementation

Future<ModifyClusterIamRolesResult> modifyClusterIamRoles({
  required String clusterIdentifier,
  List<String>? addIamRoles,
  List<String>? removeIamRoles,
}) async {
  ArgumentError.checkNotNull(clusterIdentifier, 'clusterIdentifier');
  _s.validateStringLength(
    'clusterIdentifier',
    clusterIdentifier,
    0,
    2147483647,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['ClusterIdentifier'] = clusterIdentifier;
  addIamRoles?.also((arg) => $request['AddIamRoles'] = arg);
  removeIamRoles?.also((arg) => $request['RemoveIamRoles'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'ModifyClusterIamRoles',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ModifyClusterIamRolesMessage'],
    shapes: shapes,
    resultWrapper: 'ModifyClusterIamRolesResult',
  );
  return ModifyClusterIamRolesResult.fromXml($result);
}