Module: AwsExtensions::S3::Bucket

Defined in:
lib/aws_extensions/s3/Bucket.rb

Instance Method Summary collapse

Instance Method Details

#default_encryptionObject



34
35
36
37
38
39
40
41
42
# File 'lib/aws_extensions/s3/Bucket.rb', line 34

def default_encryption
  conf = Cumulus::S3::client(location).get_bucket_encryption({bucket: name}).server_side_encryption_configuration
  conf.rules.find do |r|
    sse = r.apply_server_side_encryption_by_default
    sse and break sse
  end
rescue Aws::S3::Errors::ServerSideEncryptionConfigurationNotFoundError
  nil
end

#replicationObject

Public: Method used to extend the Bucket class so that it will return replication rules.

Returns the associated Aws::S3::Types::ReplicationConfiguration



28
29
30
31
32
# File 'lib/aws_extensions/s3/Bucket.rb', line 28

def replication
  Cumulus::S3::client(location).get_bucket_replication({bucket: name}).replication_configuration
rescue Aws::S3::Errors::ReplicationConfigurationNotFoundError
  nil
end