Sha256: c005d9e6dd5bb3eb20f59da1cc40a0827a53b56bc3a28a48a61c8f8ef312dfad

Contents?: true

Size: 757 Bytes

Versions: 27

Compression:

Stored size: 757 Bytes

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::NoSuchBucket
        nil
      end

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

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

      def select_all_buckets
        s3_client.list_buckets.buckets
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
awspec-0.30.0 lib/awspec/helper/finder/s3.rb
awspec-0.29.0 lib/awspec/helper/finder/s3.rb
awspec-0.28.1 lib/awspec/helper/finder/s3.rb
awspec-0.28.0 lib/awspec/helper/finder/s3.rb
awspec-0.27.2 lib/awspec/helper/finder/s3.rb
awspec-0.27.1 lib/awspec/helper/finder/s3.rb
awspec-0.27.0 lib/awspec/helper/finder/s3.rb