Skip to main content

Version PyPI - Python Version Read the Docs Travis-CI Codacy

Table of content (Full doc in ReadTheDocs) :

What is Awspice?

Is a wrapper of Boto3 library to list inventory and manage your AWS infrastructure The objective of the wrapper is to make easier some common tasks in AWS, being able to dig through different regions and accounts.

Awspice make it easy to:

  • List all your EC2 instances for multiple regions and accounts

  • Get deployed infraestructure behind a Load Balancer.

  • List all instances with exposed critical ports like 22 or 3389

  • Get info about all certificates of your account/s

  • Find exposed S3 buckets


Installation

pip install awspice

Configuration

The client is built and configured using awspice.connect(). This method indicates the type of authentication and region on which you are going to work.

import awspice

# Region: eu-west-1 | Profile: Default
aws = awspice.connect()

# Using profiles
aws = awspice.connect(region='us-west-2', profile='dev_profile')
# Using access keys
aws = awspice.connect('us-west-2', access_key='AKIA***********', secret_key='/HR$4************')

Usage

Example: Get balancer and instances behind a domain.

aws = awspice.connect()

elb = aws.service.elb.get_loadbalancer_by('domain', 'donalddumb.com')
for elb_instance in elb['Instances']:
  instance = aws.service.ec2.get_instance_by('id', elb_instance['InstanceId'])

Example: List all unused volumes

all_regions = aws.service.ec2.get_regions()
volumes = awsmanager.service.ec2.get_volumes_by('status', 'available', regions=all_regions)

Example: Search instance in all accounts and regions by Public IP

profiles = aws.service.ec2.get_profiles()
regions = aws.service.ec2.get_regions()

for profile in profiles:
    aws.service.ec2.change_profile(profile)

    instance = aws.service.ec2.get_instance_by('publicip', '35.158.163.235', regions=regions)

    if instance:
        print 'Instance found: %s (Account: %s, Region: %s)' % (instance['InstanceId'], instance['RegionName'], instance['Authorization']['Value'])
        break

Metadata

Release files for awspice 1.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awspice 1.7.2
File Size Uploaded
awspice-1.7.2.tar.gz 28.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for awspice 1.7.2
File Interpreter ABI Platform
awspice-1.7.2-py2-none-any.whl Python 2 none any Details

Total release size: 72.1 kB

Release files / awspice-1.7.2.tar.gz

Download URL awspice-1.7.2.tar.gz
Size 28.6 kB
Tags Source
SHA-256 checksum
How to use checksums
785f1e8819c21322d7e0745ae10079337be0ac21ce41a4994be8e430f87c95cb
BLAKE2b-256 checksum
How to use checksums
2afcc5b92b0e2351a21814861481d9e66ef6de39c7dd40ac95fd9bae47594f10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.16

Release files / awspice-1.7.2-py2-none-any.whl

Download URL awspice-1.7.2-py2-none-any.whl
Size 43.5 kB
Tags Python 2
SHA-256 checksum
How to use checksums
74992e245f71aaad58e277b1a90b9e7c083586c3ab57c649d309bd01ad91eb1a
BLAKE2b-256 checksum
How to use checksums
f3801c344b4027f98d6c738f1caeaf15f45996be3a0075b35cdca392f1985479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.16

Release history Release notifications | RSS feed

This release

1.7.2 This release

2 release files

1.7.1

2 release files

1.7

1 release file

1.5

1 release file

1.4.4

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.2.2

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3

1 release file

1.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page