Question: I've reviewed reference documentation for the AWS CLI. I know how to use the `aws ec2 describe-instances` command. Is there a variation to list the uptime (not the creation time) of the servers? The OS uptime is useful. It seems like this could be obtained via an aws cli command.

Answer: 
There is no specific 'uptime' measure in Amazon EC2.

If [AWS Config](http://docs.aws.amazon.com/config/latest/developerguide/WhatIsConfig.html) has been configured, you could use `get-resource-config-history` to retrieve the history of an instance, eg:

```
aws configservice get-resource-config-history --resource-type AWS::EC2::Instance --resource-id i-1a2b3c4d

```

AWS Config will show the **state change** of an Amazon EC2 instance (eg `stopped`, `running`) as a `Configuration.State.Name` value. The change will also have a timestamp.

Using this configuration history, you could piece together enough information to calculate uptime.

Alternatively, you could **calculate the uptime from within the instance** (eg from system logs or via a custom app) rather than obtaining it from EC2.
From the [AWS documentation](http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html), you are probably after `LaunchTime`:

```
aws ec2 describe-instances --query "Reservations[].Instances[].[LaunchTime]"

```

From there, you can calculate the offset from the current date and time to find the uptime.