From 779028136634f522e8d6da7e6c486d59a25c9a80 Mon Sep 17 00:00:00 2001 From: Rajiv Date: Mon, 8 Apr 2019 15:55:04 +0530 Subject: [PATCH 1/4] Using specific service gem --- bin/check-alb-target-group-health.rb | 2 +- bin/check-asg-instances-created.rb | 2 +- bin/check-asg-instances-inservice.rb | 2 +- bin/check-autoscaling-cpucredits.rb | 3 ++- bin/check-beanstalk-elb-metric.rb | 2 +- bin/check-beanstalk-health.rb | 2 +- bin/check-certificate-expiry.rb | 2 +- bin/check-cloudfront-tag.rb | 2 +- bin/check-cloudwatch-alarm.rb | 2 +- bin/check-cloudwatch-alarms.rb | 2 +- bin/check-cloudwatch-composite-metric.rb | 2 +- bin/check-cloudwatch-metric.rb | 1 - bin/check-configservice-rules.rb | 2 +- bin/check-direct-connect-virtual-interfaces.rb | 2 +- bin/check-dynamodb-capacity.rb | 3 ++- bin/check-dynamodb-throttle.rb | 3 ++- bin/check-ebs-burst-limit.rb | 2 +- bin/check-ebs-snapshots.rb | 2 +- bin/check-ec2-cpu_balance.rb | 3 ++- bin/check-ec2-filter.rb | 2 +- bin/check-ec2-network.rb | 3 ++- bin/check-ecs-service-health.rb | 2 +- bin/check-efs-metric.rb | 2 +- bin/check-eip-allocation.rb | 2 +- bin/check-elasticache-failover.rb | 2 +- bin/check-elb-certs.rb | 2 +- bin/check-elb-health-sdk.rb | 3 ++- bin/check-elb-instances-inservice.rb | 2 +- bin/check-elb-latency.rb | 3 ++- bin/check-elb-nodes.rb | 2 +- bin/check-elb-sum-requests.rb | 3 ++- bin/check-emr-cluster.rb | 2 +- bin/check-emr-steps.rb | 2 +- bin/check-eni-status.rb | 2 +- bin/check-instance-events.rb | 2 +- bin/check-instance-health.rb | 2 +- bin/check-instance-reachability.rb | 2 +- bin/check-instances-count.rb | 2 +- bin/check-kms-key.rb | 2 +- bin/check-rds-events.rb | 2 +- bin/check-rds-pending.rb | 2 +- bin/check-rds.rb | 4 +++- bin/check-redshift-events.rb | 2 +- bin/check-reserved-instances.rb | 2 +- bin/check-route.rb | 2 +- bin/check-route53-domain-expiration.rb | 2 +- bin/check-s3-bucket.rb | 2 +- bin/check-s3-object.rb | 2 +- bin/check-s3-tag.rb | 2 +- bin/check-sensu-client.rb | 2 +- bin/check-ses-limit.rb | 2 +- bin/check-ses-statistics.rb | 2 +- bin/check-sns-subscriptions.rb | 2 +- bin/check-sqs-messages.rb | 2 +- bin/check-subnet-ip-consumption.rb | 3 ++- bin/check-trustedadvisor-service-limits.rb | 2 +- bin/check-vpc-nameservers.rb | 2 +- bin/check-vpc-vpn.rb | 2 +- bin/handler-ec2_node.rb | 2 +- bin/handler-scale-asg-down.rb | 2 +- bin/handler-scale-asg-up.rb | 2 +- bin/handler-ses.rb | 2 +- bin/handler-sns.rb | 2 +- bin/metrics-asg.rb | 3 ++- bin/metrics-autoscaling-instance-count.rb | 2 +- bin/metrics-billing.rb | 2 +- bin/metrics-cloudfront.rb | 2 +- bin/metrics-ec2-count.rb | 2 +- bin/metrics-ec2-filter.rb | 2 +- bin/metrics-elasticache.rb | 3 ++- bin/metrics-elb.rb | 3 ++- bin/metrics-emr-steps.rb | 2 +- bin/metrics-rds.rb | 3 ++- bin/metrics-s3.rb | 3 ++- bin/metrics-ses.rb | 2 +- bin/metrics-sqs.rb | 2 +- bin/metrics-waf.rb | 2 +- lib/sensu-plugins-aws/cloudwatch-common.rb | 1 + lib/sensu-plugins-aws/common.rb | 1 + test/bin/check_certifcate_expiry_spec.rb | 2 +- test/bin/check_cloudwatch_composite_metric_spec.rb | 2 +- test/bin/check_configservice_rules_spec.rb | 1 - test/bin/check_kms_key_spec.rb | 2 +- test/bin/check_s3_bucket_visibility_spec.rb | 2 +- test/bin/check_subnet_ip_consumption_spec.rb | 2 +- test/ecs_stubs.rb | 2 +- test/lib/cloudwatch_common_spec.rb | 2 +- 87 files changed, 101 insertions(+), 85 deletions(-) diff --git a/bin/check-alb-target-group-health.rb b/bin/check-alb-target-group-health.rb index 8c8e46af..dfbddf75 100755 --- a/bin/check-alb-target-group-health.rb +++ b/bin/check-alb-target-group-health.rb @@ -30,7 +30,7 @@ # Released under the same terms as Sensu (the MIT license); see LICENSE # for details. -require 'aws-sdk' +require 'aws-sdk-elasticloadbalancingv2' require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' diff --git a/bin/check-asg-instances-created.rb b/bin/check-asg-instances-created.rb index c0718c69..ee418ccf 100755 --- a/bin/check-asg-instances-created.rb +++ b/bin/check-asg-instances-created.rb @@ -31,7 +31,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-autoscaling' require 'sensu-plugins-aws' class CheckAsgInstanceCreated < Sensu::Plugin::Check::CLI diff --git a/bin/check-asg-instances-inservice.rb b/bin/check-asg-instances-inservice.rb index 8ec1013f..82f067e8 100755 --- a/bin/check-asg-instances-inservice.rb +++ b/bin/check-asg-instances-inservice.rb @@ -31,7 +31,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-autoscaling' class CheckAsgInstancesInService < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-autoscaling-cpucredits.rb b/bin/check-autoscaling-cpucredits.rb index 76c53b98..92ebac70 100755 --- a/bin/check-autoscaling-cpucredits.rb +++ b/bin/check-autoscaling-cpucredits.rb @@ -28,7 +28,8 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-autoscaling' +require 'aws-sdk-cloudwatch' class CheckEc2CpuCredits < Sensu::Plugin::Check::CLI option :aws_access_key, diff --git a/bin/check-beanstalk-elb-metric.rb b/bin/check-beanstalk-elb-metric.rb index 58d36289..5f9916f0 100755 --- a/bin/check-beanstalk-elb-metric.rb +++ b/bin/check-beanstalk-elb-metric.rb @@ -29,7 +29,7 @@ require 'sensu-plugins-aws/cloudwatch-common' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-elasticbeanstalk' class BeanstalkELBCheck < Sensu::Plugin::Check::CLI option :environment, diff --git a/bin/check-beanstalk-health.rb b/bin/check-beanstalk-health.rb index 3fd1fc0a..737c27c2 100755 --- a/bin/check-beanstalk-health.rb +++ b/bin/check-beanstalk-health.rb @@ -28,7 +28,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-elasticbeanstalk' require 'json' class BeanstalkHealth < Sensu::Plugin::Check::CLI diff --git a/bin/check-certificate-expiry.rb b/bin/check-certificate-expiry.rb index d59fb6a2..1b4954bd 100755 --- a/bin/check-certificate-expiry.rb +++ b/bin/check-certificate-expiry.rb @@ -29,7 +29,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-iam' class CheckCertificateExpiry < Sensu::Plugin::Check::CLI option :aws_access_key, diff --git a/bin/check-cloudfront-tag.rb b/bin/check-cloudfront-tag.rb index 41f60eb0..9cf5fffa 100755 --- a/bin/check-cloudfront-tag.rb +++ b/bin/check-cloudfront-tag.rb @@ -28,7 +28,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws/common' -require 'aws-sdk' +require 'aws-sdk-cloudfront' class CheckCloudFrontTag < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-cloudwatch-alarm.rb b/bin/check-cloudwatch-alarm.rb index e66a4e32..a13222bb 100755 --- a/bin/check-cloudwatch-alarm.rb +++ b/bin/check-cloudwatch-alarm.rb @@ -31,7 +31,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-cloudwatch' class CloudWatchCheck < Sensu::Plugin::Check::CLI option :aws_access_key, diff --git a/bin/check-cloudwatch-alarms.rb b/bin/check-cloudwatch-alarms.rb index 0d583141..db7ff763 100755 --- a/bin/check-cloudwatch-alarms.rb +++ b/bin/check-cloudwatch-alarms.rb @@ -29,7 +29,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws/common' -require 'aws-sdk' +require 'aws-sdk-cloudwatch' class CloudWatchCheck < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-cloudwatch-composite-metric.rb b/bin/check-cloudwatch-composite-metric.rb index 9fb7079a..e80be250 100755 --- a/bin/check-cloudwatch-composite-metric.rb +++ b/bin/check-cloudwatch-composite-metric.rb @@ -32,7 +32,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-cloudwatch' class CloudWatchCompositeMetricCheck < Sensu::Plugin::Check::CLI option :aws_region, diff --git a/bin/check-cloudwatch-metric.rb b/bin/check-cloudwatch-metric.rb index 6d599706..2378079d 100755 --- a/bin/check-cloudwatch-metric.rb +++ b/bin/check-cloudwatch-metric.rb @@ -29,7 +29,6 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' class CloudWatchMetricCheck < Sensu::Plugin::Check::CLI option :aws_region, diff --git a/bin/check-configservice-rules.rb b/bin/check-configservice-rules.rb index 95f07909..ed5ab4e3 100755 --- a/bin/check-configservice-rules.rb +++ b/bin/check-configservice-rules.rb @@ -31,7 +31,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-configservice' class CheckConfigServiceRules < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-direct-connect-virtual-interfaces.rb b/bin/check-direct-connect-virtual-interfaces.rb index 9163f2dd..94547749 100755 --- a/bin/check-direct-connect-virtual-interfaces.rb +++ b/bin/check-direct-connect-virtual-interfaces.rb @@ -32,7 +32,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-directconnect' class CheckDcVirtualInterfacesHealth < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-dynamodb-capacity.rb b/bin/check-dynamodb-capacity.rb index 03da5f07..d44429a6 100755 --- a/bin/check-dynamodb-capacity.rb +++ b/bin/check-dynamodb-capacity.rb @@ -31,7 +31,8 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-dynamodb' +require 'aws-sdk-cloudwatch' require 'time' class CheckDynamoDB < Sensu::Plugin::Check::CLI diff --git a/bin/check-dynamodb-throttle.rb b/bin/check-dynamodb-throttle.rb index b2b2427f..2ace6b05 100755 --- a/bin/check-dynamodb-throttle.rb +++ b/bin/check-dynamodb-throttle.rb @@ -28,7 +28,8 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-dynamodb' +require 'aws-sdk-cloudwatch' require 'time' class CheckDynamoDB < Sensu::Plugin::Check::CLI diff --git a/bin/check-ebs-burst-limit.rb b/bin/check-ebs-burst-limit.rb index 8fef68fe..4a10cf5d 100755 --- a/bin/check-ebs-burst-limit.rb +++ b/bin/check-ebs-burst-limit.rb @@ -29,7 +29,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-ec2' require 'net/http' class CheckEbsBurstLimit < Sensu::Plugin::Check::CLI diff --git a/bin/check-ebs-snapshots.rb b/bin/check-ebs-snapshots.rb index b8384031..4d8a489f 100755 --- a/bin/check-ebs-snapshots.rb +++ b/bin/check-ebs-snapshots.rb @@ -33,7 +33,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-elasticloadbalancing' class CheckEbsSnapshots < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-ec2-cpu_balance.rb b/bin/check-ec2-cpu_balance.rb index bedc5530..dec7f6eb 100755 --- a/bin/check-ec2-cpu_balance.rb +++ b/bin/check-ec2-cpu_balance.rb @@ -30,7 +30,8 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-ec2' +require 'aws-sdk-cloudwatch' class EC2CpuBalance < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-ec2-filter.rb b/bin/check-ec2-filter.rb index 375dbc98..7b350c65 100755 --- a/bin/check-ec2-filter.rb +++ b/bin/check-ec2-filter.rb @@ -30,7 +30,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-ec2' require 'sensu-plugins-aws/filter' class EC2Filter < Sensu::Plugin::Check::CLI diff --git a/bin/check-ec2-network.rb b/bin/check-ec2-network.rb index c26a6aba..0aa67ac4 100755 --- a/bin/check-ec2-network.rb +++ b/bin/check-ec2-network.rb @@ -29,7 +29,8 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-ec2' +require 'aws-sdk-cloudwatch' class CheckEc2Network < Sensu::Plugin::Check::CLI option :aws_access_key, diff --git a/bin/check-ecs-service-health.rb b/bin/check-ecs-service-health.rb index 67fed10d..985fa17d 100755 --- a/bin/check-ecs-service-health.rb +++ b/bin/check-ecs-service-health.rb @@ -38,7 +38,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-ecs' class CheckEcsServiceHealth < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-efs-metric.rb b/bin/check-efs-metric.rb index c4b84397..52798099 100755 --- a/bin/check-efs-metric.rb +++ b/bin/check-efs-metric.rb @@ -30,7 +30,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-efs' # A Sensu plugin which uses cloudwatch-common to check EFS CloudWatch metrics class EFSMetric < Sensu::Plugin::Check::CLI diff --git a/bin/check-eip-allocation.rb b/bin/check-eip-allocation.rb index f0bcb558..3a0ea5d6 100755 --- a/bin/check-eip-allocation.rb +++ b/bin/check-eip-allocation.rb @@ -28,7 +28,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-ec2' class CheckEipAllocation < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-elasticache-failover.rb b/bin/check-elasticache-failover.rb index 0dc77e75..f44556d8 100755 --- a/bin/check-elasticache-failover.rb +++ b/bin/check-elasticache-failover.rb @@ -29,7 +29,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-elasticache' require 'sensu-plugins-aws/common' class CheckElastiCacheFailover < Sensu::Plugin::Check::CLI diff --git a/bin/check-elb-certs.rb b/bin/check-elb-certs.rb index e46e9758..36673446 100755 --- a/bin/check-elb-certs.rb +++ b/bin/check-elb-certs.rb @@ -29,7 +29,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-elasticloadbalancing' require 'net/http' require 'openssl' diff --git a/bin/check-elb-health-sdk.rb b/bin/check-elb-health-sdk.rb index 25a62b11..b5048574 100755 --- a/bin/check-elb-health-sdk.rb +++ b/bin/check-elb-health-sdk.rb @@ -28,7 +28,8 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-elasticloadbalancing' +require 'aws-sdk-ec2' class ELBHealth < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-elb-instances-inservice.rb b/bin/check-elb-instances-inservice.rb index 22c15d71..260f17a8 100755 --- a/bin/check-elb-instances-inservice.rb +++ b/bin/check-elb-instances-inservice.rb @@ -31,7 +31,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-elasticloadbalancing' require 'sensu-plugins-aws' class CheckElbInstanceInService < Sensu::Plugin::Check::CLI diff --git a/bin/check-elb-latency.rb b/bin/check-elb-latency.rb index fea9234e..a0d17f38 100755 --- a/bin/check-elb-latency.rb +++ b/bin/check-elb-latency.rb @@ -33,7 +33,8 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-elasticloadbalancing' +require 'cloudwatch' class CheckELBLatency < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-elb-nodes.rb b/bin/check-elb-nodes.rb index 3ffea7f9..3ccdaa44 100755 --- a/bin/check-elb-nodes.rb +++ b/bin/check-elb-nodes.rb @@ -33,7 +33,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-elasticloadbalancing' class CheckELBNodes < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-elb-sum-requests.rb b/bin/check-elb-sum-requests.rb index 6d80f130..a3d36000 100755 --- a/bin/check-elb-sum-requests.rb +++ b/bin/check-elb-sum-requests.rb @@ -32,7 +32,8 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-elasticloadbalancing' +require 'aws-sdk-cloudwatch' class CheckELBSumRequests < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-emr-cluster.rb b/bin/check-emr-cluster.rb index 3918bd71..dcb706cd 100755 --- a/bin/check-emr-cluster.rb +++ b/bin/check-emr-cluster.rb @@ -27,7 +27,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-emr' class CheckEMRCluster < Sensu::Plugin::Check::CLI option :aws_access_key, diff --git a/bin/check-emr-steps.rb b/bin/check-emr-steps.rb index 7ed882ab..aa64e7cf 100755 --- a/bin/check-emr-steps.rb +++ b/bin/check-emr-steps.rb @@ -26,7 +26,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-emr' class CheckEMRSteps < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-eni-status.rb b/bin/check-eni-status.rb index 94b750ae..f4b28b13 100755 --- a/bin/check-eni-status.rb +++ b/bin/check-eni-status.rb @@ -29,7 +29,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-ec2' # # Check ENI Status diff --git a/bin/check-instance-events.rb b/bin/check-instance-events.rb index b9b18ecc..265a1dc9 100755 --- a/bin/check-instance-events.rb +++ b/bin/check-instance-events.rb @@ -28,7 +28,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-ec2' class CheckInstanceEvents < Sensu::Plugin::Check::CLI option :aws_access_key, diff --git a/bin/check-instance-health.rb b/bin/check-instance-health.rb index 5edd2ff3..388d0448 100755 --- a/bin/check-instance-health.rb +++ b/bin/check-instance-health.rb @@ -29,7 +29,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-ec2' class CheckInstanceEvents < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-instance-reachability.rb b/bin/check-instance-reachability.rb index cba36a79..758e65db 100755 --- a/bin/check-instance-reachability.rb +++ b/bin/check-instance-reachability.rb @@ -27,7 +27,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-ec2' require 'sensu-plugins-aws' class CheckInstanceReachability < Sensu::Plugin::Check::CLI diff --git a/bin/check-instances-count.rb b/bin/check-instances-count.rb index dbfd6944..29c4afe5 100755 --- a/bin/check-instances-count.rb +++ b/bin/check-instances-count.rb @@ -32,7 +32,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-autoscaling' # Class to check the instance count class CheckInstanceCount < Sensu::Plugin::Check::CLI diff --git a/bin/check-kms-key.rb b/bin/check-kms-key.rb index b6bbaa7e..0b0f4ffc 100755 --- a/bin/check-kms-key.rb +++ b/bin/check-kms-key.rb @@ -32,7 +32,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-kms' class CheckKMSKey < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-rds-events.rb b/bin/check-rds-events.rb index 5d126ac1..4b78d5d2 100755 --- a/bin/check-rds-events.rb +++ b/bin/check-rds-events.rb @@ -41,7 +41,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-rds' class CheckRDSEvents < Sensu::Plugin::Check::CLI option :aws_access_key, diff --git a/bin/check-rds-pending.rb b/bin/check-rds-pending.rb index 4529f373..c2026870 100755 --- a/bin/check-rds-pending.rb +++ b/bin/check-rds-pending.rb @@ -29,7 +29,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-rds' class CheckRDSPending < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-rds.rb b/bin/check-rds.rb index 4a6673a7..106d6e2f 100755 --- a/bin/check-rds.rb +++ b/bin/check-rds.rb @@ -54,7 +54,9 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-rds' +require 'aws-sdk-cloudwatch' + require 'time' class CheckRDS < Sensu::Plugin::Check::CLI diff --git a/bin/check-redshift-events.rb b/bin/check-redshift-events.rb index 588d0b25..e6c7289f 100755 --- a/bin/check-redshift-events.rb +++ b/bin/check-redshift-events.rb @@ -36,7 +36,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-redshift' class CheckRedshiftEvents < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-reserved-instances.rb b/bin/check-reserved-instances.rb index 455134df..36df5ea0 100755 --- a/bin/check-reserved-instances.rb +++ b/bin/check-reserved-instances.rb @@ -28,7 +28,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-ec2' class CheckReservedInstances < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-route.rb b/bin/check-route.rb index e3e02250..41171f6f 100755 --- a/bin/check-route.rb +++ b/bin/check-route.rb @@ -27,7 +27,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-ec2' require 'sensu-plugins-aws' class CheckRoute < Sensu::Plugin::Check::CLI diff --git a/bin/check-route53-domain-expiration.rb b/bin/check-route53-domain-expiration.rb index cfbedc40..e0b963d3 100755 --- a/bin/check-route53-domain-expiration.rb +++ b/bin/check-route53-domain-expiration.rb @@ -22,7 +22,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-route53domains' class CheckRoute53DomainExpiration < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-s3-bucket.rb b/bin/check-s3-bucket.rb index 31224a37..2e883e4e 100755 --- a/bin/check-s3-bucket.rb +++ b/bin/check-s3-bucket.rb @@ -27,7 +27,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-s3' class CheckS3Bucket < Sensu::Plugin::Check::CLI option :aws_access_key, diff --git a/bin/check-s3-object.rb b/bin/check-s3-object.rb index 41fd55f0..47ee857d 100755 --- a/bin/check-s3-object.rb +++ b/bin/check-s3-object.rb @@ -29,7 +29,7 @@ # require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-s3' class CheckS3Object < Sensu::Plugin::Check::CLI option :aws_access_key, diff --git a/bin/check-s3-tag.rb b/bin/check-s3-tag.rb index df5cecdb..4d4ff8f7 100755 --- a/bin/check-s3-tag.rb +++ b/bin/check-s3-tag.rb @@ -28,7 +28,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws/common' -require 'aws-sdk' +require 'aws-sdk-s3' class CheckS3Tag < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-sensu-client.rb b/bin/check-sensu-client.rb index 10458309..e2cb6f89 100755 --- a/bin/check-sensu-client.rb +++ b/bin/check-sensu-client.rb @@ -32,7 +32,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-ec2' require 'rest-client' require 'json' diff --git a/bin/check-ses-limit.rb b/bin/check-ses-limit.rb index a7a90ef6..aaabe24c 100755 --- a/bin/check-ses-limit.rb +++ b/bin/check-ses-limit.rb @@ -31,7 +31,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-ses' class CheckSESLimit < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-ses-statistics.rb b/bin/check-ses-statistics.rb index 0f647477..cec7c5de 100755 --- a/bin/check-ses-statistics.rb +++ b/bin/check-ses-statistics.rb @@ -29,7 +29,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-ses' class CheckSesStatistics < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-sns-subscriptions.rb b/bin/check-sns-subscriptions.rb index 57716fcf..a08a8505 100755 --- a/bin/check-sns-subscriptions.rb +++ b/bin/check-sns-subscriptions.rb @@ -28,7 +28,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-sns' class CheckSNSSubscriptions < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-sqs-messages.rb b/bin/check-sqs-messages.rb index ca3cbea5..590a9c58 100755 --- a/bin/check-sqs-messages.rb +++ b/bin/check-sqs-messages.rb @@ -29,7 +29,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-sqs' # # Check SQS Messages diff --git a/bin/check-subnet-ip-consumption.rb b/bin/check-subnet-ip-consumption.rb index ce4ef243..74342019 100755 --- a/bin/check-subnet-ip-consumption.rb +++ b/bin/check-subnet-ip-consumption.rb @@ -33,7 +33,8 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-ec2' +require 'aws-sdk-iam' class CheckSubnetIpConsumption < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-trustedadvisor-service-limits.rb b/bin/check-trustedadvisor-service-limits.rb index 3e92a86e..3a79cc4a 100755 --- a/bin/check-trustedadvisor-service-limits.rb +++ b/bin/check-trustedadvisor-service-limits.rb @@ -35,7 +35,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-support' class CheckTrustedAdvisorServiceLimits < Sensu::Plugin::Check::CLI include Common diff --git a/bin/check-vpc-nameservers.rb b/bin/check-vpc-nameservers.rb index d7c8729a..923d074f 100755 --- a/bin/check-vpc-nameservers.rb +++ b/bin/check-vpc-nameservers.rb @@ -30,7 +30,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-ec2' require 'resolv' class CheckVpcNameservers < Sensu::Plugin::Check::CLI diff --git a/bin/check-vpc-vpn.rb b/bin/check-vpc-vpn.rb index 1443b18c..c5c16121 100755 --- a/bin/check-vpc-vpn.rb +++ b/bin/check-vpc-vpn.rb @@ -31,7 +31,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' -require 'aws-sdk' +require 'aws-sdk-ec2' class CheckAwsVpcVpnConnections < Sensu::Plugin::Check::CLI include Common diff --git a/bin/handler-ec2_node.rb b/bin/handler-ec2_node.rb index 9f3c7f30..8c6c3eaf 100755 --- a/bin/handler-ec2_node.rb +++ b/bin/handler-ec2_node.rb @@ -149,7 +149,7 @@ require 'sensu-handler' require 'net/http' require 'uri' -require 'aws-sdk' +require 'aws-sdk-ec2' require 'sensu-plugins-aws' class Ec2Node < Sensu::Handler diff --git a/bin/handler-scale-asg-down.rb b/bin/handler-scale-asg-down.rb index 1a1ecdc8..6f2b97ec 100755 --- a/bin/handler-scale-asg-down.rb +++ b/bin/handler-scale-asg-down.rb @@ -37,7 +37,7 @@ # for details. # -require 'aws-sdk' +require 'aws-sdk-autoscaling' require 'json' require 'sensu-handler' diff --git a/bin/handler-scale-asg-up.rb b/bin/handler-scale-asg-up.rb index 12349914..a07de870 100755 --- a/bin/handler-scale-asg-up.rb +++ b/bin/handler-scale-asg-up.rb @@ -37,7 +37,7 @@ # for details. # -require 'aws-sdk' +require 'aws-sdk-autoscaling' require 'json' require 'sensu-handler' diff --git a/bin/handler-ses.rb b/bin/handler-ses.rb index d50519b1..5d5744f6 100755 --- a/bin/handler-ses.rb +++ b/bin/handler-ses.rb @@ -11,7 +11,7 @@ # for details. require 'sensu-handler' -require 'aws-sdk' +require 'aws-sdk-ses' class SESNotifier < Sensu::Handler def event_name diff --git a/bin/handler-sns.rb b/bin/handler-sns.rb index bbd4985e..1088bd3a 100755 --- a/bin/handler-sns.rb +++ b/bin/handler-sns.rb @@ -10,7 +10,7 @@ # for details require 'sensu-handler' -require 'aws-sdk' +require 'aws-sdk-sns' require 'erubis' class SnsNotifier < Sensu::Handler diff --git a/bin/metrics-asg.rb b/bin/metrics-asg.rb index 6fb500db..123ec102 100755 --- a/bin/metrics-asg.rb +++ b/bin/metrics-asg.rb @@ -31,7 +31,8 @@ # require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-autoscaling' +require 'aws-sdk-cloudwatch' require 'sensu-plugins-aws' require 'time' diff --git a/bin/metrics-autoscaling-instance-count.rb b/bin/metrics-autoscaling-instance-count.rb index 8decd734..8d7aa2bc 100755 --- a/bin/metrics-autoscaling-instance-count.rb +++ b/bin/metrics-autoscaling-instance-count.rb @@ -27,7 +27,7 @@ # require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-autoscaling' class AutoScalingInstanceCountMetrics < Sensu::Plugin::Metric::CLI::Graphite option :groupname, diff --git a/bin/metrics-billing.rb b/bin/metrics-billing.rb index fd576b92..0864db81 100755 --- a/bin/metrics-billing.rb +++ b/bin/metrics-billing.rb @@ -28,7 +28,7 @@ # require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-cloudwatch' require 'sensu-plugins-aws' class BillingMetrics < Sensu::Plugin::Metric::CLI::Graphite diff --git a/bin/metrics-cloudfront.rb b/bin/metrics-cloudfront.rb index feb72792..3422f4fc 100755 --- a/bin/metrics-cloudfront.rb +++ b/bin/metrics-cloudfront.rb @@ -29,7 +29,7 @@ # require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-cloudwatch' require 'sensu-plugins-aws' require 'time' diff --git a/bin/metrics-ec2-count.rb b/bin/metrics-ec2-count.rb index 64c33705..f8be7ebe 100755 --- a/bin/metrics-ec2-count.rb +++ b/bin/metrics-ec2-count.rb @@ -32,7 +32,7 @@ require 'sensu-plugin/metric/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-ec2' class EC2Metrics < Sensu::Plugin::Metric::CLI::Graphite include Common diff --git a/bin/metrics-ec2-filter.rb b/bin/metrics-ec2-filter.rb index dee4d0bc..35ccc051 100755 --- a/bin/metrics-ec2-filter.rb +++ b/bin/metrics-ec2-filter.rb @@ -28,7 +28,7 @@ # require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-ec2' require 'sensu-plugins-aws' class EC2Filter < Sensu::Plugin::Metric::CLI::Graphite diff --git a/bin/metrics-elasticache.rb b/bin/metrics-elasticache.rb index b965cf62..dbba0113 100755 --- a/bin/metrics-elasticache.rb +++ b/bin/metrics-elasticache.rb @@ -31,7 +31,8 @@ # require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-cloudwatch' +require 'aws-sdk-elasticache' require 'sensu-plugins-aws' require 'time' diff --git a/bin/metrics-elb.rb b/bin/metrics-elb.rb index de25f111..6d10c1f2 100755 --- a/bin/metrics-elb.rb +++ b/bin/metrics-elb.rb @@ -37,7 +37,8 @@ # Using aws sdk version 2 require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-elasticloadbalancing' +require 'aws-sdk-cloudwatch' require 'sensu-plugins-aws' require 'time' diff --git a/bin/metrics-emr-steps.rb b/bin/metrics-emr-steps.rb index 38e17c69..114aad8e 100755 --- a/bin/metrics-emr-steps.rb +++ b/bin/metrics-emr-steps.rb @@ -27,7 +27,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-emr' class EMRStepMetrics < Sensu::Plugin::Metric::CLI::Graphite include Common diff --git a/bin/metrics-rds.rb b/bin/metrics-rds.rb index 3ab59071..45cfbc21 100755 --- a/bin/metrics-rds.rb +++ b/bin/metrics-rds.rb @@ -29,7 +29,8 @@ require 'sensu-plugins-aws' require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-rds' +require 'aws-sdk-cloudwatch' require 'time' class RDSMetrics < Sensu::Plugin::Metric::CLI::Graphite diff --git a/bin/metrics-s3.rb b/bin/metrics-s3.rb index e386157b..ac70f778 100755 --- a/bin/metrics-s3.rb +++ b/bin/metrics-s3.rb @@ -28,7 +28,8 @@ # require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-s3' +require 'aws-sdk-cloudwatch' require 'sensu-plugins-aws' class S3Metrics < Sensu::Plugin::Metric::CLI::Graphite diff --git a/bin/metrics-ses.rb b/bin/metrics-ses.rb index ca10ba15..5d9cc93e 100755 --- a/bin/metrics-ses.rb +++ b/bin/metrics-ses.rb @@ -26,7 +26,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-ses' class SesMetrics < Sensu::Plugin::Metric::CLI::Graphite include Common diff --git a/bin/metrics-sqs.rb b/bin/metrics-sqs.rb index 6c63b306..f3032a55 100755 --- a/bin/metrics-sqs.rb +++ b/bin/metrics-sqs.rb @@ -29,7 +29,7 @@ require 'sensu-plugin/metric/cli' require 'sensu-plugins-aws' -require 'aws-sdk' +require 'aws-sdk-sqs' class SQSMetrics < Sensu::Plugin::Metric::CLI::Graphite include Common diff --git a/bin/metrics-waf.rb b/bin/metrics-waf.rb index 0ce2adb4..6328b36d 100755 --- a/bin/metrics-waf.rb +++ b/bin/metrics-waf.rb @@ -29,7 +29,7 @@ # require 'sensu-plugin/metric/cli' -require 'aws-sdk' +require 'aws-sdk-cloudwatch' require 'sensu-plugins-aws' require 'time' diff --git a/lib/sensu-plugins-aws/cloudwatch-common.rb b/lib/sensu-plugins-aws/cloudwatch-common.rb index 99f9bc6c..3611eac6 100644 --- a/lib/sensu-plugins-aws/cloudwatch-common.rb +++ b/lib/sensu-plugins-aws/cloudwatch-common.rb @@ -1,4 +1,5 @@ module CloudwatchCommon + require 'aws-sdk-cloudwatch' include Common def client diff --git a/lib/sensu-plugins-aws/common.rb b/lib/sensu-plugins-aws/common.rb index 5515c0b9..192e618b 100755 --- a/lib/sensu-plugins-aws/common.rb +++ b/lib/sensu-plugins-aws/common.rb @@ -17,6 +17,7 @@ # module Common + require 'aws-sdk-core' def initialize(argv = ARGV) super(argv) aws_config diff --git a/test/bin/check_certifcate_expiry_spec.rb b/test/bin/check_certifcate_expiry_spec.rb index 6b3f7f40..9f664c5e 100644 --- a/test/bin/check_certifcate_expiry_spec.rb +++ b/test/bin/check_certifcate_expiry_spec.rb @@ -1,4 +1,4 @@ -require 'aws-sdk' +require 'aws-sdk-iam' require_relative '../../bin/check-certificate-expiry.rb' require_relative '../spec_helper.rb' diff --git a/test/bin/check_cloudwatch_composite_metric_spec.rb b/test/bin/check_cloudwatch_composite_metric_spec.rb index 6b590957..7a542fde 100644 --- a/test/bin/check_cloudwatch_composite_metric_spec.rb +++ b/test/bin/check_cloudwatch_composite_metric_spec.rb @@ -1,4 +1,4 @@ -require 'aws-sdk' +require 'aws-sdk-cloudwatch' require_relative '../../bin/check-cloudwatch-composite-metric.rb' require_relative '../spec_helper.rb' diff --git a/test/bin/check_configservice_rules_spec.rb b/test/bin/check_configservice_rules_spec.rb index 6a2ed174..b665343f 100644 --- a/test/bin/check_configservice_rules_spec.rb +++ b/test/bin/check_configservice_rules_spec.rb @@ -1,4 +1,3 @@ -require 'aws-sdk' require_relative '../spec_helper.rb' require_relative '../../bin/check-configservice-rules.rb' diff --git a/test/bin/check_kms_key_spec.rb b/test/bin/check_kms_key_spec.rb index fed68e19..931f402f 100644 --- a/test/bin/check_kms_key_spec.rb +++ b/test/bin/check_kms_key_spec.rb @@ -1,4 +1,4 @@ -require 'aws-sdk' +require 'aws-sdk-kms' require_relative '../../bin/check-kms-key.rb' require_relative '../spec_helper.rb' diff --git a/test/bin/check_s3_bucket_visibility_spec.rb b/test/bin/check_s3_bucket_visibility_spec.rb index b98283d7..13148038 100644 --- a/test/bin/check_s3_bucket_visibility_spec.rb +++ b/test/bin/check_s3_bucket_visibility_spec.rb @@ -1,4 +1,4 @@ -require 'aws-sdk' +require 'aws-sdk-s3' require_relative '../../bin/check-s3-bucket-visibility.rb' require_relative '../spec_helper.rb' diff --git a/test/bin/check_subnet_ip_consumption_spec.rb b/test/bin/check_subnet_ip_consumption_spec.rb index a92aa010..c3cd9b27 100644 --- a/test/bin/check_subnet_ip_consumption_spec.rb +++ b/test/bin/check_subnet_ip_consumption_spec.rb @@ -1,4 +1,4 @@ -require 'aws-sdk' +require 'aws-sdk-core' require 'ostruct' require_relative '../../bin/check-subnet-ip-consumption.rb' require_relative '../spec_helper.rb' diff --git a/test/ecs_stubs.rb b/test/ecs_stubs.rb index 3fc805d9..93947594 100644 --- a/test/ecs_stubs.rb +++ b/test/ecs_stubs.rb @@ -1,4 +1,4 @@ -require 'aws-sdk' +require 'aws-sdk-core' DEPLOYING_SERVICE = { service_arn: 'arn:aws:ecs:us-east-1:123456789012:service/my-deploying-ecs-service', diff --git a/test/lib/cloudwatch_common_spec.rb b/test/lib/cloudwatch_common_spec.rb index 966ba611..939ae0fd 100644 --- a/test/lib/cloudwatch_common_spec.rb +++ b/test/lib/cloudwatch_common_spec.rb @@ -1,4 +1,4 @@ -require 'aws-sdk' +require 'aws-sdk-cloudwatch' class DummyCheck < Sensu::Plugin::Check::CLI at_exit do From b6f01ab8ab59a1f82cbfd594f92b98eff1ab0a09 Mon Sep 17 00:00:00 2001 From: Rajiv Date: Mon, 8 Apr 2019 15:59:45 +0530 Subject: [PATCH 2/4] Updated Gemspec dependencies to aws service gems used by plugin --- sensu-plugins-aws.gemspec | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/sensu-plugins-aws.gemspec b/sensu-plugins-aws.gemspec index 267b0cc1..a1c29f1a 100644 --- a/sensu-plugins-aws.gemspec +++ b/sensu-plugins-aws.gemspec @@ -31,9 +31,32 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength s.test_files = s.files.grep(%r{^(test|spec|features)/}) s.version = SensuPluginsAWS::Version::VER_STRING - s.add_runtime_dependency 'sensu-plugin', '~> 4.0' + s.add_runtime_dependency 'sensu-plugin', '~> 4.0' - s.add_runtime_dependency 'aws-sdk', '~> 3.0' + s.add_runtime_dependency 'aws-sdk-autoscaling', '~> 1.20.0' + s.add_runtime_dependency 'aws-sdk-cloudfront', '~> 1.15.0' + s.add_runtime_dependency 'aws-sdk-cloudwatch', '~> 1.19.0' + s.add_runtime_dependency 'aws-sdk-configservice', '~> 1.26.0' + s.add_runtime_dependency 'aws-sdk-core', '~> 3.48.0' + s.add_runtime_dependency 'aws-sdk-directconnect', '~> 1.16.0' + s.add_runtime_dependency 'aws-sdk-dynamodb', '~> 1.25.0' + s.add_runtime_dependency 'aws-sdk-ec2', '~> 1.78.0' + s.add_runtime_dependency 'aws-sdk-ecs', '~> 1.36.0' + s.add_runtime_dependency 'aws-sdk-efs', '~> 1.13.0' + s.add_runtime_dependency 'aws-sdk-elasticache', '~> 1.14.0' + s.add_runtime_dependency 'aws-sdk-elasticbeanstalk', '~> 1.19.0' + s.add_runtime_dependency 'aws-sdk-elasticloadbalancing', '~> 1.12.0' + s.add_runtime_dependency 'aws-sdk-elasticloadbalancingv2', '~> 1.26.0' + s.add_runtime_dependency 'aws-sdk-emr', '~> 1.14.0' + s.add_runtime_dependency 'aws-sdk-iam', '~> 1.18.0' + s.add_runtime_dependency 'aws-sdk-kms', '~> 1.16.0' + s.add_runtime_dependency 'aws-sdk-redshift', '~> 1.22.0' + s.add_runtime_dependency 'aws-sdk-route53domains', '~> 1.11.0' + s.add_runtime_dependency 'aws-sdk-s3', '~> 1.36.0' + s.add_runtime_dependency 'aws-sdk-ses', '~> 1.18.0' + s.add_runtime_dependency 'aws-sdk-sns', '~> 1.12.0' + s.add_runtime_dependency 'aws-sdk-sqs', '~> 1.13.0' + s.add_runtime_dependency 'aws-sdk-support', '~> 1.9.0' s.add_runtime_dependency 'erubis', '2.7.0' s.add_runtime_dependency 'fog', '1.32.0' # 1.44 requires xmlrpc which only supports >= ruby 2.3 From f0cfbc692f7f23dbe64c41cc035ddf7146638f01 Mon Sep 17 00:00:00 2001 From: Rajiv Date: Mon, 8 Apr 2019 17:43:41 +0530 Subject: [PATCH 3/4] Updated change log --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a868465..0316ec12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md) ## [Unreleased] +### Breaking Changes +Pulling only needed service gems from aws (@rajiv) ## [18.0.0] - 2019-04-2 ### Breaking Changes From 39bd864be2f79c90624a4f13bddc1d1e244cfdc6 Mon Sep 17 00:00:00 2001 From: Rajiv Date: Mon, 8 Apr 2019 19:02:11 +0530 Subject: [PATCH 4/4] Fixed library dependencies --- bin/check-beanstalk-elb-metric.rb | 1 + bin/check-cloudwatch-metric.rb | 1 + bin/check-ebs-burst-limit.rb | 1 + bin/check-efs-metric.rb | 1 + lib/sensu-plugins-aws/cloudwatch-common.rb | 1 - lib/sensu-plugins-aws/common.rb | 1 - 6 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/check-beanstalk-elb-metric.rb b/bin/check-beanstalk-elb-metric.rb index 5f9916f0..fd92c017 100755 --- a/bin/check-beanstalk-elb-metric.rb +++ b/bin/check-beanstalk-elb-metric.rb @@ -30,6 +30,7 @@ require 'sensu-plugins-aws/cloudwatch-common' require 'sensu-plugin/check/cli' require 'aws-sdk-elasticbeanstalk' +require 'aws-sdk-cloudwatch' class BeanstalkELBCheck < Sensu::Plugin::Check::CLI option :environment, diff --git a/bin/check-cloudwatch-metric.rb b/bin/check-cloudwatch-metric.rb index 2378079d..4f6870d3 100755 --- a/bin/check-cloudwatch-metric.rb +++ b/bin/check-cloudwatch-metric.rb @@ -29,6 +29,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' +require 'aws-sdk-cloudwatch' class CloudWatchMetricCheck < Sensu::Plugin::Check::CLI option :aws_region, diff --git a/bin/check-ebs-burst-limit.rb b/bin/check-ebs-burst-limit.rb index 4a10cf5d..c57cbaf6 100755 --- a/bin/check-ebs-burst-limit.rb +++ b/bin/check-ebs-burst-limit.rb @@ -30,6 +30,7 @@ require 'sensu-plugin/check/cli' require 'sensu-plugins-aws' require 'aws-sdk-ec2' +require 'aws-sdk-cloudwatch' require 'net/http' class CheckEbsBurstLimit < Sensu::Plugin::Check::CLI diff --git a/bin/check-efs-metric.rb b/bin/check-efs-metric.rb index 52798099..d764d154 100755 --- a/bin/check-efs-metric.rb +++ b/bin/check-efs-metric.rb @@ -31,6 +31,7 @@ require 'sensu-plugins-aws' require 'sensu-plugin/check/cli' require 'aws-sdk-efs' +require 'aws-sdk-cloudwatch' # A Sensu plugin which uses cloudwatch-common to check EFS CloudWatch metrics class EFSMetric < Sensu::Plugin::Check::CLI diff --git a/lib/sensu-plugins-aws/cloudwatch-common.rb b/lib/sensu-plugins-aws/cloudwatch-common.rb index 3611eac6..99f9bc6c 100644 --- a/lib/sensu-plugins-aws/cloudwatch-common.rb +++ b/lib/sensu-plugins-aws/cloudwatch-common.rb @@ -1,5 +1,4 @@ module CloudwatchCommon - require 'aws-sdk-cloudwatch' include Common def client diff --git a/lib/sensu-plugins-aws/common.rb b/lib/sensu-plugins-aws/common.rb index 192e618b..5515c0b9 100755 --- a/lib/sensu-plugins-aws/common.rb +++ b/lib/sensu-plugins-aws/common.rb @@ -17,7 +17,6 @@ # module Common - require 'aws-sdk-core' def initialize(argv = ARGV) super(argv) aws_config