diff --git a/packages/@aws-cdk/aws-s3tables-alpha/.npmignore b/packages/@aws-cdk/aws-s3tables-alpha/.npmignore index b94897de6fcce..adb9625623e0d 100644 --- a/packages/@aws-cdk/aws-s3tables-alpha/.npmignore +++ b/packages/@aws-cdk/aws-s3tables-alpha/.npmignore @@ -26,3 +26,4 @@ jest.config.js junit.xml !*.lit.ts **/*.snapshot +test/ diff --git a/packages/@aws-cdk/aws-s3tables-alpha/README.md b/packages/@aws-cdk/aws-s3tables-alpha/README.md index 8bb3afa0d6ad1..2fb4986e9b3cf 100644 --- a/packages/@aws-cdk/aws-s3tables-alpha/README.md +++ b/packages/@aws-cdk/aws-s3tables-alpha/README.md @@ -1,12 +1,15 @@ # Amazon S3 Tables Construct Library - --- ![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) -> The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package. +> The APIs of higher level constructs in this module are experimental and under active development. +> They are subject to non-backward compatible changes or removal in any future version. These are +> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be +> announced in the release notes. This means that while you may use them, you may need to update +> your source code when upgrading to a newer version of this package. --- @@ -25,7 +28,7 @@ Amazon S3 Tables deliver the first cloud object store with built-in Apache Icebe ```ts // Build a Table bucket -const tableBucket = new TableBucket(scope, 'ExampleTableBucket', { +const sampleTableBucket = new TableBucket(scope, 'ExampleTableBucket', { tableBucketName: 'example-bucket-1', // optional fields: unreferencedFileRemoval: { @@ -45,7 +48,8 @@ Learn more about table buckets maintenance operations and default behavior from const accountId = '123456789012' tableBucket.grantRead(new iam.AccountPrincipal(accountId), '*'); // Grant the role write permissions to the bucket and all tables within -tableBucket.grantWrite(new iam.Role(stack, 'MyRole'), '*'); +const role = new iam.Role(stack, 'MyRole', { assumedBy: new iam.ServicePrincipal('sample') }); +tableBucket.grantWrite(role, '*'); // Grant the user read and write permissions to the bucket and all tables within tableBucket.grantReadWrite(new iam.User(stack, 'MyUser'), '*'); @@ -55,7 +59,7 @@ tableBucket.grantReadWrite(new iam.AccountPrincipal(accountId), tableId); // Add custom resource policy statements const permissions = new iam.PolicyStatement({ - effect: Effect.ALLOW, + effect: iam.Effect.ALLOW, actions: ['s3tables:*'], principals: [ new iam.ServicePrincipal('example.aws.internal') ], resources: ['*'] diff --git a/packages/@aws-cdk/aws-s3tables-alpha/awslint.json b/packages/@aws-cdk/aws-s3tables-alpha/awslint.json new file mode 100644 index 0000000000000..8d7f0f65fb4d8 --- /dev/null +++ b/packages/@aws-cdk/aws-s3tables-alpha/awslint.json @@ -0,0 +1,10 @@ +{ + "exclude": [ + "props-physical-name:@aws-cdk/aws-s3tables-alpha.TableBucketPolicyProps", + "duration-prop-type:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.noncurrentDays", + "duration-prop-name:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.noncurrentDays", + "duration-prop-type:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.unreferencedDays", + "duration-prop-name:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.unreferencedDays", + "attribute-tag:@aws-cdk/aws-s3tables-alpha.TableBucket.tableBucketPolicy" + ] +} diff --git a/packages/@aws-cdk/aws-s3tables-alpha/lib/table-bucket.ts b/packages/@aws-cdk/aws-s3tables-alpha/lib/table-bucket.ts index f9cc959f90624..5d35e263a9fa3 100644 --- a/packages/@aws-cdk/aws-s3tables-alpha/lib/table-bucket.ts +++ b/packages/@aws-cdk/aws-s3tables-alpha/lib/table-bucket.ts @@ -295,12 +295,12 @@ export interface TableBucketAttributes { * * @stateful * @example - * const tableBucket = new TableBucket(scope, 'ExampleTableBucket', { + * const sampleTableBucket = new TableBucket(scope, 'ExampleTableBucket', { * tableBucketName: 'example-bucket', * // Optional fields: * unreferencedFileRemoval: { * noncurrentDays: 123, - * status: 'status', + * status: UnreferencedFileRemovalStatus.ENABLED, * unreferencedDays: 123, * }, * }); diff --git a/packages/@aws-cdk/aws-s3tables-alpha/package.json b/packages/@aws-cdk/aws-s3tables-alpha/package.json index 1db8c83b9e51d..e22b8c4da0ac9 100644 --- a/packages/@aws-cdk/aws-s3tables-alpha/package.json +++ b/packages/@aws-cdk/aws-s3tables-alpha/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-s3tables-alpha", - "private": true, + "private": false, "version": "0.0.0", "description": "CDK Constructs for S3 Tables", "main": "lib/index.js", @@ -103,14 +103,7 @@ "AWSLINT_BASE_CONSTRUCT": true } }, - "awslint": { - "exclude": [ - "props-physical-name:@aws-cdk/aws-s3tables-alpha.TableBucketPolicyProps", - "duration-prop-type:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.noncurrentDays", - "duration-prop-name:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.noncurrentDays", - "duration-prop-type:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.unreferencedDays", - "duration-prop-name:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.unreferencedDays", - "attribute-tag:@aws-cdk/aws-s3tables-alpha.TableBucket.tableBucketPolicy" - ] + "publishConfig": { + "tag": "latest" } } diff --git a/packages/@aws-cdk/aws-s3tables-alpha/rosetta/default.ts-fixture b/packages/@aws-cdk/aws-s3tables-alpha/rosetta/default.ts-fixture new file mode 100644 index 0000000000000..c6d93a0493b30 --- /dev/null +++ b/packages/@aws-cdk/aws-s3tables-alpha/rosetta/default.ts-fixture @@ -0,0 +1,15 @@ +import { Construct } from 'constructs'; +import { Stack } from 'aws-cdk-lib'; +import { TableBucket, UnreferencedFileRemovalStatus } from '@aws-cdk/aws-s3tables-alpha'; +import * as iam from 'aws-cdk-lib/aws-iam'; + +class Fixture extends Stack { + constructor(scope: Construct, id: string) { + super(scope, id); + const tableBucket = new TableBucket(scope, 'ExampleTableBucket', { + tableBucketName: 'example-bucket-1' + }); + const stack = this; + /// here + } +}