Use DescribeEnvironments with an AWS SDK or CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use DescribeEnvironments with an AWS SDK or CLI

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" } } ] }
PowerShell
Tools for PowerShell

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