module AwsExtensions::S3::Bucket

Public Instance Methods

default_encryption() click to toggle source
# 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
replication() click to toggle source

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

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

# 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