Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29259

Is there any simpler way to capture JPEG image from aws ec2 get-console-screenshot command

$
0
0

I'm trying to capture AWS Instance screenshot using this command aws ec2 get-console-screenshot --instance-id <i-0922..>

The command gives me some json output with InstanceId and ImageData fields.

The ImageData field contains image in base64 encoded form as per their official documentation http://docs.aws.amazon.com/cli/latest/reference/ec2/get-console-screenshot.html

But I want the command to give image as a file, how do I achieve this?

For now I tried some hack by decoding the ImageData base64 contents and putting it in a file with .jpg extension, it worked!

cat /tmp/myimage.jpg | base64 --decode > /tmp/myimagedecode.jpg # here file /tmp/myimage.jpg contains the content of ImageData field

Can AWS provide some simple way to do this?


Viewing all articles
Browse latest Browse all 29259

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>