View a markdown version of this page

Use DescribeEnvironments with a CLI - AWS SDK Code Examples

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

Use DescribeEnvironments with a CLI

The following code examples show how to use DescribeEnvironments.

CLI
AWS CLI

To get information about AWS Cloud9 development environments

The following describe-environments example gets information about the specified AWS Cloud9 development environments.

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-west-2: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-west-2:123456789012:environment:349c86d4579e4e7298d500ff57a6b2EX", "ownerArn": "arn:aws:iam::123456789012:user/MyDemoUser", "lifecycle": { "status": "CREATED" } } ] }

For more information, see Working with environments in AWS Cloud9 in the AWS Cloud9 User Guide.

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