Cloud9 / Client / create_environment_membership

create_environment_membership#

Cloud9.Client.create_environment_membership(**kwargs)#

Adds an environment member to an Cloud9 development environment.

See also: AWS API Documentation

Request Syntax

response = client.create_environment_membership(
    environmentId='string',
    userArn='string',
    permissions='read-write'|'read-only'
)
Parameters:
  • environmentId (string) –

    [REQUIRED]

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

  • userArn (string) –

    [REQUIRED]

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

  • permissions (string) –

    [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.

Return type:

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

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': {
        '...': '...',
    },
}