putRolePermissionsBoundary method
Adds or updates the policy that is specified as the IAM role's permissions boundary. You can use an AWS managed policy or a customer managed policy to set the boundary for a role. Use the boundary to control the maximum permissions that the role can have. Setting a permissions boundary is an advanced feature that can affect the permissions for the role.
You cannot set the boundary for a service-linked role.
May throw NoSuchEntityException. May throw InvalidInputException. May throw UnmodifiableEntityException. May throw PolicyNotAttachableException. May throw ServiceFailureException.
Parameter permissionsBoundary
:
The ARN of the policy that is used to set the permissions boundary for the
role.
Parameter roleName
:
The name (friendly name, not ARN) of the IAM role for which you want to
set the permissions boundary.
Implementation
Future<void> putRolePermissionsBoundary({
required String permissionsBoundary,
required String roleName,
}) async {
ArgumentError.checkNotNull(permissionsBoundary, 'permissionsBoundary');
_s.validateStringLength(
'permissionsBoundary',
permissionsBoundary,
20,
2048,
isRequired: true,
);
ArgumentError.checkNotNull(roleName, 'roleName');
_s.validateStringLength(
'roleName',
roleName,
1,
64,
isRequired: true,
);
final $request = <String, dynamic>{};
$request['PermissionsBoundary'] = permissionsBoundary;
$request['RoleName'] = roleName;
await _protocol.send(
$request,
action: 'PutRolePermissionsBoundary',
version: '2010-05-08',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['PutRolePermissionsBoundaryRequest'],
shapes: shapes,
);
}