Simple AWS EC2 devtool.
Project description
Welcome to simple_aws_ec2 Documentation
Usage:
from simple_aws_ec2 import Ec2Instance
from boto_session_manager import BotoSesManager
bsm = BotoSesManager()
# get ec2 by id
ec2_inst = Ec2Instance.from_id(bsm, "i-1a2b3c")
# get ec2 by running code from inside of ec2
ec2_inst = EC2Instance.from_ec2_inside(bsm)
# get ec2 by it's name, it returns a iter proxy that may have multiple ec2
ec2_inst = EC2Instance.from_ec2_name(bsm, "my-server").one_or_none()
# get ec2 by tag key value pair, it returns a iter proxy that may have multiple ec2
ec2_inst = EC2Instance.from_tag_key_value(bsm, key="Env", value="prod").one_or_none()
ec2_inst = EC2Instance.query(bsm, filters=..., instnace_ids=...).all()
print(ec2_inst.id)
print(ec2_inst.status)
print(ec2_inst.public_ip)
print(ec2_inst.private_ip)
print(ec2_inst.vpc_id)
print(ec2_inst.subnet_id)
print(ec2_inst.security_groups)
print(ec2_inst.image_id)
print(ec2_inst.instance_type)
print(ec2_inst.key_name)
print(ec2_inst.tags)
print(ec2_inst.data)
print(ec2_inst.is_running()
print(ec2_inst.is_stopped()
print(ec2_inst.is_pending())
print(ec2_inst.is_shutting_down()
print(ec2_inst.is_stopping()
print(ec2_inst.is_terminated()
print(ec2_inst.is_ready_to_start()
print(ec2_inst.is_ready_to_stop()
Install
simple_aws_ec2 is released on PyPI, so all you need is:
$ pip install simple_aws_ec2
To upgrade to latest version:
$ pip install --upgrade simple_aws_ec2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simple_aws_ec2-0.1.4.tar.gz
(10.4 kB
view hashes)
Built Distribution
Close
Hashes for simple_aws_ec2-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c15c61034d6c8abfc8522414f9bc328ce5c8c9e485091d97a3b789c85d3db0f4 |
|
MD5 | 18e40ac533118c4e1171406f5115e954 |
|
BLAKE2b-256 | fc32c97bcae058a9759ee390a5a180251f167b0c0ada06c555eb958fb00597c9 |