Module: Crashbreak::AWS
- Included in:
- DatabaseDumper, DatabaseRestorer
- Defined in:
- lib/crashbreak/AWS.rb
Instance Method Summary collapse
- #aws_key_id ⇒ Object
- #aws_region ⇒ Object
- #aws_resource_bucket ⇒ Object
- #aws_secret_key ⇒ Object
- #bucket_name ⇒ Object
- #client ⇒ Object
- #prepare_aws ⇒ Object
Instance Method Details
#aws_key_id ⇒ Object
19 20 21 |
# File 'lib/crashbreak/AWS.rb', line 19 def aws_key_id Crashbreak.configure.[:aws_access_key_id] || ENV['AWS_ACCESS_KEY_ID'] end |
#aws_region ⇒ Object
15 16 17 |
# File 'lib/crashbreak/AWS.rb', line 15 def aws_region Crashbreak.configure.[:aws_region] || ENV['AWS_REGION'] end |
#aws_resource_bucket ⇒ Object
7 8 9 |
# File 'lib/crashbreak/AWS.rb', line 7 def aws_resource_bucket @aws_resource_bucket ||= Aws::S3::Resource.new.bucket(bucket_name) end |
#aws_secret_key ⇒ Object
23 24 25 |
# File 'lib/crashbreak/AWS.rb', line 23 def aws_secret_key Crashbreak.configure.[:aws_secret_access_key] || ENV['AWS_SECRET_ACCESS_KEY'] end |
#bucket_name ⇒ Object
11 12 13 |
# File 'lib/crashbreak/AWS.rb', line 11 def bucket_name Crashbreak.configure.[:aws_bucket_name] end |
#client ⇒ Object
3 4 5 |
# File 'lib/crashbreak/AWS.rb', line 3 def client @client ||= Aws::S3::Client.new end |
#prepare_aws ⇒ Object
27 28 29 30 31 32 |
# File 'lib/crashbreak/AWS.rb', line 27 def prepare_aws Aws.config.update( credentials: Aws::Credentials.new(aws_key_id, aws_secret_key), s3: { region: aws_region } ) end |