

There are more AWS SDK examples available in the [AWS Doc SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples) GitHub repo.

# Code examples for AWS Cloud9 using AWS SDKs
<a name="cloud9_code_examples"></a>

The following code examples show you how to use AWS Cloud9 with an AWS software development kit (SDK).

*Actions* are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

**More resources**
+  **[AWS Cloud9 User Guide](https://docs.aws.amazon.com/cloud9/latest/user-guide/welcome.html)** – More information about AWS Cloud9.
+ **[AWS Cloud9 API Reference](https://docs.aws.amazon.com/cloud9/latest/APIReference/Welcome.html)** – Details about all available AWS Cloud9 actions.
+ **[AWS Developer Center](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23)** – Code examples that you can filter by category or full-text search.
+ **[AWS SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples)** – GitHub repo with complete code in preferred languages. Includes instructions for setting up and running the code.

**Contents**
+ [Basics](cloud9_code_examples_basics.md)
  + [Actions](cloud9_code_examples_actions.md)
    + [`CreateEnvironmentEc2`](cloud9_example_cloud9_CreateEnvironmentEc2_section.md)
    + [`CreateEnvironmentMembership`](cloud9_example_cloud9_CreateEnvironmentMembership_section.md)
    + [`DeleteEnvironment`](cloud9_example_cloud9_DeleteEnvironment_section.md)
    + [`DeleteEnvironmentMembership`](cloud9_example_cloud9_DeleteEnvironmentMembership_section.md)
    + [`DescribeEnvironmentMemberships`](cloud9_example_cloud9_DescribeEnvironmentMemberships_section.md)
    + [`DescribeEnvironmentStatus`](cloud9_example_cloud9_DescribeEnvironmentStatus_section.md)
    + [`DescribeEnvironments`](cloud9_example_cloud9_DescribeEnvironments_section.md)
    + [`ListEnvironments`](cloud9_example_cloud9_ListEnvironments_section.md)
    + [`UpdateEnvironment`](cloud9_example_cloud9_UpdateEnvironment_section.md)
    + [`UpdateEnvironmentMembership`](cloud9_example_cloud9_UpdateEnvironmentMembership_section.md)

# Basic examples for AWS Cloud9 using AWS SDKs
<a name="cloud9_code_examples_basics"></a>

The following code examples show how to use the basics of AWS Cloud9 with AWS SDKs. 

**Contents**
+ [Actions](cloud9_code_examples_actions.md)
  + [`CreateEnvironmentEc2`](cloud9_example_cloud9_CreateEnvironmentEc2_section.md)
  + [`CreateEnvironmentMembership`](cloud9_example_cloud9_CreateEnvironmentMembership_section.md)
  + [`DeleteEnvironment`](cloud9_example_cloud9_DeleteEnvironment_section.md)
  + [`DeleteEnvironmentMembership`](cloud9_example_cloud9_DeleteEnvironmentMembership_section.md)
  + [`DescribeEnvironmentMemberships`](cloud9_example_cloud9_DescribeEnvironmentMemberships_section.md)
  + [`DescribeEnvironmentStatus`](cloud9_example_cloud9_DescribeEnvironmentStatus_section.md)
  + [`DescribeEnvironments`](cloud9_example_cloud9_DescribeEnvironments_section.md)
  + [`ListEnvironments`](cloud9_example_cloud9_ListEnvironments_section.md)
  + [`UpdateEnvironment`](cloud9_example_cloud9_UpdateEnvironment_section.md)
  + [`UpdateEnvironmentMembership`](cloud9_example_cloud9_UpdateEnvironmentMembership_section.md)

# Actions for AWS Cloud9 using AWS SDKs
<a name="cloud9_code_examples_actions"></a>

The following code examples demonstrate how to perform individual AWS Cloud9 actions with AWS SDKs. Each example includes a link to GitHub, where you can find instructions for setting up and running the code. 

 The following examples include only the most commonly used actions. For a complete list, see the [AWS Cloud9 API Reference](https://docs.aws.amazon.com/cloud9/latest/APIReference/Welcome.html). 

**Topics**
+ [`CreateEnvironmentEc2`](cloud9_example_cloud9_CreateEnvironmentEc2_section.md)
+ [`CreateEnvironmentMembership`](cloud9_example_cloud9_CreateEnvironmentMembership_section.md)
+ [`DeleteEnvironment`](cloud9_example_cloud9_DeleteEnvironment_section.md)
+ [`DeleteEnvironmentMembership`](cloud9_example_cloud9_DeleteEnvironmentMembership_section.md)
+ [`DescribeEnvironmentMemberships`](cloud9_example_cloud9_DescribeEnvironmentMemberships_section.md)
+ [`DescribeEnvironmentStatus`](cloud9_example_cloud9_DescribeEnvironmentStatus_section.md)
+ [`DescribeEnvironments`](cloud9_example_cloud9_DescribeEnvironments_section.md)
+ [`ListEnvironments`](cloud9_example_cloud9_ListEnvironments_section.md)
+ [`UpdateEnvironment`](cloud9_example_cloud9_UpdateEnvironment_section.md)
+ [`UpdateEnvironmentMembership`](cloud9_example_cloud9_UpdateEnvironmentMembership_section.md)

# Use `CreateEnvironmentEc2` with a CLI
<a name="cloud9_example_cloud9_CreateEnvironmentEc2_section"></a>

The following code examples show how to use `CreateEnvironmentEc2`.

------
#### [ CLI ]

**AWS CLI**  
**To create an AWS Cloud9 EC2 development environment**  
This following `create-environment-ec2` example creates an AWS Cloud9 development environment with the specified settings, launches an Amazon Elastic Compute Cloud (Amazon EC2) instance, and then connects from the instance to the environment.  

```
aws cloud9 create-environment-ec2 \
    --name my-demo-env \
    --description "My demonstration development environment." \
    --instance-type t2.micro --image-id amazonlinux-2023-x86_64 \
    --subnet-id subnet-1fab8aEX \
    --automatic-stop-time-minutes 60 \
    --owner-arn arn:aws:iam::123456789012:user/MyDemoUser
```
Output:  

```
{
    "environmentId": "8a34f51ce1e04a08882f1e811bd706EX"
}
```
For more information, see [Creating an EC2 Environment](https://docs.aws.amazon.com/cloud9/latest/user-guide/create-environment-main.html) in the *AWS Cloud9 User Guide*.  
+  For API details, see [CreateEnvironmentEc2](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloud9/create-environment-ec2.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: This example creates an AWS Cloud9 development environment with the specified settings, launches an Amazon Elastic Compute Cloud (Amazon EC2) instance, and then connects from the instance to the environment.**  

```
New-C9EnvironmentEC2 -Name my-demo-env -AutomaticStopTimeMinutes 60 -Description "My demonstration development environment." -InstanceType t2.micro -OwnerArn arn:aws:iam::123456789012:user/MyDemoUser -SubnetId subnet-d43a46EX
```
**Output:**  

```
ffd88420d4824eeeaeaa8a04bfde8cEX
```
+  For API details, see [CreateEnvironmentEc2](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: This example creates an AWS Cloud9 development environment with the specified settings, launches an Amazon Elastic Compute Cloud (Amazon EC2) instance, and then connects from the instance to the environment.**  

```
New-C9EnvironmentEC2 -Name my-demo-env -AutomaticStopTimeMinutes 60 -Description "My demonstration development environment." -InstanceType t2.micro -OwnerArn arn:aws:iam::123456789012:user/MyDemoUser -SubnetId subnet-d43a46EX
```
**Output:**  

```
ffd88420d4824eeeaeaa8a04bfde8cEX
```
+  For API details, see [CreateEnvironmentEc2](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `CreateEnvironmentMembership` with a CLI
<a name="cloud9_example_cloud9_CreateEnvironmentMembership_section"></a>

The following code examples show how to use `CreateEnvironmentMembership`.

------
#### [ CLI ]

**AWS CLI**  
**To add an environment member to an AWS Cloud9 development environment**  
This example adds the specified environment member to the specified AWS Cloud9 development environment.  
Command:  

```
aws cloud9 create-environment-membership --environment-id 8a34f51ce1e04a08882f1e811bd706EX --user-arn arn:aws:iam::123456789012:user/AnotherDemoUser --permissions read-write
```
Output:  

```
{
  "membership": {
    "environmentId": "8a34f51ce1e04a08882f1e811bd706EX",
    "userId": "AIDAJ3LOROMOUXTBSU6EX",
    "userArn": "arn:aws:iam::123456789012:user/AnotherDemoUser",
    "permissions": "read-write"
  }
}
```
+  For API details, see [CreateEnvironmentMembership](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloud9/create-environment-membership.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: This example adds the specified environment member to the specified AWS Cloud9 development environment.**  

```
New-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission read-write
```
**Output:**  

```
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX
LastAccess    : 1/1/0001 12:00:00 AM
Permissions   : read-write
UserArn       : arn:aws:iam::123456789012:user/AnotherDemoUser
UserId        : AIDAJ3BA6O2FMJWCWXHEX
```
+  For API details, see [CreateEnvironmentMembership](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: This example adds the specified environment member to the specified AWS Cloud9 development environment.**  

```
New-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission read-write
```
**Output:**  

```
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX
LastAccess    : 1/1/0001 12:00:00 AM
Permissions   : read-write
UserArn       : arn:aws:iam::123456789012:user/AnotherDemoUser
UserId        : AIDAJ3BA6O2FMJWCWXHEX
```
+  For API details, see [CreateEnvironmentMembership](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `DeleteEnvironment` with a CLI
<a name="cloud9_example_cloud9_DeleteEnvironment_section"></a>

The following code examples show how to use `DeleteEnvironment`.

------
#### [ CLI ]

**AWS CLI**  
**To delete an AWS Cloud9 development environment**  
This example deletes the specified AWS Cloud9 development environment. If an Amazon EC2 instance is connected to the environment, also terminates the instance.  
Command:  

```
aws cloud9 delete-environment --environment-id 8a34f51ce1e04a08882f1e811bd706EX
```
Output:  

```
None.
```
+  For API details, see [DeleteEnvironment](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloud9/delete-environment.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: This example deletes the specified AWS Cloud9 development environment. If an Amazon EC2 instance is connected to the environment, also terminates the instance.**  

```
Remove-C9Environment -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX
```
+  For API details, see [DeleteEnvironment](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: This example deletes the specified AWS Cloud9 development environment. If an Amazon EC2 instance is connected to the environment, also terminates the instance.**  

```
Remove-C9Environment -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX
```
+  For API details, see [DeleteEnvironment](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `DeleteEnvironmentMembership` with a CLI
<a name="cloud9_example_cloud9_DeleteEnvironmentMembership_section"></a>

The following code examples show how to use `DeleteEnvironmentMembership`.

------
#### [ CLI ]

**AWS CLI**  
**To delete an environment member from an AWS Cloud9 development environment**  
This example deletes the specified environment member from the specified AWS Cloud9 development environment.  
Command:  

```
aws cloud9 delete-environment-membership --environment-id 8a34f51ce1e04a08882f1e811bd706EX --user-arn arn:aws:iam::123456789012:user/AnotherDemoUser
```
Output:  

```
None.
```
+  For API details, see [DeleteEnvironmentMembership](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloud9/delete-environment-membership.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: This example deletes the specified environment member from the specified AWS Cloud9 development environment.**  

```
Remove-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX
```
+  For API details, see [DeleteEnvironmentMembership](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: This example deletes the specified environment member from the specified AWS Cloud9 development environment.**  

```
Remove-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX
```
+  For API details, see [DeleteEnvironmentMembership](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `DescribeEnvironmentMemberships` with a CLI
<a name="cloud9_example_cloud9_DescribeEnvironmentMemberships_section"></a>

The following code examples show how to use `DescribeEnvironmentMemberships`.

------
#### [ CLI ]

**AWS CLI**  
**To gets information about environment members for an AWS Cloud9 development environment**  
This example gets information about environment members for the specified AWS Cloud9 development environment.  
Command:  

```
aws cloud9 describe-environment-memberships --environment-id 8a34f51ce1e04a08882f1e811bd706EX
```
Output:  

```
{
  "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"
    }
  ]
}
```
**To get information about the owner of an AWS Cloud9 development environment**  
This example gets information about the owner of the specified AWS Cloud9 development environment.  
Command:  

```
aws cloud9 describe-environment-memberships --environment-id 8a34f51ce1e04a08882f1e811bd706EX --permissions owner
```
Output:  

```
{
  "memberships": [
    {
      "environmentId": "8a34f51ce1e04a08882f1e811bd706EX",
      "userId": "AIDAJNUEDQAQWFELJDLEX",
      "userArn": "arn:aws:iam::123456789012:user/MyDemoUser",
      "permissions": "owner"
    }
  ]
}
```
**To get information about an environment member for multiple AWS Cloud9 development environments**  
This example gets information about the specified environment member for multiple AWS Cloud9 development environments.  
Command:  

```
aws cloud9 describe-environment-memberships --user-arn arn:aws:iam::123456789012:user/MyDemoUser
```
Output:  

```
{
  "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 API details, see [DescribeEnvironmentMemberships](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloud9/describe-environment-memberships.html) 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 ffd88420d4824eeeaeaa8a04bfde8cEX
```
**Output:**  

```
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        : AIDAJ3LOROMOUXTBSU6EX
```
**Example 2: This example gets information about the owner of the specified AWS Cloud9 development environment.**  

```
Get-C9EnvironmentMembershipList -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission owner
```
**Output:**  

```
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX
LastAccess    : 1/1/0001 12:00:00 AM
Permissions   : owner
UserArn       : arn:aws:iam::123456789012:user/MyDemoUser
UserId        : AIDAJ3LOROMOUXTBSU6EX
```
**Example 3: This example gets information about the specified environment member for multiple AWS Cloud9 development environments.**  

```
Get-C9EnvironmentMembershipList -UserArn arn:aws:iam::123456789012:user/MyDemoUser
```
**Output:**  

```
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](https://docs.aws.amazon.com/powershell/v4/reference) 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 ffd88420d4824eeeaeaa8a04bfde8cEX
```
**Output:**  

```
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        : AIDAJ3LOROMOUXTBSU6EX
```
**Example 2: This example gets information about the owner of the specified AWS Cloud9 development environment.**  

```
Get-C9EnvironmentMembershipList -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission owner
```
**Output:**  

```
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX
LastAccess    : 1/1/0001 12:00:00 AM
Permissions   : owner
UserArn       : arn:aws:iam::123456789012:user/MyDemoUser
UserId        : AIDAJ3LOROMOUXTBSU6EX
```
**Example 3: This example gets information about the specified environment member for multiple AWS Cloud9 development environments.**  

```
Get-C9EnvironmentMembershipList -UserArn arn:aws:iam::123456789012:user/MyDemoUser
```
**Output:**  

```
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](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `DescribeEnvironmentStatus` with a CLI
<a name="cloud9_example_cloud9_DescribeEnvironmentStatus_section"></a>

The following code examples show how to use `DescribeEnvironmentStatus`.

------
#### [ CLI ]

**AWS CLI**  
**To get status information for an AWS Cloud9 development environment**  
This example gets status information for the specified AWS Cloud9 development environment.  
Command:  

```
aws cloud9 describe-environment-status --environment-id 685f892f431b45c2b28cb69eadcdb0EX
```
Output:  

```
{
  "status": "ready",
  "message": "Environment is ready to use"
}
```
+  For API details, see [DescribeEnvironmentStatus](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloud9/describe-environment-status.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: This example gets status information for the specified AWS Cloud9 development environment.**  

```
Get-C9EnvironmentStatus -EnvironmentId 349c86d4579e4e7298d500ff57a6b2EX
```
**Output:**  

```
Message                     Status
-------                     ------
Environment is ready to use ready
```
+  For API details, see [DescribeEnvironmentStatus](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: This example gets status information for the specified AWS Cloud9 development environment.**  

```
Get-C9EnvironmentStatus -EnvironmentId 349c86d4579e4e7298d500ff57a6b2EX
```
**Output:**  

```
Message                     Status
-------                     ------
Environment is ready to use ready
```
+  For API details, see [DescribeEnvironmentStatus](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `DescribeEnvironments` with a CLI
<a name="cloud9_example_cloud9_DescribeEnvironments_section"></a>

The following code examples show how to use `DescribeEnvironments`.

------
#### [ CLI ]

**AWS CLI**  
**To get information about AWS Cloud9 development environments**  
This example gets information about the specified AWS Cloud9 development environments.  
Command:  

```
aws cloud9 describe-environments --environment-ids 685f892f431b45c2b28cb69eadcdb0EX 349c86d4579e4e7298d500ff57a6b2EX
```
Output:  

```
{
  "environments": [
    {
      "id": "685f892f431b45c2b28cb69eadcdb0EX",
      "name": "my-demo-ec2-env",
      "description": "Created from CodeStar.",
      "type": "ec2",
      "arn": "arn:aws:cloud9:us-east-1:123456789012:environment:685f892f431b45c2b28cb69eadcdb0EX",
      "ownerArn": "arn:aws:iam::123456789012:user/MyDemoUser",
      "lifecycle": {
        "status": "CREATED"
      }
    },
    {
      "id": "349c86d4579e4e7298d500ff57a6b2EX",
      "name": my-demo-ssh-env",
      "description": "",
      "type": "ssh",
      "arn": "arn:aws:cloud9:us-east-1:123456789012:environment:349c86d4579e4e7298d500ff57a6b2EX",
      "ownerArn": "arn:aws:iam::123456789012:user/MyDemoUser",
      "lifecycle": {
        "status": "CREATED"
      }
    }
  ]
}
```
+  For API details, see [DescribeEnvironments](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloud9/describe-environments.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: This example gets information about the specified AWS Cloud9 development environments.**  

```
Get-C9EnvironmentData -EnvironmentId 685f892f431b45c2b28cb69eadcdb0EX,1980b80e5f584920801c09086667f0EX
```
**Output:**  

```
Arn         : arn:aws:cloud9:us-east-1:123456789012:environment:685f892f431b45c2b28cb69eadcdb0EX
Description : Created from CodeStar.
Id          : 685f892f431b45c2b28cb69eadcdb0EX
Lifecycle   : Amazon.Cloud9.Model.EnvironmentLifecycle
Name        : my-demo-ec2-env
OwnerArn    : arn:aws:iam::123456789012:user/MyDemoUser
Type        : ec2

Arn         : arn:aws:cloud9:us-east-1:123456789012:environment:1980b80e5f584920801c09086667f0EX
Description :
Id          : 1980b80e5f584920801c09086667f0EX
Lifecycle   : Amazon.Cloud9.Model.EnvironmentLifecycle
Name        : my-demo-ssh-env
OwnerArn    : arn:aws:iam::123456789012:user/MyDemoUser
Type        : ssh
```
**Example 2: This example gets information about the lifecycle status of the specified AWS Cloud9 development environment.**  

```
(Get-C9EnvironmentData -EnvironmentId 685f892f431b45c2b28cb69eadcdb0EX).Lifecycle
```
**Output:**  

```
FailureResource Reason Status
--------------- ------ ------
                       CREATED
```
+  For API details, see [DescribeEnvironments](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: This example gets information about the specified AWS Cloud9 development environments.**  

```
Get-C9EnvironmentData -EnvironmentId 685f892f431b45c2b28cb69eadcdb0EX,1980b80e5f584920801c09086667f0EX
```
**Output:**  

```
Arn         : arn:aws:cloud9:us-east-1:123456789012:environment:685f892f431b45c2b28cb69eadcdb0EX
Description : Created from CodeStar.
Id          : 685f892f431b45c2b28cb69eadcdb0EX
Lifecycle   : Amazon.Cloud9.Model.EnvironmentLifecycle
Name        : my-demo-ec2-env
OwnerArn    : arn:aws:iam::123456789012:user/MyDemoUser
Type        : ec2

Arn         : arn:aws:cloud9:us-east-1:123456789012:environment:1980b80e5f584920801c09086667f0EX
Description :
Id          : 1980b80e5f584920801c09086667f0EX
Lifecycle   : Amazon.Cloud9.Model.EnvironmentLifecycle
Name        : my-demo-ssh-env
OwnerArn    : arn:aws:iam::123456789012:user/MyDemoUser
Type        : ssh
```
**Example 2: This example gets information about the lifecycle status of the specified AWS Cloud9 development environment.**  

```
(Get-C9EnvironmentData -EnvironmentId 685f892f431b45c2b28cb69eadcdb0EX).Lifecycle
```
**Output:**  

```
FailureResource Reason Status
--------------- ------ ------
                       CREATED
```
+  For API details, see [DescribeEnvironments](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `ListEnvironments` with a CLI
<a name="cloud9_example_cloud9_ListEnvironments_section"></a>

The following code examples show how to use `ListEnvironments`.

------
#### [ CLI ]

**AWS CLI**  
**To get a list of available AWS Cloud9 development environment identifiers**  
This example gets a list of available AWS Cloud9 development environment identifiers.  
Command:  

```
aws cloud9 list-environments
```
Output:  

```
{
  "environmentIds": [
    "685f892f431b45c2b28cb69eadcdb0EX",
    "1980b80e5f584920801c09086667f0EX"
  ]
}
```
+  For API details, see [ListEnvironments](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloud9/list-environments.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: This example gets a list of available AWS Cloud9 development environment identifiers.**  

```
Get-C9EnvironmentList
```
**Output:**  

```
685f892f431b45c2b28cb69eadcdb0EX
1980b80e5f584920801c09086667f0EX
```
+  For API details, see [ListEnvironments](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: This example gets a list of available AWS Cloud9 development environment identifiers.**  

```
Get-C9EnvironmentList
```
**Output:**  

```
685f892f431b45c2b28cb69eadcdb0EX
1980b80e5f584920801c09086667f0EX
```
+  For API details, see [ListEnvironments](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `UpdateEnvironment` with a CLI
<a name="cloud9_example_cloud9_UpdateEnvironment_section"></a>

The following code examples show how to use `UpdateEnvironment`.

------
#### [ CLI ]

**AWS CLI**  
**To change the settings of an existing AWS Cloud9 development environment**  
This example changes the specified settings of the specified existing AWS Cloud9 development environment.  
Command:  

```
aws cloud9 update-environment --environment-id 8a34f51ce1e04a08882f1e811bd706EX --name my-changed-demo-env --description "My changed demonstration development environment."
```
Output:  

```
None.
```
+  For API details, see [UpdateEnvironment](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloud9/update-environment.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: This example changes the specified settings of the specified existing AWS Cloud9 development environment.**  

```
Update-C9Environment -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Description "My changed demonstration development environment." -Name my-changed-demo-env
```
+  For API details, see [UpdateEnvironment](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: This example changes the specified settings of the specified existing AWS Cloud9 development environment.**  

```
Update-C9Environment -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Description "My changed demonstration development environment." -Name my-changed-demo-env
```
+  For API details, see [UpdateEnvironment](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `UpdateEnvironmentMembership` with a CLI
<a name="cloud9_example_cloud9_UpdateEnvironmentMembership_section"></a>

The following code examples show how to use `UpdateEnvironmentMembership`.

------
#### [ CLI ]

**AWS CLI**  
**To change the settings of an existing environment member for an AWS Cloud9 development environment**  
This example changes the settings of the specified existing environment member for the specified AWS Cloud9 development environment.  
Command:  

```
aws cloud9 update-environment-membership --environment-id 8a34f51ce1e04a08882f1e811bd706EX --user-arn arn:aws:iam::123456789012:user/AnotherDemoUser --permissions read-only
```
Output:  

```
{
  "membership": {
    "environmentId": "8a34f51ce1e04a08882f1e811bd706EX",
    "userId": "AIDAJ3LOROMOUXTBSU6EX",
    "userArn": "arn:aws:iam::123456789012:user/AnotherDemoUser",
    "permissions": "read-only"
  }
}
```
+  For API details, see [UpdateEnvironmentMembership](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloud9/update-environment-membership.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: This example changes the settings of the specified existing environment member for the specified AWS Cloud9 development environment.**  

```
Update-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission read-only
```
**Output:**  

```
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX
LastAccess    : 1/1/0001 12:00:00 AM
Permissions   : read-only
UserArn       : arn:aws:iam::123456789012:user/AnotherDemoUser
UserId        : AIDAJ3BA6O2FMJWCWXHEX
```
+  For API details, see [UpdateEnvironmentMembership](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: This example changes the settings of the specified existing environment member for the specified AWS Cloud9 development environment.**  

```
Update-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission read-only
```
**Output:**  

```
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX
LastAccess    : 1/1/0001 12:00:00 AM
Permissions   : read-only
UserArn       : arn:aws:iam::123456789012:user/AnotherDemoUser
UserId        : AIDAJ3BA6O2FMJWCWXHEX
```
+  For API details, see [UpdateEnvironmentMembership](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------