Class: S3Secure::PublicAccess::Show
- Defined in:
- lib/s3_secure/public_access/show.rb
Instance Method Summary collapse
Methods inherited from Base
Methods inherited from CLI::Base
Methods included from CLI::Say
Methods included from AwsServices
Methods included from AwsServices::S3
#check_bucket!, #new_s3_regional_client, #region, #region_map, #s3, #s3_client, #s3_regional_client
Constructor Details
This class inherits a constructor from S3Secure::CLI::Base
Instance Method Details
#blocked? ⇒ Boolean
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/s3_secure/public_access/show.rb', line 13 def blocked? resp = s3.get_public_access_block( bucket: @bucket, ) resp.to_h[:public_access_block_configuration] == { block_public_acls: true, block_public_policy: true, ignore_public_acls: true, restrict_public_buckets: true, } rescue Aws::S3::Errors::NoSuchPublicAccessBlockConfiguration false end |
#run ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/s3_secure/public_access/show.rb', line 3 def run resp = s3.get_public_access_block( bucket: @bucket, ) say(resp.to_h) resp rescue Aws::S3::Errors::NoSuchPublicAccessBlockConfiguration say "No public access block configuration found for bucket: #{@bucket}" end |