-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing AWS Lambda Limits and Usage #366
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #366 +/- ##
======================================
Coverage 100% 100%
======================================
Files 29 30 +1
Lines 2157 2204 +47
Branches 324 326 +2
======================================
+ Hits 2157 2204 +47
Continue to review full report at Codecov.
|
Great stuff. Looking forward to this since I too need it :) 👍 |
Apologies for the delay on this. I've been pretty sick and haven't had the energy for much, but I'm on the mend and didn't want to let this sit any longer. This was discussed a bit in #363 but I'll continue the discussion here. I really appreciate the time you've taken to implement this, but I have a few concerns with the code as it currently stands... First and foremost, having In a larger scope, though, I'm a bit torn on which of these things fit into the scope of awslimitchecker. The intent of this tool is to detect when you're approaching account-level limits, and warn people who can either request a limit increase via AWS Support, or do something to fix the problem. So I'm not really sure how some of these fit into that workflow... specifically, what the use case is for usages without a limit (like FunctionCount) or limits that we can't calculate usage for (like ConcurrentExecutions). I'm interested in feedback to this, and also how @MAPontes sees this being used. |
Hi Jason, hope you are feeling better. |
So, should I just hide usages when they don't have a set limit? I mean, I would like to see the usage in terms of number of functions. Usage of total size of functions has a limit as well so that one is fine. |
…ts_from_api because I'm horribly pedantic
@kilsbo There's not really a way to "hide" usages. I've been digging deeper into this today. I feel really bad that this PR has been open so long (and that my open source projects haven't really gotten much attention in far too long), so I'm committed to getting this figured out. Here's where things stand right now: The awslimitchecker API and CLI both have current support for limits without associated Usage; this is currently in place already if your account doesn't use the resource corresponding with a given limit; i.e. if you have no load balancers, the The idea of calculating usage for a Limit that's unlimited, on the other hand, is a bit of a gray area. awslimitchecker itself is in conflict on this... the API docs for AwsLimit.get_limit() say that it can return One other note is that for awslimitchecker to work right with the Python API and third-party integrations, you can't define any new Limits in I'm going to cut my own branch off of this and start working on it a bit and see what I can come up with. |
Just to follow up on my previous comment re: "unlimited" limits, it appears that as of #197 which was merged over two years ago in 0.5.0, we do have support for "unlimited" limits, as Trusted Advisor returns them. So this should have just gotten a lot simpler, and there's just a documentation issue. |
…eturn None, and allow AwsLimit() to take None as a default limit value
@kilsbo I've pushed a bunch of commits to this branch and am going to merge the PR once the tests pass. I did make a few changes that may break your current use of this, around naming of the limits:
those should be the only functional differences from your code. Thank you so so much for this contribution! |
…te_limits_from_api because I'm horribly pedantic
…ped/unzipped limits
…al Code Size to MiB
Thank you for this, much appreciated! |
Summary
Adds support for AWS Lambda service, using this AWS API call response (
aws lambda get-account-settings
):Comments from the implementor
In the code base of awslimitchecker, usages and limits are treated equally. However, this is not true for AWS API in regards of the AWS Lambda service. Therefore, I've been coding it in the Lambda Service class to handle this, returning back different limits and usage metric points depending if you issue the -l or -u parameter upon execution of awslimitchecker. This may or maynot pass PR/code review, and I'm happy to oblige if anything around this is determined in need of a change.
My contribution is being made under the same license as the awslimitchecker project (or any subsequent version of that license if adopted by awslimitchecker).
Pull Request Checklist
writing tests for the code, that's fine, just mention that in the summary and either
ask for assistance, or clarify that you'd like someone else to handle the tests. PRs that
include complete test coverage will usually be merged faster.
tox -e docs
connect()
andconnect_resource()
methods, inherited fromawslimitchecker.connectable.Connectable
if you're working on a GitHub issue (i.e. "issue #x - "). Please
refrain from using the "fixes #x" notation unless you are sure that the
the issue is fixed in that commit.
Contributor License Agreement
By submitting this work for inclusion in awslimitchecker, I agree to the following terms:
is being made under the same license as the awslimitchecker project (the Affero GPL v3,
or any subsequent version of that license if adopted by awslimitchecker).
this pull request grants a perpetual, global, unlimited license for it to be used and distributed
under the terms of awslimitchecker's license.