Skip to content

Commit

Permalink
Add resource polices to DynamoDB Table aws#29600
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Hannigan committed Apr 12, 2024
1 parent e113524 commit 7915c7e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/aws-cdk-lib/aws-dynamodb/lib/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,13 @@ export interface TableOptions extends SchemaOptions {
* @default - no data import from the S3 bucket
*/
readonly importSource?: ImportSourceSpecification;

/**
* Resource policy to assign to DynamoDB Table.
*
* @default - No resource policy statements are added to the created table.
*/
readonly resourcePolicy?: iam.PolicyDocument;
}

/**
Expand Down Expand Up @@ -1095,6 +1102,7 @@ export class Table extends TableBase {
kinesisStreamSpecification: props.kinesisStream ? { streamArn: props.kinesisStream.streamArn } : undefined,
deletionProtectionEnabled: props.deletionProtection,
importSourceSpecification: this.renderImportSourceSpecification(props.importSource),
resourcePolicy: props.resourcePolicy? { policyDocument: props.resourcePolicy } : undefined,
});
this.table.applyRemovalPolicy(props.removalPolicy);

Expand Down

0 comments on commit 7915c7e

Please sign in to comment.