:doc:`IdentityStore <../../identitystore>` / Client / create_group_membership

***********************
create_group_membership
***********************



.. py:method:: IdentityStore.Client.create_group_membership(**kwargs)

  

  Creates a relationship between a member and a group. The following identifiers must be specified: ``GroupId``, ``IdentityStoreId``, and ``MemberId``.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/identitystore-2020-06-15/CreateGroupMembership>`_  


  **Request Syntax**
  ::

    response = client.create_group_membership(
        IdentityStoreId='string',
        GroupId='string',
        MemberId={
            'UserId': 'string'
        }
    )
    
  :type IdentityStoreId: string
  :param IdentityStoreId: **[REQUIRED]** 

    The globally unique identifier for the identity store.

    

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

    The identifier for a group in the identity store.

    

  
  :type MemberId: dict
  :param MemberId: **[REQUIRED]** 

    An object that contains the identifier of a group member. Setting the ``UserID`` field to the specific identifier for a user indicates that the user is a member of the group.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``UserId``. 

  
    - **UserId** *(string) --* 

      An object containing the identifiers of resources that can be members.

      

    
  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'MembershipId': 'string',
          'IdentityStoreId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **MembershipId** *(string) --* 

        The identifier for a newly created ``GroupMembership`` in an identity store.

        
      

      - **IdentityStoreId** *(string) --* 

        The globally unique identifier for the identity store.

        
  
  **Exceptions**
  
  *   :py:class:`IdentityStore.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`IdentityStore.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IdentityStore.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`IdentityStore.Client.exceptions.ConflictException`

  
  *   :py:class:`IdentityStore.Client.exceptions.InternalServerException`

  
  *   :py:class:`IdentityStore.Client.exceptions.ValidationException`

  
  *   :py:class:`IdentityStore.Client.exceptions.ServiceQuotaExceededException`

  