putUserPermissionsBoundary method

Future<void> putUserPermissionsBoundary({
  1. required String permissionsBoundary,
  2. required String userName,
})

Adds or updates the policy that is specified as the IAM user's permissions boundary. You can use an AWS managed policy or a customer managed policy to set the boundary for a user. Use the boundary to control the maximum permissions that the user can have. Setting a permissions boundary is an advanced feature that can affect the permissions for the user.

May throw NoSuchEntityException. May throw InvalidInputException. May throw PolicyNotAttachableException. May throw ServiceFailureException.

Parameter permissionsBoundary : The ARN of the policy that is used to set the permissions boundary for the user.

Parameter userName : The name (friendly name, not ARN) of the IAM user for which you want to set the permissions boundary.

Implementation

Future<void> putUserPermissionsBoundary({
  required String permissionsBoundary,
  required String userName,
}) async {
  ArgumentError.checkNotNull(permissionsBoundary, 'permissionsBoundary');
  _s.validateStringLength(
    'permissionsBoundary',
    permissionsBoundary,
    20,
    2048,
    isRequired: true,
  );
  ArgumentError.checkNotNull(userName, 'userName');
  _s.validateStringLength(
    'userName',
    userName,
    1,
    64,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['PermissionsBoundary'] = permissionsBoundary;
  $request['UserName'] = userName;
  await _protocol.send(
    $request,
    action: 'PutUserPermissionsBoundary',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['PutUserPermissionsBoundaryRequest'],
    shapes: shapes,
  );
}