Enum BucketAccessControl

java.lang.Object
java.lang.Enum<BucketAccessControl>
software.amazon.awscdk.services.s3.BucketAccessControl
All Implemented Interfaces:
Serializable, Comparable<BucketAccessControl>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.95.0 (build f1ff514)", date="2024-03-26T18:09:29.427Z") @Stability(Stable) public enum BucketAccessControl extends Enum<BucketAccessControl>
Default bucket access control types.

Example:

 Bucket websiteBucket = Bucket.Builder.create(this, "WebsiteBucket")
         .websiteIndexDocument("index.html")
         .publicReadAccess(true)
         .build();
 BucketDeployment.Builder.create(this, "DeployWebsite")
         .sources(List.of(Source.asset("./website-dist")))
         .destinationBucket(websiteBucket)
         .destinationKeyPrefix("web/static") // optional prefix in destination bucket
         .metadata(Map.of("A", "1", "b", "2")) // user-defined metadata
         // system-defined metadata
         .contentType("text/html")
         .contentLanguage("en")
         .storageClass(StorageClass.INTELLIGENT_TIERING)
         .serverSideEncryption(ServerSideEncryption.AES_256)
         .cacheControl(List.of(CacheControl.setPublic(), CacheControl.maxAge(Duration.hours(1))))
         .accessControl(BucketAccessControl.BUCKET_OWNER_FULL_CONTROL)
         .build();
 

See Also:
  • Enum Constant Details

    • PRIVATE

      @Stability(Stable) public static final BucketAccessControl PRIVATE
      Owner gets FULL_CONTROL.

      No one else has access rights.

    • PUBLIC_READ

      @Stability(Stable) public static final BucketAccessControl PUBLIC_READ
      Owner gets FULL_CONTROL.

      The AllUsers group gets READ access.

    • PUBLIC_READ_WRITE

      @Stability(Stable) public static final BucketAccessControl PUBLIC_READ_WRITE
      Owner gets FULL_CONTROL.

      The AllUsers group gets READ and WRITE access. Granting this on a bucket is generally not recommended.

    • AUTHENTICATED_READ

      @Stability(Stable) public static final BucketAccessControl AUTHENTICATED_READ
      Owner gets FULL_CONTROL.

      The AuthenticatedUsers group gets READ access.

    • LOG_DELIVERY_WRITE

      @Stability(Stable) public static final BucketAccessControl LOG_DELIVERY_WRITE
      The LogDelivery group gets WRITE and READ_ACP permissions on the bucket.

      See Also:
    • BUCKET_OWNER_READ

      @Stability(Stable) public static final BucketAccessControl BUCKET_OWNER_READ
      Object owner gets FULL_CONTROL.

      Bucket owner gets READ access. If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.

    • BUCKET_OWNER_FULL_CONTROL

      @Stability(Stable) public static final BucketAccessControl BUCKET_OWNER_FULL_CONTROL
      Both the object owner and the bucket owner get FULL_CONTROL over the object.

      If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.

    • AWS_EXEC_READ

      @Stability(Stable) public static final BucketAccessControl AWS_EXEC_READ
      Owner gets FULL_CONTROL.

      Amazon EC2 gets READ access to GET an Amazon Machine Image (AMI) bundle from Amazon S3.

  • Method Details

    • values

      public static BucketAccessControl[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static BucketAccessControl valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null