Sha256: e1035c38e0103cf858d58a9325c54123a0f26072ecb16f5d61e85ddc9c1e6a01

Contents?: true

Size: 1.21 KB

Versions: 36

Compression:

Stored size: 1.21 KB

Contents

module Awspec::Helper
  module Finder
    module S3
      def find_bucket(id)
        res = s3_client.list_buckets
        ret = s3_client.list_buckets[:buckets].find do |bucket|
          bucket.name == id
        end
      end

      def find_bucket_acl(id)
        s3_client.get_bucket_acl(bucket: id)
      rescue Aws::S3::Errors::ServiceError
        nil
      end

      def find_bucket_cors(id)
        s3_client.get_bucket_cors(bucket: id)
      rescue Aws::S3::Errors::ServiceError
        nil
      end

      def find_bucket_policy(id)
        s3_client.get_bucket_policy(bucket: id)
      rescue Aws::S3::Errors::ServiceError
        nil
      end

      def find_bucket_logging(id)
        s3_client.get_bucket_logging(bucket: id)
      rescue Aws::S3::Errors::ServiceError
        nil
      end

      def find_bucket_versioning(id)
        s3_client.get_bucket_versioning(bucket: id)
      rescue Aws::S3::Errors::ServiceError
        nil
      end

      def find_bucket_lifecycle_configuration(id)
        s3_client.get_bucket_lifecycle_configuration(bucket: id)
      rescue Aws::S3::Errors::ServiceError
        nil
      end

      def select_all_buckets
        s3_client.list_buckets.buckets
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
awspec-0.82.1 lib/awspec/helper/finder/s3.rb
awspec-0.82.0 lib/awspec/helper/finder/s3.rb
awspec-0.81.1 lib/awspec/helper/finder/s3.rb
awspec-0.81.0 lib/awspec/helper/finder/s3.rb
awspec-0.80.1 lib/awspec/helper/finder/s3.rb
awspec-0.80.0 lib/awspec/helper/finder/s3.rb
awspec-0.79.2 lib/awspec/helper/finder/s3.rb
awspec-0.79.1 lib/awspec/helper/finder/s3.rb
awspec-0.79.0 lib/awspec/helper/finder/s3.rb
awspec-0.78.1 lib/awspec/helper/finder/s3.rb
awspec-0.77.1 lib/awspec/helper/finder/s3.rb
awspec-0.77.0 lib/awspec/helper/finder/s3.rb
awspec-0.76.1 lib/awspec/helper/finder/s3.rb
awspec-0.76.0 lib/awspec/helper/finder/s3.rb
awspec-0.75.2 lib/awspec/helper/finder/s3.rb
awspec-0.75.1 lib/awspec/helper/finder/s3.rb
awspec-0.75.0 lib/awspec/helper/finder/s3.rb
awspec-0.74.1 lib/awspec/helper/finder/s3.rb
awspec-0.74.0 lib/awspec/helper/finder/s3.rb
awspec-0.73.2 lib/awspec/helper/finder/s3.rb