:doc:`EMR <../../emr>` / Client / create_studio_session_mapping

*****************************
create_studio_session_mapping
*****************************



.. py:method:: EMR.Client.create_studio_session_mapping(**kwargs)

  

  Maps a user or group to the Amazon EMR Studio specified by ``StudioId``, and applies a session policy to refine Studio permissions for that user or group. Use ``CreateStudioSessionMapping`` to assign users to a Studio when you use IAM Identity Center authentication. For instructions on how to assign users to a Studio when you use IAM authentication, see `Assign a user or group to your EMR Studio <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-studio-manage-users.html#emr-studio-assign-users-groups>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CreateStudioSessionMapping>`_  


  **Request Syntax**
  ::

    response = client.create_studio_session_mapping(
        StudioId='string',
        IdentityId='string',
        IdentityName='string',
        IdentityType='USER'|'GROUP',
        SessionPolicyArn='string'
    )
    
  :type StudioId: string
  :param StudioId: **[REQUIRED]** 

    The ID of the Amazon EMR Studio to which the user or group will be mapped.

    

  
  :type IdentityId: string
  :param IdentityId: 

    The globally unique identifier (GUID) of the user or group from the IAM Identity Center Identity Store. For more information, see `UserId <https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html#singlesignon-Type-User-UserId>`__ and `GroupId <https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_Group.html#singlesignon-Type-Group-GroupId>`__ in the *IAM Identity Center Identity Store API Reference*. Either ``IdentityName`` or ``IdentityId`` must be specified, but not both.

    

  
  :type IdentityName: string
  :param IdentityName: 

    The name of the user or group. For more information, see `UserName <https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html#singlesignon-Type-User-UserName>`__ and `DisplayName <https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_Group.html#singlesignon-Type-Group-DisplayName>`__ in the *IAM Identity Center Identity Store API Reference*. Either ``IdentityName`` or ``IdentityId`` must be specified, but not both.

    

  
  :type IdentityType: string
  :param IdentityType: **[REQUIRED]** 

    Specifies whether the identity to map to the Amazon EMR Studio is a user or a group.

    

  
  :type SessionPolicyArn: string
  :param SessionPolicyArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) for the session policy that will be applied to the user or group. You should specify the ARN for the session policy that you want to apply, not the ARN of your user role. For more information, see `Create an Amazon EMR Studio User Role with Session Policies <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-studio-user-role.html>`__.

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`EMR.Client.exceptions.InternalServerError`

  
  *   :py:class:`EMR.Client.exceptions.InvalidRequestException`

  