@gradientedge/cdk-utils 5.10.0 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -146,6 +146,11 @@ export declare class IamManager {
146
146
  * @param {string[]} resourceArns list of ARNs to allow access to
147
147
  */
148
148
  statementForReadTableItems(resourceArns?: string[]): cdk.aws_iam.PolicyStatement;
149
+ /**
150
+ * @summary Method to create iam statement to write items from dynamodb table
151
+ * @param {string[]} resourceArns list of ARNs to allow access to
152
+ */
153
+ statementForWriteTableItems(resourceArns?: string[]): cdk.aws_iam.PolicyStatement;
149
154
  /**
150
155
  * @summary Method to create iam statement for cloud trail
151
156
  * @param {string} id scoped id of the resource
@@ -337,6 +337,17 @@ class IamManager {
337
337
  resources: resourceArns ?? ['*'],
338
338
  });
339
339
  }
340
+ /**
341
+ * @summary Method to create iam statement to write items from dynamodb table
342
+ * @param {string[]} resourceArns list of ARNs to allow access to
343
+ */
344
+ statementForWriteTableItems(resourceArns) {
345
+ return new iam.PolicyStatement({
346
+ effect: iam.Effect.ALLOW,
347
+ actions: ['dynamodb:BatchWriteItem', 'dynamodb:DeleteItem', 'dynamodb:PutItem', 'dynamodb:UpdateItem'],
348
+ resources: resourceArns ?? ['*'],
349
+ });
350
+ }
340
351
  /**
341
352
  * @summary Method to create iam statement for cloud trail
342
353
  * @param {string} id scoped id of the resource
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "5.10.0",
3
+ "version": "5.11.0",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -343,6 +343,18 @@ export class IamManager {
343
343
  })
344
344
  }
345
345
 
346
+ /**
347
+ * @summary Method to create iam statement to write items from dynamodb table
348
+ * @param {string[]} resourceArns list of ARNs to allow access to
349
+ */
350
+ public statementForWriteTableItems(resourceArns?: string[]) {
351
+ return new iam.PolicyStatement({
352
+ effect: iam.Effect.ALLOW,
353
+ actions: ['dynamodb:BatchWriteItem', 'dynamodb:DeleteItem', 'dynamodb:PutItem', 'dynamodb:UpdateItem'],
354
+ resources: resourceArns ?? ['*'],
355
+ })
356
+ }
357
+
346
358
  /**
347
359
  * @summary Method to create iam statement for cloud trail
348
360
  * @param {string} id scoped id of the resource