You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(s3tables-alpha): add TablePolicy support to L2 construct library (#35223)
### Issue # (if applicable)
Related to #33054
### Reason for this change
This PR includes backward-compatible changes being made to add L2 support for the [CfnTable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3tables.CfnTable.html) and [CfnTablePolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3tables.CfnTablePolicy.html) constructs with a consistent user interface, recommended defaults, and in-built validations for managing Table level IAM resource policies.
### Description of changes
**New L2 Construct**: TablePolicy: defines an underlying [CfnTablePolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3tables-tablepolicy.html) resource
**New methods added to Table construct**:
- `addToResourcePolicy`: Attaches a policy statement to the Table's IAM policy
- `grantRead`: Grants read access to the table for the given principal
- `grantWrite`: Grants write access to the table for the given principal
- `grantReadWrite`: Grants read and write access to the table for the given principal
### Describe any new or updated permissions being added
Method | IAM Actions | Description
-- | -- | --
table.grantRead | s3tables:Get* | Grants read permission to S3 Table
table.grantWrite | s3tables:PutTableData<br>s3tables:UpdateTableMetadataLocation<br>s3tables:RenameTable | Grants write permission to S3 Table
table.grantReadWrite | s3tables:Get*<br>s3tables:PutTableData<br>s3tables:UpdateTableMetadataLocation<br>s3tables:CreateTable | Grants read and write permissions to S3 Table
### Description of how you validated changes
- Unit tests
- Passing Integration tests with snapshots and assertions via API calls
### 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*
Copy file name to clipboardExpand all lines: packages/@aws-cdk/aws-s3tables-alpha/test/integration/integ.table-with-grants.js.snapshot/TableWithGrantIntegTestDefaultTestDeployAssertE9880469.assets.json
0 commit comments