Class BucketPolicy.Builder
java.lang.Object
software.amazon.awscdk.services.s3.BucketPolicy.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<BucketPolicy>
- Enclosing class:
BucketPolicy
@Stability(Stable)
public static final class BucketPolicy.Builder
extends Object
implements software.amazon.jsii.Builder<BucketPolicy>
A fluent builder for
BucketPolicy.-
Method Summary
Modifier and TypeMethodDescriptionThe Amazon S3 bucket that the policy applies to.build()static BucketPolicy.Builderdocument(PolicyDocument document) Policy document to apply to the bucket.removalPolicy(RemovalPolicy removalPolicy) Policy to apply when the policy is removed from this stack.
-
Method Details
-
create
@Stability(Stable) public static BucketPolicy.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope- This parameter is required.id- This parameter is required.- Returns:
- a new instance of
BucketPolicy.Builder.
-
bucket
The Amazon S3 bucket that the policy applies to.- Parameters:
bucket- The Amazon S3 bucket that the policy applies to. This parameter is required.- Returns:
this
-
document
Policy document to apply to the bucket.Default: - A new empty PolicyDocument will be created.
- Parameters:
document- Policy document to apply to the bucket. This parameter is required.- Returns:
this
-
removalPolicy
Policy to apply when the policy is removed from this stack.Default: - RemovalPolicy.DESTROY.
- Parameters:
removalPolicy- Policy to apply when the policy is removed from this stack. This parameter is required.- Returns:
this
-
build
- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<BucketPolicy>- Returns:
- a newly built instance of
BucketPolicy.
-