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

Add require 'aws-sdk' as needed #183

Merged
merged 1 commit into from
Jan 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libraries/ec2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions libraries/elb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions libraries/s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down