class BucketPolicyStatements
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.S3.Mixins.BucketPolicyStatements |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awss3/mixins#BucketPolicyStatements |
Java | software.amazon.awscdk.services.s3.mixins.BucketPolicyStatements |
Python | aws_cdk.aws_s3.mixins.BucketPolicyStatements |
TypeScript (source) | aws-cdk-lib » aws_s3 » mixins » BucketPolicyStatements |
Implements
IMixin
Extends
Mixin
Adds statements to a bucket policy.
Example
new s3.CfnBucketPolicy(this, 'Policy', {
bucket: new s3.CfnBucket(this, 'Bucket').ref,
policyDocument: new iam.PolicyDocument(),
}).with(new s3.mixins.BucketPolicyStatements([
new iam.PolicyStatement({
actions: ['s3:GetObject'],
resources: ['*'],
principals: [new iam.AnyPrincipal()],
}),
]));
Initializer
new BucketPolicyStatements(statements: PolicyStatement[])
Parameters
- statements
PolicyStatement []
Methods
| Name | Description |
|---|---|
| apply | Applies the mixin functionality to the target construct. |
| supports(construct) | Determines whether this mixin can be applied to the given construct. |
applyTo(policy)
public applyTo(policy: IConstruct): void
Parameters
- policy
IConstruct
Applies the mixin functionality to the target construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Determines whether this mixin can be applied to the given construct.

.NET
Go
Java
Python
TypeScript (