@justworkflowit/cdk-constructs 0.0.2 → 0.0.3
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.
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Construct } from 'constructs';
|
|
2
|
+
export interface JustWorkflowItConstructProps {
|
|
3
|
+
disambiguator: string;
|
|
4
|
+
}
|
|
2
5
|
export declare class JustWorkflowItConstruct extends Construct {
|
|
3
|
-
|
|
6
|
+
private static readonly CONSTRUCT_ID_PREFIX;
|
|
7
|
+
constructor(scope: Construct, props: JustWorkflowItConstructProps);
|
|
4
8
|
}
|
|
@@ -7,13 +7,15 @@ const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
|
|
|
7
7
|
const aws_iam_1 = require("aws-cdk-lib/aws-iam");
|
|
8
8
|
const aws_secretsmanager_1 = require("aws-cdk-lib/aws-secretsmanager");
|
|
9
9
|
class JustWorkflowItConstruct extends constructs_1.Construct {
|
|
10
|
-
constructor(scope,
|
|
11
|
-
super(scope,
|
|
10
|
+
constructor(scope, props) {
|
|
11
|
+
super(scope, `${JustWorkflowItConstruct.CONSTRUCT_ID_PREFIX}${props.disambiguator}`);
|
|
12
|
+
const secretName = '/justworkflowit/api/authToken';
|
|
12
13
|
const secret = new aws_secretsmanager_1.Secret(this, 'JustWorkflowItAuthTokenSecret', {
|
|
13
|
-
secretName
|
|
14
|
+
secretName,
|
|
14
15
|
description: 'Paste your JustWorkflowIt API auth token here to enable secure communication.',
|
|
15
16
|
});
|
|
16
|
-
const integrationLambda = new aws_lambda_1.Function(this, '
|
|
17
|
+
const integrationLambda = new aws_lambda_1.Function(this, 'JustWorkflowItAutomationIntegrationLambda', {
|
|
18
|
+
functionName: 'JustWorkflowItAutomationIntegrationLambda',
|
|
17
19
|
runtime: aws_lambda_1.Runtime.NODEJS_18_X,
|
|
18
20
|
handler: 'index.handler',
|
|
19
21
|
code: aws_lambda_1.Code.fromInline(`
|
|
@@ -23,14 +25,14 @@ class JustWorkflowItConstruct extends constructs_1.Construct {
|
|
|
23
25
|
`),
|
|
24
26
|
timeout: aws_cdk_lib_1.Duration.seconds(10),
|
|
25
27
|
environment: {
|
|
26
|
-
AUTH_SECRET_NAME:
|
|
28
|
+
AUTH_SECRET_NAME: secretName,
|
|
27
29
|
API_BASE_URL: 'https://api.justworkflowit.com',
|
|
28
30
|
},
|
|
29
31
|
});
|
|
30
32
|
secret.grantRead(integrationLambda);
|
|
31
|
-
const executionRole = new aws_iam_1.Role(this, '
|
|
32
|
-
roleName: '
|
|
33
|
-
assumedBy: new aws_iam_1.AccountPrincipal('588738588052'),
|
|
33
|
+
const executionRole = new aws_iam_1.Role(this, 'JustWorkflowItAutomationExecutionRole', {
|
|
34
|
+
roleName: 'JustWorkflowItAutomationExecutionRole',
|
|
35
|
+
assumedBy: new aws_iam_1.AccountPrincipal('588738588052'),
|
|
34
36
|
description: 'Role assumed by JustWorkflowIt backend to perform actions inside this account.',
|
|
35
37
|
});
|
|
36
38
|
executionRole.addToPolicy(new aws_iam_1.PolicyStatement({
|
|
@@ -48,3 +50,4 @@ class JustWorkflowItConstruct extends constructs_1.Construct {
|
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
exports.JustWorkflowItConstruct = JustWorkflowItConstruct;
|
|
53
|
+
JustWorkflowItConstruct.CONSTRUCT_ID_PREFIX = "JustWorkflowItConstruct";
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justworkflowit/cdk-constructs",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
4
|
+
"version": "0.0.3",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"types": "dist/src/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
9
|
"prepare": "npm run build",
|