BucketPolicyStatementsMixin

class aws_cdk.mixins_preview.aws_s3.mixins.BucketPolicyStatementsMixin(statements)

Bases: Mixin

(experimental) Adds statements to a bucket policy.

Stability:

experimental

Mixin:

true

ExampleMetadata:

infused

Example:

# bucket: s3.IBucketRef


bucket_policy = s3.CfnBucketPolicy(scope, "BucketPolicy",
    bucket=bucket,
    policy_document=iam.PolicyDocument()
)
Mixins.of(bucket_policy).apply(BucketPolicyStatementsMixin([
    iam.PolicyStatement(
        actions=["s3:GetObject"],
        resources=["*"],
        principals=[iam.AnyPrincipal()]
    )
]))
Parameters:

statements (Sequence[PolicyStatement])

Stability:

experimental

Methods

apply_to(policy)

(experimental) Applies the mixin functionality to the target construct.

Parameters:

policy (IConstruct)

Stability:

experimental

Return type:

None

supports(construct)

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

Parameters:

construct (IConstruct)

Stability:

experimental

Return type:

bool

Static Methods

classmethod is_mixin(x)

(experimental) 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.

Stability:

experimental