Skip to content

Commit 0480e47

Browse files
authored
chore(s3): documented how the bucket encryption configuration is computed (#25079)
---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent c9733a6 commit 0480e47

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

packages/aws-cdk-lib/aws-s3/lib/bucket.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,22 @@ export class Bucket extends BucketBase {
19831983

19841984
/**
19851985
* Set up key properties and return the Bucket encryption property from the
1986-
* user's configuration.
1986+
* user's configuration, according to the following table:
1987+
*
1988+
* | props.encryption | props.encryptionKey | props.bucketKeyEnabled | bucketEncryption (return value) | encryptionKey (return value) |
1989+
* |------------------|---------------------|------------------------|---------------------------------|------------------------------|
1990+
* | undefined | undefined | e | undefined | undefined |
1991+
* | UNENCRYPTED | undefined | false | undefined | undefined |
1992+
* | undefined | k | e | SSE-KMS, bucketKeyEnabled = e | k |
1993+
* | KMS | k | e | SSE-KMS, bucketKeyEnabled = e | k |
1994+
* | KMS | undefined | e | SSE-KMS, bucketKeyEnabled = e | new key |
1995+
* | KMS_MANAGED | undefined | e | SSE-KMS, bucketKeyEnabled = e | undefined |
1996+
* | S3_MANAGED | undefined | false | SSE-S3 | undefined |
1997+
* | UNENCRYPTED | undefined | true | ERROR! | ERROR! |
1998+
* | UNENCRYPTED | k | e | ERROR! | ERROR! |
1999+
* | KMS_MANAGED | k | e | ERROR! | ERROR! |
2000+
* | S3_MANAGED | undefined | true | ERROR! | ERROR! |
2001+
* | S3_MANAGED | k | e | ERROR! | ERROR! |
19872002
*/
19882003
private parseEncryption(props: BucketProps): {
19892004
bucketEncryption?: CfnBucket.BucketEncryptionProperty,

0 commit comments

Comments
 (0)