Skip to content

Instantly share code, notes, and snippets.

View murarisumit's full-sized avatar
🎩
Welcome here

Sumit Murari murarisumit

🎩
Welcome here
View GitHub Profile
@murarisumit
murarisumit / boto_get_all_running_instance_withIPaddr.py
Last active August 29, 2015 14:18 — forked from lavie/ec2hosts.py
Get only running instance from a region and their IP Address
from boto.ec2 import *
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("access_key", help = "AWS Access Key")
parser.add_argument("secret_key", help = "AWS Secret Key")
parser.add_argument("--region", help = "AWS Region", default = "us-east-1")
parser.add_argument("--all", help = "show not just running instances", action = "store_true")
args = parser.parse_args()
# from fabric.api import *
# from fabric.colors import green as _green, yellow as _yellow
from boto.ec2.connection import EC2Connection
import time
# def start_machine(ami='ami-d7a18dbe'):
'''Launch a single instance of the provided ami'''
aws_access_key_id = 'Cf7...'