@@ -796,6 +796,13 @@ export interface BucketProps {
796
796
*/
797
797
readonly websiteRedirect ?: RedirectTarget ;
798
798
799
+ /**
800
+ * Specifies a canned ACL that grants predefined permissions to the bucket.
801
+ *
802
+ * @default BucketAccessControl.PRIVATE
803
+ */
804
+ readonly accessControl ?: BucketAccessControl ;
805
+
799
806
/**
800
807
* Grants public read access to all objects in the bucket.
801
808
* Similar to calling `bucket.grantPublicAccess()`
@@ -933,7 +940,8 @@ export class Bucket extends BucketBase {
933
940
websiteConfiguration : this . renderWebsiteConfiguration ( props ) ,
934
941
publicAccessBlockConfiguration : props . blockPublicAccess ,
935
942
metricsConfigurations : Lazy . anyValue ( { produce : ( ) => this . parseMetricConfiguration ( ) } ) ,
936
- corsConfiguration : Lazy . anyValue ( { produce : ( ) => this . parseCorsConfiguration ( ) } )
943
+ corsConfiguration : Lazy . anyValue ( { produce : ( ) => this . parseCorsConfiguration ( ) } ) ,
944
+ accessControl : props . accessControl ,
937
945
} ) ;
938
946
939
947
resource . applyRemovalPolicy ( props . removalPolicy ) ;
@@ -1426,6 +1434,57 @@ export interface OnCloudTrailBucketEventOptions extends events.OnEventOptions {
1426
1434
readonly paths ?: string [ ] ;
1427
1435
}
1428
1436
1437
+ /**
1438
+ * Default bucket access control types.
1439
+ *
1440
+ * @see https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html
1441
+ */
1442
+ export enum BucketAccessControl {
1443
+ /**
1444
+ * Owner gets FULL_CONTROL. No one else has access rights.
1445
+ */
1446
+ PRIVATE = 'Private' ,
1447
+
1448
+ /**
1449
+ * Owner gets FULL_CONTROL. The AllUsers group gets READ access.
1450
+ */
1451
+ PUBLIC_READ = 'PublicRead' ,
1452
+
1453
+ /**
1454
+ * Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access.
1455
+ * Granting this on a bucket is generally not recommended.
1456
+ */
1457
+ PUBLIC_READ_WRITE = 'PublicReadWrite' ,
1458
+
1459
+ /**
1460
+ * Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access.
1461
+ */
1462
+ AUTHENTICATED_READ = 'AuthenticatedRead' ,
1463
+
1464
+ /**
1465
+ * The LogDelivery group gets WRITE and READ_ACP permissions on the bucket.
1466
+ * @see https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html
1467
+ */
1468
+ LOG_DELIVERY_WRITE = 'LogDeliveryWrite' ,
1469
+
1470
+ /**
1471
+ * Object owner gets FULL_CONTROL. Bucket owner gets READ access.
1472
+ * If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
1473
+ */
1474
+ BUCKET_OWNER_READ = 'BucketOwnerRead' ,
1475
+
1476
+ /**
1477
+ * Both the object owner and the bucket owner get FULL_CONTROL over the object.
1478
+ * If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
1479
+ */
1480
+ BUCKET_OWNER_FULL_CONTROL = 'BucketOwnerFullControl' ,
1481
+
1482
+ /**
1483
+ * Owner gets FULL_CONTROL. Amazon EC2 gets READ access to GET an Amazon Machine Image (AMI) bundle from Amazon S3.
1484
+ */
1485
+ AWS_EXEC_READ = 'AwsExecRead' ,
1486
+ }
1487
+
1429
1488
function mapOrUndefined < T , U > ( list : T [ ] | undefined , callback : ( element : T ) => U ) : U [ ] | undefined {
1430
1489
if ( ! list || list . length === 0 ) {
1431
1490
return undefined ;
0 commit comments