Sha256: f8b7b99688c2ea378da9ea9427662ce894e0dedffae808fd40f5a76112af68c1

Contents?: true

Size: 618 Bytes

Versions: 4

Compression:

Stored size: 618 Bytes

Contents

require "s3-secure"

class TerraspacePluginAws::Interfaces::Backend::Bucket
  module Secure
    def secure(bucket)
      c = TerraspacePluginAws::Interfaces::Config.instance.config.s3
      options = {bucket: bucket, quiet: true}
      S3Secure::Encryption::Enable.new(options).run if c.encryption
      S3Secure::Policy::Enforce.new(options.merge(sid: "ForceSSLOnlyAccess")).run if c.enforce_ssl
      S3Secure::Versioning::Enable.new(options).run if c.versioning
      S3Secure::Lifecycle::Add.new(options).run if c.lifecycle
      S3Secure::AccessLogs::Enable.new(options).run if c.access_logging
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
terraspace_plugin_aws-0.3.1 lib/terraspace_plugin_aws/interfaces/backend/bucket/secure.rb
terraspace_plugin_aws-0.3.0 lib/terraspace_plugin_aws/interfaces/backend/bucket/secure.rb
terraspace_plugin_aws-0.2.2 lib/terraspace_plugin_aws/interfaces/backend/bucket/secure.rb
terraspace_plugin_aws-0.2.1 lib/terraspace_plugin_aws/interfaces/backend/bucket/secure.rb