Check Amazon EC2 instance state - AWS Snowcone User Guide

Check Amazon EC2 instance state

To check the current state of the Amazon EC2 instance, use the describe-ec2-instances command. The output is similar to that of the describe-device command, but the results are sourced from the device cache in the AWS Cloud and include a subset of the available fields.

To check the state of the Amazon EC2 instance, use the following command. Replace each user input placeholder with your own information.

Command

aws snow-device-management describe-device-ec2-instances \ --managed-device-id smd-fictbgr3rbcje111 \ --instance-ids s.i-84fa8a27d3e15e111

Exceptions

ValidationException ResourceNotFoundException InternalServerException ThrottlingException AccessDeniedException

Output

{ "instances": [ { "instance": { "amiLaunchIndex": 0, "blockDeviceMappings": [ { "deviceName": "/dev/sda", "ebs": { "attachTime": "2021-07-23T15:25:38.719000-07:00", "deleteOnTermination": true, "status": "ATTACHED", "volumeId": "s.vol-84fa8a27d3e15e111" } } ], "cpuOptions": { "coreCount": 1, "threadsPerCore": 1 }, "createdAt": "2021-07-23T15:23:22.858000-07:00", "imageId": "s.ami-03f976c3cadaa6111", "instanceId": "s.i-84fa8a27d3e15e111", "state": { "name": "RUNNING" }, "instanceType": "snc1.micro", "privateIpAddress": "34.223.14.193", "publicIpAddress": "10.111.60.160", "rootDeviceName": "/dev/sda", "securityGroups": [ { "groupId": "s.sg-890b6b4008bdb3111", "groupName": "default" } ], "updatedAt": "2021-07-23T15:29:42.163000-07:00" }, "lastUpdatedAt": "2021-07-23T15:29:58. 071000-07:00" } ] }