Module: RubyAemAws::S3Access

Included in:
Component::StackManagerResources
Defined in:
lib/ruby_aem_aws/client/s3.rb

Overview

Mixin for interaction with AWS S3

Instance Method Summary collapse

Instance Method Details

#get_s3_bucket(bucket) ⇒ Object



20
21
22
# File 'lib/ruby_aem_aws/client/s3.rb', line 20

def get_s3_bucket(bucket)
  s3_resource.bucket(bucket)
end

#get_s3_bucket_object(bucket, s3_object_name) ⇒ Object



27
28
29
30
# File 'lib/ruby_aem_aws/client/s3.rb', line 27

def get_s3_bucket_object(bucket, s3_object_name)
  bucket = get_s3_bucket(bucket)
  bucket.object(s3_object_name)
end

#get_s3_object(bucket, s3_object_name, dest_path) ⇒ Object



36
37
38
39
40
# File 'lib/ruby_aem_aws/client/s3.rb', line 36

def get_s3_object(bucket, s3_object_name, dest_path)
  options = { bucket: bucket, key: s3_object_name }
  options = options.merge(response_target: dest_path) unless dest_path.nil?
  s3_client.get_object(options)
end