There are more AWS SDK examples available in the AWS Doc SDK Examples
Use DescribeEnvironmentMemberships with a CLI
The following code examples show how to use DescribeEnvironmentMemberships.
- CLI
-
- AWS CLI
-
Example 1: To get information about environment members for an AWS Cloud9 development environment
The following
describe-environment-membershipsexample gets information about environment members for the specified AWS Cloud9 development environment.aws cloud9 describe-environment-memberships \ --environment-id8a34f51ce1e04a08882f1e811bd706EXOutput:
{ "memberships": [ { "environmentId": "8a34f51ce1e04a08882f1e811bd706EX", "userId": "AIDAJ3LOROMOUXTBSU6EX", "userArn": "arn:aws:iam::123456789012:user/AnotherDemoUser", "permissions": "read-write" }, { "environmentId": "8a34f51ce1e04a08882f1e811bd706EX", "userId": "AIDAJNUEDQAQWFELJDLEX", "userArn": "arn:aws:iam::123456789012:user/MyDemoUser", "permissions": "owner" } ] }For more information, see Working with shared environment in AWS Cloud9 in the AWS Cloud9 User Guide.
Example 2: To get information about the owner of an AWS Cloud9 development environment
The following
describe-environment-membershipsexample gets information about the owner of the specified AWS Cloud9 development environment.aws cloud9 describe-environment-memberships \ --environment-id8a34f51ce1e04a08882f1e811bd706EX\ --permissionsownerOutput:
{ "memberships": [ { "environmentId": "8a34f51ce1e04a08882f1e811bd706EX", "userId": "AIDAJNUEDQAQWFELJDLEX", "userArn": "arn:aws:iam::123456789012:user/MyDemoUser", "permissions": "owner" } ] }For more information, see Working with shared environment in AWS Cloud9 in the AWS Cloud9 User Guide.
Example 3: To get information about an environment member for multiple AWS Cloud9 development environments
The following
describe-environment-membershipsexample gets information about the specified environment member for multiple AWS Cloud9 development environments.aws cloud9 describe-environment-memberships \ --user-arnarn:aws:iam::123456789012:user/MyDemoUserOutput:
{ "memberships": [ { "environmentId": "10a75714bd494714929e7f5ec4125aEX", "lastAccess": 1516213427.0, "userId": "AIDAJNUEDQAQWFELJDLEX", "userArn": "arn:aws:iam::123456789012:user/MyDemoUser", "permissions": "owner" }, { "environmentId": "1980b80e5f584920801c09086667f0EX", "lastAccess": 1516144884.0, "userId": "AIDAJNUEDQAQWFELJDLEX", "userArn": "arn:aws:iam::123456789012:user/MyDemoUser", "permissions": "owner" } ] }For more information, see Working with shared environment in AWS Cloud9 in the AWS Cloud9 User Guide.
-
For API details, see DescribeEnvironmentMemberships
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example gets information about environment members for the specified AWS Cloud9 development environment.
Get-C9EnvironmentMembershipList -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEXOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : read-write UserArn : arn:aws:iam::123456789012:user/AnotherDemoUser UserId : AIDAJ3BA6O2FMJWCWXHEX EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EXExample 2: This example gets information about the owner of the specified AWS Cloud9 development environment.
Get-C9EnvironmentMembershipList -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission ownerOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EXExample 3: This example gets information about the specified environment member for multiple AWS Cloud9 development environments.
Get-C9EnvironmentMembershipList -UserArn arn:aws:iam::123456789012:user/MyDemoUserOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/17/2018 7:48:14 PM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EX EnvironmentId : 1980b80e5f584920801c09086667f0EX LastAccess : 1/16/2018 11:21:24 PM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EX-
For API details, see DescribeEnvironmentMemberships in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This example gets information about environment members for the specified AWS Cloud9 development environment.
Get-C9EnvironmentMembershipList -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEXOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : read-write UserArn : arn:aws:iam::123456789012:user/AnotherDemoUser UserId : AIDAJ3BA6O2FMJWCWXHEX EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EXExample 2: This example gets information about the owner of the specified AWS Cloud9 development environment.
Get-C9EnvironmentMembershipList -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission ownerOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EXExample 3: This example gets information about the specified environment member for multiple AWS Cloud9 development environments.
Get-C9EnvironmentMembershipList -UserArn arn:aws:iam::123456789012:user/MyDemoUserOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/17/2018 7:48:14 PM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EX EnvironmentId : 1980b80e5f584920801c09086667f0EX LastAccess : 1/16/2018 11:21:24 PM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EX-
For API details, see DescribeEnvironmentMemberships in AWS Tools for PowerShell Cmdlet Reference (V5).
-