Skip to content

Commit baa4a5c

Browse files
authored
chore(s3tables-alpha): add rosetta support to docs and make package non-private (#34108)
### Reason for this change - Add rosetta support for s3tables-alpha documentation. - Set @aws-cdk/aws-s3tables-alpha module to non-private. ### Description of changes Add support for rosetta for README and JSDocs examples. This module was previously set to private, due to which it was not released as an npm module and was not showing up on aws-cdk documentation. ### Describe any new or updated permissions being added N/A ### Description of how you validated changes yarn build+test+extract ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 81f41b3 commit baa4a5c

File tree

6 files changed

+40
-17
lines changed

6 files changed

+40
-17
lines changed

packages/@aws-cdk/aws-s3tables-alpha/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ jest.config.js
2626
junit.xml
2727
!*.lit.ts
2828
**/*.snapshot
29+
test/

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

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Amazon S3 Tables Construct Library
2-
32
<!--BEGIN STABILITY BANNER-->
43

54
---
65

76
![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
87

9-
> 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.
8+
> The APIs of higher level constructs in this module are experimental and under active development.
9+
> They are subject to non-backward compatible changes or removal in any future version. These are
10+
> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
11+
> announced in the release notes. This means that while you may use them, you may need to update
12+
> your source code when upgrading to a newer version of this package.
1013
1114
---
1215

@@ -25,7 +28,7 @@ Amazon S3 Tables deliver the first cloud object store with built-in Apache Icebe
2528

2629
```ts
2730
// Build a Table bucket
28-
const tableBucket = new TableBucket(scope, 'ExampleTableBucket', {
31+
const sampleTableBucket = new TableBucket(scope, 'ExampleTableBucket', {
2932
tableBucketName: 'example-bucket-1',
3033
// optional fields:
3134
unreferencedFileRemoval: {
@@ -45,7 +48,8 @@ Learn more about table buckets maintenance operations and default behavior from
4548
const accountId = '123456789012'
4649
tableBucket.grantRead(new iam.AccountPrincipal(accountId), '*');
4750
// Grant the role write permissions to the bucket and all tables within
48-
tableBucket.grantWrite(new iam.Role(stack, 'MyRole'), '*');
51+
const role = new iam.Role(stack, 'MyRole', { assumedBy: new iam.ServicePrincipal('sample') });
52+
tableBucket.grantWrite(role, '*');
4953
// Grant the user read and write permissions to the bucket and all tables within
5054
tableBucket.grantReadWrite(new iam.User(stack, 'MyUser'), '*');
5155

@@ -55,7 +59,7 @@ tableBucket.grantReadWrite(new iam.AccountPrincipal(accountId), tableId);
5559

5660
// Add custom resource policy statements
5761
const permissions = new iam.PolicyStatement({
58-
effect: Effect.ALLOW,
62+
effect: iam.Effect.ALLOW,
5963
actions: ['s3tables:*'],
6064
principals: [ new iam.ServicePrincipal('example.aws.internal') ],
6165
resources: ['*']
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"exclude": [
3+
"props-physical-name:@aws-cdk/aws-s3tables-alpha.TableBucketPolicyProps",
4+
"duration-prop-type:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.noncurrentDays",
5+
"duration-prop-name:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.noncurrentDays",
6+
"duration-prop-type:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.unreferencedDays",
7+
"duration-prop-name:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.unreferencedDays",
8+
"attribute-tag:@aws-cdk/aws-s3tables-alpha.TableBucket.tableBucketPolicy"
9+
]
10+
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,12 @@ export interface TableBucketAttributes {
295295
*
296296
* @stateful
297297
* @example
298-
* const tableBucket = new TableBucket(scope, 'ExampleTableBucket', {
298+
* const sampleTableBucket = new TableBucket(scope, 'ExampleTableBucket', {
299299
* tableBucketName: 'example-bucket',
300300
* // Optional fields:
301301
* unreferencedFileRemoval: {
302302
* noncurrentDays: 123,
303-
* status: 'status',
303+
* status: UnreferencedFileRemovalStatus.ENABLED,
304304
* unreferencedDays: 123,
305305
* },
306306
* });

packages/@aws-cdk/aws-s3tables-alpha/package.json

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aws-cdk/aws-s3tables-alpha",
3-
"private": true,
3+
"private": false,
44
"version": "0.0.0",
55
"description": "CDK Constructs for S3 Tables",
66
"main": "lib/index.js",
@@ -103,14 +103,7 @@
103103
"AWSLINT_BASE_CONSTRUCT": true
104104
}
105105
},
106-
"awslint": {
107-
"exclude": [
108-
"props-physical-name:@aws-cdk/aws-s3tables-alpha.TableBucketPolicyProps",
109-
"duration-prop-type:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.noncurrentDays",
110-
"duration-prop-name:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.noncurrentDays",
111-
"duration-prop-type:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.unreferencedDays",
112-
"duration-prop-name:@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval.unreferencedDays",
113-
"attribute-tag:@aws-cdk/aws-s3tables-alpha.TableBucket.tableBucketPolicy"
114-
]
106+
"publishConfig": {
107+
"tag": "latest"
115108
}
116109
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Construct } from 'constructs';
2+
import { Stack } from 'aws-cdk-lib';
3+
import { TableBucket, UnreferencedFileRemovalStatus } from '@aws-cdk/aws-s3tables-alpha';
4+
import * as iam from 'aws-cdk-lib/aws-iam';
5+
6+
class Fixture extends Stack {
7+
constructor(scope: Construct, id: string) {
8+
super(scope, id);
9+
const tableBucket = new TableBucket(scope, 'ExampleTableBucket', {
10+
tableBucketName: 'example-bucket-1'
11+
});
12+
const stack = this;
13+
/// here
14+
}
15+
}

0 commit comments

Comments
 (0)