Class: AWSCDK::S3::CfnBucket::PublicAccessBlockConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
s3/cfn_bucket.rb

Overview

The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.

You can enable the configuration options in any combination. Bucket-level settings work alongside account-level settings (which may inherit from organization-level policies). For more information about when Amazon S3 considers a bucket or object public, see The Meaning of "Public" in the Amazon S3 User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block_public_acls: nil, block_public_policy: nil, ignore_public_acls: nil, restrict_public_buckets: nil) ⇒ PublicAccessBlockConfigurationProperty

Returns a new instance of PublicAccessBlockConfigurationProperty.

Parameters:

  • block_public_acls (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket.

  • block_public_policy (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether Amazon S3 should block public bucket policies for this bucket.

  • ignore_public_acls (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.

  • restrict_public_buckets (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether Amazon S3 should restrict public bucket policies for this bucket.



2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
# File 's3/cfn_bucket.rb', line 2985

def initialize(block_public_acls: nil, block_public_policy: nil, ignore_public_acls: nil, restrict_public_buckets: nil)
  @block_public_acls = block_public_acls
  Jsii::Type.check_type(@block_public_acls, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "blockPublicAcls") unless @block_public_acls.nil?
  @block_public_policy = block_public_policy
  Jsii::Type.check_type(@block_public_policy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "blockPublicPolicy") unless @block_public_policy.nil?
  @ignore_public_acls = ignore_public_acls
  Jsii::Type.check_type(@ignore_public_acls, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "ignorePublicAcls") unless @ignore_public_acls.nil?
  @restrict_public_buckets = restrict_public_buckets
  Jsii::Type.check_type(@restrict_public_buckets, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "restrictPublicBuckets") unless @restrict_public_buckets.nil?
end

Instance Attribute Details

#block_public_aclsBoolean, ... (readonly)

Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket.

Setting this element to TRUE causes the following behavior:

  • PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public.
  • PUT Object calls fail if the request includes a public ACL.
  • PUT Bucket calls fail if the request includes a public ACL.

Enabling this setting doesn't affect existing policies or ACLs.



3008
3009
3010
# File 's3/cfn_bucket.rb', line 3008

def block_public_acls
  @block_public_acls
end

#block_public_policyBoolean, ... (readonly)

Specifies whether Amazon S3 should block public bucket policies for this bucket.

Setting this element to TRUE causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access.

Enabling this setting doesn't affect existing bucket policies.



3017
3018
3019
# File 's3/cfn_bucket.rb', line 3017

def block_public_policy
  @block_public_policy
end

#ignore_public_aclsBoolean, ... (readonly)

Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.

Setting this element to TRUE causes Amazon S3 to ignore all public ACLs on this bucket and objects in this bucket.

Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set.



3026
3027
3028
# File 's3/cfn_bucket.rb', line 3026

def ignore_public_acls
  @ignore_public_acls
end

#restrict_public_bucketsBoolean, ... (readonly)

Specifies whether Amazon S3 should restrict public bucket policies for this bucket.

Setting this element to TRUE restricts access to this bucket to only AWS service principals and authorized users within this account if the bucket has a public policy.

Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked.



3035
3036
3037
# File 's3/cfn_bucket.rb', line 3035

def restrict_public_buckets
  @restrict_public_buckets
end

Class Method Details

.jsii_propertiesObject



3037
3038
3039
3040
3041
3042
3043
3044
# File 's3/cfn_bucket.rb', line 3037

def self.jsii_properties
  {
    :block_public_acls => "blockPublicAcls",
    :block_public_policy => "blockPublicPolicy",
    :ignore_public_acls => "ignorePublicAcls",
    :restrict_public_buckets => "restrictPublicBuckets",
  }
end

Instance Method Details

#to_jsiiObject



3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
# File 's3/cfn_bucket.rb', line 3046

def to_jsii
  result = {}
  result.merge!({
    "blockPublicAcls" => @block_public_acls,
    "blockPublicPolicy" => @block_public_policy,
    "ignorePublicAcls" => @ignore_public_acls,
    "restrictPublicBuckets" => @restrict_public_buckets,
  })
  result.compact
end