Class BlockPublicAccess

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.s3.BlockPublicAccess
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)", date="2025-06-20T13:49:24.613Z") @Stability(Stable) public class BlockPublicAccess extends software.amazon.jsii.JsiiObject
Example:

 import software.amazon.awscdk.RemovalPolicy;
 Bucket.Builder.create(scope, "Bucket")
         .blockPublicAccess(BlockPublicAccess.BLOCK_ALL)
         .encryption(BucketEncryption.S3_MANAGED)
         .enforceSSL(true)
         .versioned(true)
         .removalPolicy(RemovalPolicy.RETAIN)
         .build();
 
  • Field Details

    • BLOCK_ACLS

      @Stability(Deprecated) @Deprecated public static final BlockPublicAccess BLOCK_ACLS
      Deprecated.
      Use BLOCK_ACLS_ONLY instead.
    • BLOCK_ACLS_ONLY

      @Stability(Stable) public static final BlockPublicAccess BLOCK_ACLS_ONLY
      Use this option if you want to only block the ACLs, using this will set blockPublicPolicy and restrictPublicBuckets to false.
    • BLOCK_ALL

      @Stability(Stable) public static final BlockPublicAccess BLOCK_ALL
      Use this option if you want to ensure every public access method is blocked.

      However keep in mind that this is the default state of an S3 bucket, and leaving blockPublicAccess undefined would also work.

  • Constructor Details

    • BlockPublicAccess

      protected BlockPublicAccess(software.amazon.jsii.JsiiObjectRef objRef)
    • BlockPublicAccess

      protected BlockPublicAccess(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • BlockPublicAccess

      @Stability(Stable) public BlockPublicAccess(@NotNull BlockPublicAccessOptions options)
      Parameters:
      options - This parameter is required.
  • Method Details

    • getBlockPublicAcls

      @Stability(Stable) @Nullable public Boolean getBlockPublicAcls()
    • setBlockPublicAcls

      @Stability(Stable) public void setBlockPublicAcls(@Nullable Boolean value)
    • getBlockPublicPolicy

      @Stability(Stable) @Nullable public Boolean getBlockPublicPolicy()
    • setBlockPublicPolicy

      @Stability(Stable) public void setBlockPublicPolicy(@Nullable Boolean value)
    • getIgnorePublicAcls

      @Stability(Stable) @Nullable public Boolean getIgnorePublicAcls()
    • setIgnorePublicAcls

      @Stability(Stable) public void setIgnorePublicAcls(@Nullable Boolean value)
    • getRestrictPublicBuckets

      @Stability(Stable) @Nullable public Boolean getRestrictPublicBuckets()
    • setRestrictPublicBuckets

      @Stability(Stable) public void setRestrictPublicBuckets(@Nullable Boolean value)