Skip to content

Commit 145796c

Browse files
authored
revert: "feat(s3tables): server-side encryption by customer managed KMS key" (#34460)
Reverts #34229
1 parent a0bfac9 commit 145796c

13 files changed

+1
-509
lines changed

packages/@aws-cdk/aws-s3tables-alpha/README.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,6 @@ const sampleTableBucket = new TableBucket(scope, 'ExampleTableBucket', {
4141

4242
Learn more about table buckets maintenance operations and default behavior from the [S3 Tables User Guide](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-table-buckets-maintenance.html)
4343

44-
### Server-side Encryption
45-
46-
By default, S3 Tables buckets are encrypted using Amazon S3-managed keys (SSE-S3). You can also use AWS Key Management Service (AWS KMS) keys to encrypt your data.
47-
To do this, you can specify the `kmsKey` property when creating the bucket:
48-
49-
```ts
50-
declare const kmsKey: kms.IKey;
51-
52-
new TableBucket(this, 'TableBucket', {
53-
tableBucketName: 'kms-key-s3tables-bucket',
54-
kmsKey,
55-
});
56-
```
57-
58-
**Note**: AWS CDK automatically add a resource policy to the KMS key to allow the S3 Tables service to use it for automatic table maintenance. Detail information can be found in the [security for S3 tables](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-kms-permissions.html) documentation.
59-
6044
### Controlling Table Bucket Permissions
6145

6246
```ts

packages/@aws-cdk/aws-s3tables-alpha/lib/table-bucket.ts

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { TableBucketPolicy } from './table-bucket-policy';
55
import * as perms from './permissions';
66
import { validateTableBucketAttributes } from './util';
77
import * as iam from 'aws-cdk-lib/aws-iam';
8-
import * as kms from 'aws-cdk-lib/aws-kms';
9-
import { Resource, IResource, UnscopedValidationError, RemovalPolicy, Token, Stack } from 'aws-cdk-lib/core';
8+
import { Resource, IResource, UnscopedValidationError, RemovalPolicy, Token } from 'aws-cdk-lib/core';
109
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';
1110

1211
/**
@@ -259,13 +258,6 @@ export interface TableBucketProps {
259258
* @default RETAIN
260259
*/
261260
readonly removalPolicy?: RemovalPolicy;
262-
263-
/**
264-
* The KMS key to use for server-side encryption.
265-
*
266-
* @default - Server-side encryption with Amazon S3-managed keys (SSE-S3)
267-
*/
268-
readonly kmsKey?: kms.IKey;
269261
}
270262

271263
/**
@@ -506,34 +498,8 @@ export class TableBucket extends TableBucketBase {
506498
noncurrentDays: props.unreferencedFileRemoval?.noncurrentDays,
507499
unreferencedDays: props.unreferencedFileRemoval?.unreferencedDays,
508500
},
509-
encryptionConfiguration: props?.kmsKey
510-
? {
511-
sseAlgorithm: 'aws:kms',
512-
kmsKeyArn: props.kmsKey.keyArn,
513-
}
514-
: undefined,
515501
});
516502

517-
// add resource policy to the encryption key
518-
// see https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-kms-permissions.html#tables-kms-maintenance-permissions
519-
props?.kmsKey?.addToResourcePolicy(
520-
new iam.PolicyStatement({
521-
actions: ['kms:Decrypt', 'kms:GenerateDataKey'],
522-
resources: ['*'],
523-
effect: iam.Effect.ALLOW,
524-
principals: [new iam.ServicePrincipal('maintenance.s3tables.amazonaws.com')],
525-
conditions: {
526-
StringLike: {
527-
'kms:EncryptionContext:aws:s3:arn': `${Stack.of(this).formatArn({
528-
service: 's3tables',
529-
resource: 'bucket',
530-
resourceName: props.tableBucketName,
531-
})}/*`,
532-
},
533-
},
534-
}),
535-
);
536-
537503
this.tableBucketName = this.getResourceNameAttribute(this._resource.ref);
538504
this.tableBucketArn = this._resource.attrTableBucketArn;
539505
this._resource.applyRemovalPolicy(props.removalPolicy);

packages/@aws-cdk/aws-s3tables-alpha/rosetta/default.ts-fixture

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Construct } from 'constructs';
22
import { Stack } from 'aws-cdk-lib';
33
import { TableBucket, UnreferencedFileRemovalStatus } from '@aws-cdk/aws-s3tables-alpha';
44
import * as iam from 'aws-cdk-lib/aws-iam';
5-
import * as kms from 'aws-cdk-lib/aws-kms';
65

76
class Fixture extends Stack {
87
constructor(scope: Construct, id: string) {

packages/@aws-cdk/aws-s3tables-alpha/test/integration/integ.table-bucket-kms-key.js.snapshot/cdk.out

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/@aws-cdk/aws-s3tables-alpha/test/integration/integ.table-bucket-kms-key.js.snapshot/integ.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/@aws-cdk/aws-s3tables-alpha/test/integration/integ.table-bucket-kms-key.js.snapshot/kms-key-s3tables-stack.assets.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

packages/@aws-cdk/aws-s3tables-alpha/test/integration/integ.table-bucket-kms-key.js.snapshot/kms-key-s3tables-stack.template.json

Lines changed: 0 additions & 126 deletions
This file was deleted.

packages/@aws-cdk/aws-s3tables-alpha/test/integration/integ.table-bucket-kms-key.js.snapshot/kmskeys3tablesintegDefaultTestDeployAssertC8AB8C4E.assets.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

packages/@aws-cdk/aws-s3tables-alpha/test/integration/integ.table-bucket-kms-key.js.snapshot/kmskeys3tablesintegDefaultTestDeployAssertC8AB8C4E.template.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)