Tuesday, October 17, 2017

Finding out more on aws instances

hi all,

There is a quick way for you print all of the aws instances. Here is the small python code to help you. However, you do need to install boto3 library before everything starts to work. Please read the README.md to set thing up.

https://github.com/yenonn/server-inventory/blob/master/aws/aws_lib.py

The small function of show_ec2_instances will help you to print out all of the instances. Enjoy!

(python3-env1) nasilemak:aws hiuy$ python3
Python 3.5.2 (default, Oct 11 2016, 04:59:56)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from aws_lib import *
>>> show_ec2_instances()
###(Region:ap-south-1)###
###(Region:eu-west-2)###
###(Region:eu-west-1)###
###(Region:ap-northeast-2)###
###(Region:ap-northeast-1)###
  * linux1: stopped
  * linux2: stopped
  * linux3: stopped