Skip to content
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

Version 1.10.0 #30

Closed
wants to merge 13 commits into from
Closed

Version 1.10.0 #30

wants to merge 13 commits into from

Conversation

alt-dima
Copy link

@alt-dima alt-dima commented Jan 2, 2022

Added

  • fix MaxResults=1000 for EC2 instances check (from baec59a)
  • new checks: ecsstrg_count,fargatespot_count,fargatedemand_count,iam_role_count (from Iam role check #23)
  • added service/quota_code: iam_user_count
  • fixed description: s3_bucket_count
  • feature: display NOTDEF for check if limit in AWS is not default (was increased)
  • catch EndpointConnectionError

@alt-dima
Copy link
Author

alt-dima commented Jan 2, 2022

This PR just in case if somebody also needs feature to display NOTDEF for check if limit in AWS is not default (was increased)

@brennerm
Copy link
Owner

brennerm commented Jan 2, 2022

Hey @alt-dima, thanks for your work!
I'd like to ask you to remove the NOTDEF indication including all the relevant code for now as I don't agree with the current implementation. Maybe create an issue prior to making these kinds of changes to discuss this topic before spending your valuable time. :)

@alt-dima
Copy link
Author

alt-dima commented Jan 2, 2022

Ok! No problem:)
I have a task on my job to quickly find any changed/increased quotas/limits in our AWS accounts.
And also learn some python.
I will move NOTDEF stuff to a brach

@alt-dima alt-dima closed this Jan 2, 2022
@brennerm
Copy link
Owner

brennerm commented Jan 2, 2022

@alt-dima No need to close the PR. You can just revert your changes, push to the same branch and the PR will update.

aws_quota/check/ecs.py Show resolved Hide resolved
@property
def maximum(self):
# return self.boto_session.client('iam').get_account_summary()['SummaryMap']['UsersQuota']
return int(-1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should the maximum value be -1?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maximum -1 means, that getting maximum value from AWS is not working. I have got an error NoSuchResourceException in this specific check.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check my comment here. I came across the same exception and would like to fall back to the default value (1000) in this case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i saw it, but decided to specify -1 like indicator for user, that this value was got not from AWS, but hardcoded (and user should check it manually).
I changed the same logic in many places and with | grep -e NOTDEF -e /-1 I can get an indicators, that should be checked.
This is just my opinion and specific needs in my task.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you got that correctly. At the moment there are no hardcoded values for any checks. If there is no dedicated maxmium function defined the check will default to this function cause all checks are subclassing QuotaCheck.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't understand what you mean. We never "fail" getting the maximum from AWS. Anyway I'm pretty sure people will be confused when seeing this output 0/-1/15 cause it's very hard to understand. If you need this kind of output feel free to use your own fork.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this logic too. To see, where the maximum value is not from AWS (was "copied" from "default"). In the future this should be fixed by AWS or ourself to get correct max/def value from AWS.

If we can't get maximum or default value from AWS, then we should inform about that. And also we can be sure, that we are not over-quota. For example, this is very important with number of S3 buckets. You can't check a maximum value from AWS (only default and current). Maximum can tell only support. So, if you see it, you should check it mannually:

S3 Buckets per account [16634349525/us-east-1]: 209/-1/100  X

or another example:

ERROR get maximum : appmesh / L-AC861A39
App Meshes per account [1668413434345]: 0/-1/15  !

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we just have a different expectation of what this tool should do. Feel free to implement this in your fork. I'm not going to merge this logic into this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants