jantman / awslimitchecker

A script and python package to check your AWS service limits and usage via boto3.
http://awslimitchecker.readthedocs.org/
GNU Affero General Public License v3.0
515 stars 187 forks source link

Adding "error_on_warning" flag in the core code #516

Closed luoyimu1 closed 3 years ago

luoyimu1 commented 3 years ago

Feature Request

Feature Description

"error_on_warning" flag is mentioned in the check_aws_limits.py wrapper file, but is it possible to add it into the core code as well?

Use Cases

This will be very useful in CI/CD pipeline, where the flag could be used to fail the build if hitting warning threshold

Testing Assistance

Yep, I'd like to help out with testing pre-release code for the feature.

jantman commented 3 years ago

Apologies for waiting so long before replying to this.

When you sat "the core code", do you mean the awslimitchecker CLI command? If so, this already happens. The awslimitchecker command uses Nagios-compatible exit codes: zero (0) on success, one (1) if there are warnings, and two (2) if there are criticals.