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 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

      @Stability(Stable) public BucketPolicy.Builder bucket(IBucket 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
    • removalPolicy

      @Stability(Stable) public BucketPolicy.Builder removalPolicy(RemovalPolicy 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

      @Stability(Stable) public BucketPolicy build()
      Specified by:
      build in interface software.amazon.jsii.Builder<BucketPolicy>
      Returns:
      a newly built instance of BucketPolicy.