assign_permission_set
¶
assign_permission_set(
environment_arn: EnvironmentArn,
principal_type: PrincipalType,
principal_id: PrincipalId,
permission_set_id: PermissionSetId,
*,
config_overrides: Optional[AssuranceClientConfig] = None,
scopes: Optional[AssignmentScopeList] = None,
) -> AssignPermissionSetOutput
Assigns a permission set to a principal with optional scopes.
Parameters:
-
environment_arn(EnvironmentArn) –The ARN of this governance environment.
-
principal_type(PrincipalType) –The type of principal the permission set is assigned to.
-
principal_id(PrincipalId) –The unique identifier of the principal the permission set is assigned to.
-
permission_set_id(PermissionSetId) –The identifier of the permission set.
-
scopes(Optional[AssignmentScopeList], default:None) –The scopes the assignment applies to.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.
-
ConflictException–A conflict occurred (for example, resource already exists).
-
InternalServerException–An internal server error occurred.
-
ResourceNotFoundException–The requested resource was not found.
-
ThrottlingException–The request was throttled.
-
ValidationException–The request failed validation.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Assign a permission set Assigns the payments auditor permission set to an auditor's IAM Identity Center user, scoped to the payments-prod project.
>>> client.assign_permission_set(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', principal_type='USER', principal_id='a1b2c3d4-5678-90ab-cdef-EXAMPLE12345', permission_set_id='a1b2c3d4-5678-90ab-cdef-EXAMPLE88888', scopes=[{'type': 'PROJECT', 'id': 'payments-prod'}])