Giter Site home page Giter Site logo

jantman / awslimitchecker Goto Github PK

View Code? Open in Web Editor NEW
515.0 21.0 187.0 2.52 MB

A script and python package to check your AWS service limits and usage via boto3.

Home Page: http://awslimitchecker.readthedocs.org/

License: GNU Affero General Public License v3.0

Python 99.81% Dockerfile 0.03% Shell 0.16%
python aws

awslimitchecker's Introduction

awslimitchecker

PyPi package version PyPi downloads GitHub Forks GitHub Open Issues Project Status: Active - The project has reached a stable, usable state and is being actively developed. gitter.im chat Conda

Master:

travis-ci for master branch coverage report for master branch sphinx documentation for latest release

Develop:

travis-ci for develop branch coverage report for develop branch sphinx documentation for develop branch

A script and python module to check your AWS service limits and usage, and warn when usage approaches limits.

Users building out scalable services in Amazon AWS often run into AWS' service limits - often at the least convenient time (i.e. mid-deploy or when autoscaling fails). Amazon's Trusted Advisor can help this, but even the version that comes with Business and Enterprise support only monitors a small subset of AWS limits and only alerts weekly. The new Service Quotas service can also help with this, but relies on CloudWatch alarms per-limit to notify you when you approach your limits; this cannot easily scale to the hundreds of current service limits. awslimitchecker provides a command line script and reusable Python package that queries your current usage of AWS resources and compares it to limits (hard-coded AWS defaults that you can override, API-based limits where available, Service Quotas data where available, or data from Trusted Advisor where available), notifying you when you are approaching or at your limits.

Full project documentation for the latest release is available at http://awslimitchecker.readthedocs.io/en/latest/.

Status

awslimitchecker is mature software, with approximately 13,000 downloads per month and in daily use at numerous organizations.

Development status is being tracked on a board at waffle.io: https://waffle.io/jantman/awslimitchecker

What It Does

  • Check current AWS resource usage against AWS Service Limits
  • Show and inspect current usage
  • Override default Service Limits (for accounts with increased limits)
  • Compare current usage to limits; return information about limits that exceed thresholds, and (CLI wrapper) exit non-0 if thresholds are exceeded
  • Define custom thresholds per-limit
  • where possible, pull current limits from Trusted Advisor API
  • where possible, pull current limits from each service's API (for services that provide this information)
  • where possible, pull current limits from the Service Quotas service
  • Supports explicitly setting the AWS region
  • Supports using STS to assume roles in other accounts, including using external_id.
  • Optionally refresh Trusted Advisor "Service Limits" check before polling Trusted Advisor data, and optionally wait for the refresh to complete (up to an optional maximum time limit). See Getting Started - Trusted Advisor for more information.
  • Optionally send current usage and limit metrics to a metrics store, such as Datadog.
  • Optionally send warning/critical alerts to notification providers, such as PagerDuty.

Requirements

Either Docker in order to run via the docker image, or:

  • Python 3.5 or newer.
  • Python VirtualEnv and pip (recommended installation method; your OS/distribution should have packages for these)
  • boto3 >= 1.4.6 and its dependency botocore >= 1.6.0.

Alternatively, awslimitchecker may be installed through conda with conda install -c conda-forge awslimitchecker. This will automatically install the required dependencies as well.

Installation and Usage

See Getting Started.

Credentials

See Credentials.

Getting Help and Asking Questions

See Getting Help.

For paid support and development options, please see the Enterprise Support Agreements and Contract Development section of the documentation.

There is also a gitter.im chat channel for support and discussion.

Changelog

See Changelog.

Contributions

Pull requests are most definitely welcome. Please cut them against the develop branch. For more information, see the development documentation. I'm also happy to accept contributions in the form of bug reports, feature requests, testing, etc.

License

awslimitchecker is licensed under the GNU Affero General Public License, version 3 or later. This shouldn't be much of a concern to most people; see Development / AGPL for more information.

awslimitchecker's People

Contributors

andrewmichael avatar bastianzim avatar bergkampsliew avatar bflad avatar di1214 avatar djkiourtsis avatar dsumsky-infor avatar felixkrohn avatar hltbra avatar hortau-ci avatar jantman avatar jmcarp avatar john-aws avatar kilsbo avatar lpbedard avatar nadlerjessie avatar nicksantamaria avatar nitrocode avatar owenmann avatar pdecat avatar philchristensen avatar rashidamiri avatar reshadp avatar robpickerill avatar saratlingamarla avatar sebasrp avatar tagadapoe avatar tamsky avatar timgebert avatar vincentclee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awslimitchecker's Issues

setup hosted services

  1. cut a 'develop' branch, start doing work there
  2. Open the repo
  3. Setup badges and ancillary services:
    1. RTD
    2. Travis CI
    3. landscape.io
    4. codecov.io
  4. Make sure that badges and ancillary services work, including RTD.
  5. Blog post and tweet.

Handle API requests with markers

For boto requests that have max_results and return a marker, we need to handle iterating the marker. The most logical way to do this is probably a utility function that takes the boto connection object, the method name, and a dict of args, and returns the combined responses.

Support s3 service

As far as I can find, the only limit on buckets is the 100 total buckets per account.

Need to make sure that if we're checking this, we're looking at cross-region (is this easily possible?)

runner dump data in JSON

runner should have an option to return output - at least services, limits, usage, check results - in JSON

Docs about regions

Add documentation on regions - currently only one at a time, and from boto config.

ToDos

Grep -i source and docs for "todo" and "tbd"

AGPL docs

Since many people may be unfamiliar with it, add some docs on AGPL, what it means to you, how to be compliant, etc.

Version and URL information

Fill out project_url and version to find the actually-installed version and source, even if it's from package vs git.

Integration tests fail for Pull Requests in Travis

See e.g. https://travis-ci.org/jantman/awslimitchecker/jobs/72610593#L711

When Travis checks out a pull request, it checks out the merge of the PR to master, i.e. git fetch origin +refs/pull/45/merge. The git-based integration tests (Test_AGPLVersionChecker_Acceptance.test_install_git_e_dirty, Test_AGPLVersionChecker_Acceptance.test_install_git_e and Test_AGPLVersionChecker_Acceptance.test_install_git) attempt to install awslimitchecker from GitHub using the commit hash of the current git checkout that the tests exist in - which, in this case, is the merge hash, which doesn't exist yet in the repo.

Options that I can think of:
(1) don't just check out whatever hash the test repo is at, if it doesn't exist in origin.
(2) Look at the value of the TRAVIS_PULL_REQUEST environment variable, and do something different in the integration tests if we're testing a PR (such as installing +refs/pull/$TRAVIS_PULL_REQUEST/merge instead of the SHA).

Integration tests

Each function or class that actually interacts with the AWS API should have integration tests. They should run in a fake $HOME to prevent any ~/.boto / ~/.aws credentials from being used. The tests should require AWS credentials exported as env vars, and should check usage. Maybe we just want one overall integration test that runs checker(). We want to catch (a) any bad boto or AWS calls that raise exceptions, (b) any IAM permissions errors, and (c) any limits that didn't get their usage checked. The test should also confirm that the IAM policy for the user it's running under matches what awslimitchecker wants.

Trusted Advisor on accounts without Support

polling the TA checks on a basic account without Support throws an exception. Handle this, and log a warning. Confirm that this is correct per AWS docs (shouldn't even free accounts have access to a limited subset of checks?)

No module named services

Tried the install directions per the README on Ubuntu 14.04 and Amazon Linux. I was not able to install the module from pip directly so I attempted to install it via source with a 'python setup.py install'. When trying to run the binary I get an error "ImportError: No module named services" using python 2.7.

Any chance this will get back into the pip library? Or is there some other issue when I am installing this?

root@ip-10-0-4-112:~# /usr/local/bin/awslimitchecker
Traceback (most recent call last):
File "/usr/local/bin/awslimitchecker", line 9, in
load_entry_point('awslimitchecker==0.1.0', 'console_scripts', 'awslimitchecker')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "build/bdist.linux-x86_64/egg/awslimitchecker/runner.py", line 46, in
File "build/bdist.linux-x86_64/egg/awslimitchecker/checker.py", line 40, in
ImportError: No module named services

Move EBS-related limits to EBS service

Trusted Advisor lists EBS-related limits as their own service, even though they appear under EC2 in the AWS docs. Move them so they play nice with TA.

AGPL source handling

  • implement source discovery, the best we can, for AGPL compliance. We should test to see if it's installed from a package or git. If from a package, point to either GitHub or PyPi. If from git, point to the repo url. In #6 instruct that anyone modifying the source must ensure this function works.

Verify IAM permissions

Verify that all checks work correctly using an IAM user with IAM permissions matching what ALC generates.

Trusted Advisor

Attempt to pull limits from Trusted Advisor where possible.

This also needs to include updating docs:

  • overall docs on TA
  • development - adding services/limits, adding TA checks
  • CLI examples
  • Generated TA info, and comment on limits where they pull from TA

Logging

Ensure logging is being done in all logical places. Adjust runner logging format (maybe based on verbosity?)

Threshold overrides

  • checker needs ability to set threshold overrides per-limit or as a dict, either percentage or integer
  • expose this in runner as either per-limit options or a dict

Add support for spot instance

Just came across this useful tool. Can you please tell me if you plan to add support for reporting on spot instances when running awslimitchecker -u? Most of our instances are spot and this would help very much. Thanks for considering this.

Fix AGPL warning

Fix the AGPL message on init. How can this be done nicer? Maybe just print, or to stderr?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.