Skip to content

Instantly share code, notes, and snippets.

@ableasdale
ableasdale / boto3-list-instances.py
Created July 16, 2016 09:57
Using Boto 3 to list out AWS EC2 instance information
import boto3
from termcolor import colored
ec2 = boto3.resource('ec2')
for i in ec2.instances.all():
print("Id: {0}\tState: {1}\tLaunched: {2}\tRoot Device Name: {3}".format(
colored(i.id, 'cyan'),
colored(i.state['Name'], 'green'),