diff --git a/libraries/ec2.rb b/libraries/ec2.rb index 6e016619..3f202d0b 100644 --- a/libraries/ec2.rb +++ b/libraries/ec2.rb @@ -42,6 +42,12 @@ def find_snapshot_id(volume_id = '', find_most_recent = false) end def ec2 + begin + require 'aws-sdk' + rescue LoadError + Chef::Log.error("Missing gem 'aws-sdk'. Use the default aws recipe to install it first.") + end + @@ec2 ||= create_aws_interface(::Aws::EC2::Client) end diff --git a/libraries/elb.rb b/libraries/elb.rb index 2c2390bf..67a8d33f 100644 --- a/libraries/elb.rb +++ b/libraries/elb.rb @@ -6,6 +6,11 @@ module Elb include Opscode::Aws::Ec2 def elb + begin + require 'aws-sdk' + rescue LoadError + Chef::Log.error("Missing gem 'aws-sdk'. Use the default aws recipe to install it first.") + end @@elb ||= create_aws_interface(::Aws::ElasticLoadBalancing::Client) end end diff --git a/libraries/s3.rb b/libraries/s3.rb index 596cfb05..5492d283 100644 --- a/libraries/s3.rb +++ b/libraries/s3.rb @@ -6,6 +6,11 @@ module S3 include Opscode::Aws::Ec2 def s3 + begin + require 'aws-sdk' + rescue LoadError + Chef::Log.error("Missing gem 'aws-sdk'. Use the default aws recipe to install it first.") + end @@s3 ||= create_aws_interface(::Aws::S3::Client) end end