Skip to content
v2.273.0

BucketBlockPublicAccess Mixin ​

S3-specific mixin for blocking public-access.

Example ​

ts
// Applies an Aspect immediately as a Mixin
const versioningMixin = Shims.asMixin(new EnableBucketVersioning());
Mixins.of(scope).apply(versioningMixin);

// Delays application of a Mixin to the synthesis phase
const publicAccessAspect = Shims.asAspect(new BucketBlockPublicAccess());
Aspects.of(scope).add(publicAccessAspect);
python
# Applies an Aspect immediately as a Mixin
versioning_mixin = Shims.as_mixin(EnableBucketVersioning())
Mixins.of(scope).apply(versioning_mixin)

# Delays application of a Mixin to the synthesis phase
public_access_aspect = Shims.as_aspect(BucketBlockPublicAccess())
Aspects.of(scope).add(public_access_aspect)
java
// Applies an Aspect immediately as a Mixin
IMixin versioningMixin = Shims.asMixin(new EnableBucketVersioning());
Mixins.of(scope).apply(versioningMixin);

// Delays application of a Mixin to the synthesis phase
IAspect publicAccessAspect = Shims.asAspect(new BucketBlockPublicAccess());
Aspects.of(scope).add(publicAccessAspect);
csharp
// Install: dotnet add package Amazon.CDK.Lib
// Applies an Aspect immediately as a Mixin
var versioningMixin = Shims.AsMixin(new EnableBucketVersioning());
Mixins.Of(scope).Apply(versioningMixin);

// Delays application of a Mixin to the synthesis phase
var publicAccessAspect = Shims.AsAspect(new BucketBlockPublicAccess());
Aspects.Of(scope).Add(publicAccessAspect);
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// Applies an Aspect immediately as a Mixin
versioningMixin := awscdk.Shims_AsMixin(NewEnableBucketVersioning())
awscdk.Mixins_Of(scope).Apply(versioningMixin)

// Delays application of a Mixin to the synthesis phase
publicAccessAspect := awscdk.Shims_AsAspect(awscdk.NewBucketBlockPublicAccess())
awscdk.Aspects_Of(scope).Add(publicAccessAspect)

Initializer ​

ts
new BucketBlockPublicAccess(publicAccessConfig?: BlockPublicAccess)
python
BucketBlockPublicAccess(public_access_config: typing.Optional[BlockPublicAccess] = None)
java
new BucketBlockPublicAccess(BlockPublicAccess publicAccessConfig)
csharp
new BucketBlockPublicAccess(BlockPublicAccess? publicAccessConfig = null)
go
NewBucketBlockPublicAccess(PublicAccessConfig BlockPublicAccess)

Methods ​

applyTo(construct: IConstruct): voiddef apply_to(self, construct: IConstruct) -> Nonepublic void applyTo(IConstruct construct)public void ApplyTo(IConstruct construct)func ApplyTo(Construct IConstruct)#
Applies the mixin functionality to the target construct.
isMixin(x: any): boolean@staticmethod def is_mixin(x: Any) -> boolpublic static Boolean isMixin(Object x)public static bool IsMixin(object x)func IsMixin(X interface{}) *boolstatic#
Checks if `x` is a Mixin.
1 parameter · returns

Parameters

  • xxxxX — Any object.

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

supports(construct: IConstruct): booleandef supports(self, construct: IConstruct) -> boolpublic Boolean supports(IConstruct construct)public bool Supports(IConstruct construct)func Supports(Construct IConstruct) *bool#
Determines whether this mixin can be applied to the given construct.