BucketBlockPublicAccess

class aws_cdk.aws_s3.mixins.BucketBlockPublicAccess(public_access_config=None)

Bases: Mixin

S3-specific mixin for blocking public-access.

ExampleMetadata:

fixture=README-mixins infused

Example:

# Apply mixins fluently with .with()
s3.CfnBucket(scope, "MyL1Bucket").with(BucketBlockPublicAccess()).with(BucketAutoDeleteObjects())

# Apply multiple mixins to the same construct
s3.CfnBucket(scope, "MyL1Bucket").with(BucketBlockPublicAccess(), BucketAutoDeleteObjects())

# Mixins work with all types of constructs:
# L1, L2 and even custom constructs
s3.Bucket(stack, "MyL2Bucket").with(BucketBlockPublicAccess())
CustomBucket(stack, "MyCustomBucket").with(BucketBlockPublicAccess())
Parameters:

public_access_config (Optional[BlockPublicAccess])

Methods

apply_to(construct)

Applies the mixin functionality to the target construct.

Parameters:

construct (IConstruct)

Return type:

None

supports(construct)

Determines whether this mixin can be applied to the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Static Methods

classmethod is_mixin(x)

Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.