brennerm / aws-quota-checker

Keep an eye on your AWS quotas before you hit their limits
https://pypi.org/project/aws-quota-checker/
MIT License
84 stars 36 forks source link

Regression for blacklist check in 1.3.0 #8

Closed philof closed 3 years ago

philof commented 3 years ago

Running check with a blacklist entry in 1.3.0 returns a usage error.

(aws-quota-checker) [(HEAD detached at 1.3.0)] aws-quota-checker $ aws-quota-checker check 'all,!vpc_count'
Usage: aws-quota-checker check [OPTIONS] [all|am_mesh_count|asg_count|cf_stack
                               _count|cw_alarm_count|dyndb_table_count|ebs_sna
                               pshot_count|ec2_eip_count|ec2_on_demand_f_count
                               |ec2_on_demand_g_count|ec2_on_demand_inf_count|
                               ec2_on_demand_p_count|ec2_on_demand_standard_co
                               unt|ec2_on_demand_x_count|ec2_spot_f_count|ec2_
                               spot_g_count|ec2_spot_inf_count|ec2_spot_p_coun
                               t|ec2_spot_standard_count|ec2_spot_x_count|ec2_
                               tgw_count|ec2_vpn_connection_count|ecs_count|ek
                               s_count|elasticbeanstalk_application_count|elas
                               ticbeanstalk_environment_count|elb_alb_count|el
                               b_clb_count|elb_listeners_per_alb|elb_listeners
                               _per_clb|elb_listeners_per_nlb|elb_nlb_count|el
                               b_target_group_count|iam_attached_policy_per_gr
                               oup|iam_attached_policy_per_role|iam_attached_p
                               olicy_per_user|iam_group_count|iam_policy_count
                               |iam_policy_version_count|iam_server_certificat
                               e_count|iam_user_count|ig_count|lc_count|ni_cou
                               nt|route53_health_check_count|route53_hosted_zo
                               ne_count|route53_records_per_hosted_zone|route5
                               3_reusable_delegation_set_count|route53_traffic
                               _policy_count|route53_traffic_policy_instance_c
                               ount|route53_vpcs_per_hosted_zone|route53resolv
                               er_endpoint_count|route53resolver_rule_associat
                               ion_count|route53resolver_rule_count|s3_bucket_
                               count|secretsmanager_secrets_count|sg_count|sns
                               _pending_subscriptions_count|sns_subscriptions_
                               per_topic|sns_topics_count|vpc_acls_per_vpc|vpc
                               _count|vpc_subnets_per_vpc]
Try 'aws-quota-checker check --help' for help.

Error: Invalid value for '[all|am_mesh_count|asg_count|cf_stack_count|cw_alarm_count|dyndb_table_count|ebs_snapshot_count|ec2_eip_count|ec2_on_demand_f_count|ec2_on_demand_g_count|ec2_on_demand_inf_count|ec2_on_demand_p_count|ec2_on_demand_standard_count|ec2_on_demand_x_count|ec2_spot_f_count|ec2_spot_g_count|ec2_spot_inf_count|ec2_spot_p_count|ec2_spot_standard_count|ec2_spot_x_count|ec2_tgw_count|ec2_vpn_connection_count|ecs_count|eks_count|elasticbeanstalk_application_count|elasticbeanstalk_environment_count|elb_alb_count|elb_clb_count|elb_listeners_per_alb|elb_listeners_per_clb|elb_listeners_per_nlb|elb_nlb_count|elb_target_group_count|iam_attached_policy_per_group|iam_attached_policy_per_role|iam_attached_policy_per_user|iam_group_count|iam_policy_count|iam_policy_version_count|iam_server_certificate_count|iam_user_count|ig_count|lc_count|ni_count|route53_health_check_count|route53_hosted_zone_count|route53_records_per_hosted_zone|route53_reusable_delegation_set_count|route53_traffic_policy_count|route53_traffic_policy_instance_count|route53_vpcs_per_hosted_zone|route53resolver_endpoint_count|route53resolver_rule_association_count|route53resolver_rule_count|s3_bucket_count|secretsmanager_secrets_count|sg_count|sns_pending_subscriptions_count|sns_subscriptions_per_topic|sns_topics_count|vpc_acls_per_vpc|vpc_count|vpc_subnets_per_vpc]': invalid choice: all,!vpc_count. (choose from all, am_mesh_count, asg_count, cf_stack_count, cw_alarm_count, dyndb_table_count, ebs_snapshot_count, ec2_eip_count, ec2_on_demand_f_count, ec2_on_demand_g_count, ec2_on_demand_inf_count, ec2_on_demand_p_count, ec2_on_demand_standard_count, ec2_on_demand_x_count, ec2_spot_f_count, ec2_spot_g_count, ec2_spot_inf_count, ec2_spot_p_count, ec2_spot_standard_count, ec2_spot_x_count, ec2_tgw_count, ec2_vpn_connection_count, ecs_count, eks_count, elasticbeanstalk_application_count, elasticbeanstalk_environment_count, elb_alb_count, elb_clb_count, elb_listeners_per_alb, elb_listeners_per_clb, elb_listeners_per_nlb, elb_nlb_count, elb_target_group_count, iam_attached_policy_per_group, iam_attached_policy_per_role, iam_attached_policy_per_user, iam_group_count, iam_policy_count, iam_policy_version_count, iam_server_certificate_count, iam_user_count, ig_count, lc_count, ni_count, route53_health_check_count, route53_hosted_zone_count, route53_records_per_hosted_zone, route53_reusable_delegation_set_count, route53_traffic_policy_count, route53_traffic_policy_instance_count, route53_vpcs_per_hosted_zone, route53resolver_endpoint_count, route53resolver_rule_association_count, route53resolver_rule_count, s3_bucket_count, secretsmanager_secrets_count, sg_count, sns_pending_subscriptions_count, sns_subscriptions_per_topic, sns_topics_count, vpc_acls_per_vpc, vpc_count, vpc_subnets_per_vpc)

Expected output (1.2.0):

(aws-quota-checker) [(HEAD detached at 1.2.0)] aws-quota-checker $ aws-quota-checker check 'all,!vpc_count'
AWS profile: default | AWS region: None | Active checks: am_mesh_count,asg_count,cf_stack_count,cw_alarm_count,dyndb_table_count,ebs_snapshot_count,ec2_eip_count,ec2_on_demand_f_count,ec2_on_demand_g_count,ec2_on_demand_inf_count,ec2_on_demand_p_count,ec2_on_demand_standard_count,ec2_on_demand_x_count,ec2_spot_f_count,ec2_spot_g_count,ec2_spot_inf_count,ec2_spot_p_count,ec2_spot_standard_count,ec2_spot_x_count,ec2_tgw_count,ec2_vpn_connection_count,ecs_count,eks_count,elasticbeanstalk_application_count,elasticbeanstalk_environment_count,elb_alb_count,elb_clb_count,elb_listeners_per_alb,elb_listeners_per_clb,elb_listeners_per_nlb,elb_nlb_count,elb_target_group_count,iam_attached_policy_per_group,iam_attached_policy_per_role,iam_attached_policy_per_user,iam_group_count,iam_policy_count,iam_policy_version_count,iam_server_certificate_count,iam_user_count,ig_count,lc_count,ni_count,route53_health_check_count,route53_hosted_zone_count,route53_records_per_hosted_zone,route53_reusable_delegation_set_count,route53_traffic_policy_count,route53_traffic_policy_instance_count,route53_vpcs_per_hosted_zone,route53resolver_endpoint_count,route53resolver_rule_association_count,route53resolver_rule_count,s3_bucket_count,secretsmanager_secrets_count,sg_count,sns_pending_subscriptions_count,sns_subscriptions_per_topic,sns_topics_count,vpc_acls_per_vpc,vpc_subnets_per_vpc
brennerm commented 3 years ago

Thanks for reporting :+1:

The argument validation introduced was a bit too strict. Should be fixed in release 1.3.1.