:doc:`Cloud9 <../../cloud9>` / Client / create_environment_membership

*****************************
create_environment_membership
*****************************



.. py:method:: Cloud9.Client.create_environment_membership(**kwargs)

  

  Adds an environment member to an Cloud9 development environment.

   

  .. warning::

     

    Cloud9 is no longer available to new customers. Existing customers of Cloud9 can continue to use the service as normal. `Learn more" <http://aws.amazon.com/blogs/devops/how-to-migrate-from-aws-cloud9-to-aws-ide-toolkits-or-aws-cloudshell/>`__

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/CreateEnvironmentMembership>`_  


  **Request Syntax**
  ::

    response = client.create_environment_membership(
        environmentId='string',
        userArn='string',
        permissions='read-write'|'read-only'
    )
    
  :type environmentId: string
  :param environmentId: **[REQUIRED]** 

    The ID of the environment that contains the environment member you want to add.

    

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

    The Amazon Resource Name (ARN) of the environment member you want to add.

    

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

    The type of environment member permissions you want to associate with this environment member. Available values include:

     

    
    * ``read-only``: Has read-only access to the environment.
     
    * ``read-write``: Has read-write access to the environment.
    

    

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

    
    ::

      {
          'membership': {
              'permissions': 'owner'|'read-write'|'read-only',
              'userId': 'string',
              'userArn': 'string',
              'environmentId': 'string',
              'lastAccess': datetime(2015, 1, 1)
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **membership** *(dict) --* 

        Information about the environment member that was added.

        
        

        - **permissions** *(string) --* 

          The type of environment member permissions associated with this environment member. Available values include:

           

          
          * ``owner``: Owns the environment.
           
          * ``read-only``: Has read-only access to the environment.
           
          * ``read-write``: Has read-write access to the environment.
          

          
        

        - **userId** *(string) --* 

          The user ID in Identity and Access Management (IAM) of the environment member.

          
        

        - **userArn** *(string) --* 

          The Amazon Resource Name (ARN) of the environment member.

          
        

        - **environmentId** *(string) --* 

          The ID of the environment for the environment member.

          
        

        - **lastAccess** *(datetime) --* 

          The time, expressed in epoch time format, when the environment member last opened the environment.

          
    
  
  **Exceptions**
  
  *   :py:class:`Cloud9.Client.exceptions.BadRequestException`

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

  
  *   :py:class:`Cloud9.Client.exceptions.NotFoundException`

  
  *   :py:class:`Cloud9.Client.exceptions.ForbiddenException`

  
  *   :py:class:`Cloud9.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`Cloud9.Client.exceptions.LimitExceededException`

  
  *   :py:class:`Cloud9.Client.exceptions.InternalServerErrorException`

  

  **Examples**

  
  ::

    response = client.create_environment_membership(
        environmentId='8d9967e2f0624182b74e7690ad69ebEX',
        permissions='read-write',
        userArn='arn:aws:iam::123456789012:user/AnotherDemoUser',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'membership': {
            'environmentId': '8d9967e2f0624182b74e7690ad69ebEX',
            'permissions': 'read-write',
            'userArn': 'arn:aws:iam::123456789012:user/AnotherDemoUser',
            'userId': 'AIDAJ3BA6O2FMJWCWXHEX',
        },
        'ResponseMetadata': {
            '...': '...',
        },
    }

  