@bifravst/aws-cdk-lambda-helpers 1.2.8 → 1.3.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.
@@ -0,0 +1,10 @@
1
+ import { aws_iam as IAM } from 'aws-cdk-lib';
2
+ import { Construct } from 'constructs';
3
+ /**
4
+ * Base role for IoT Actions that allows to publish to the 'errors' topic
5
+ */
6
+ export declare class IoTActionRole extends Construct {
7
+ readonly role: IAM.IRole;
8
+ readonly roleArn: string;
9
+ constructor(parent: Construct);
10
+ }
@@ -0,0 +1,28 @@
1
+ import { aws_iam as IAM, Stack } from 'aws-cdk-lib';
2
+ import { Construct } from 'constructs';
3
+ /**
4
+ * Base role for IoT Actions that allows to publish to the 'errors' topic
5
+ */
6
+ export class IoTActionRole extends Construct {
7
+ role;
8
+ roleArn;
9
+ constructor(parent) {
10
+ super(parent, 'errorActionRole');
11
+ this.role = new IAM.Role(this, 'iot-action-role', {
12
+ assumedBy: new IAM.ServicePrincipal('iot.amazonaws.com'),
13
+ inlinePolicies: {
14
+ rootPermissions: new IAM.PolicyDocument({
15
+ statements: [
16
+ new IAM.PolicyStatement({
17
+ actions: ['iot:Publish'],
18
+ resources: [
19
+ `arn:aws:iot:${Stack.of(this).region}:${Stack.of(this).account}:topic/errors`,
20
+ ],
21
+ }),
22
+ ],
23
+ }),
24
+ },
25
+ });
26
+ this.roleArn = this.role.roleArn;
27
+ }
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bifravst/aws-cdk-lambda-helpers",
3
- "version": "1.2.8",
3
+ "version": "1.3.0",
4
4
  "description": "Helper functions which simplify working with TypeScript lambdas for AWS CDK.",
5
5
  "exports": {
6
6
  ".": {
@@ -52,7 +52,7 @@
52
52
  "license": "BSD-3-Clause",
53
53
  "devDependencies": {
54
54
  "@aws-sdk/client-cloudformation": "3.552.0",
55
- "@bifravst/eslint-config-typescript": "6.0.21",
55
+ "@bifravst/eslint-config-typescript": "6.0.22",
56
56
  "@bifravst/prettier-config": "1.0.0",
57
57
  "@commitlint/config-conventional": "19.1.0",
58
58
  "@nordicsemiconductor/cloudformation-helpers": "^9.0.3",
@@ -60,7 +60,7 @@
60
60
  "@types/aws-lambda": "8.10.137",
61
61
  "@types/node": "20.12.7",
62
62
  "@types/yazl": "2.4.5",
63
- "cdk": "2.136.1",
63
+ "cdk": "2.137.0",
64
64
  "husky": "9.0.11",
65
65
  "id128": "1.6.6",
66
66
  "tsx": "4.7.2"
@@ -117,7 +117,7 @@
117
117
  "yazl": "2.5.1"
118
118
  },
119
119
  "peerDependencies": {
120
- "aws-cdk-lib": "^2.136.1",
120
+ "aws-cdk-lib": "^2.137.0",
121
121
  "constructs": "^10.3.0"
122
122
  }
123
123
  }