@justworkflowit/cdk-constructs 0.0.5 → 0.0.6
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.
|
@@ -21,20 +21,26 @@ class JustWorkflowItConstruct extends constructs_1.Construct {
|
|
|
21
21
|
runtime: aws_lambda_1.Runtime.NODEJS_18_X,
|
|
22
22
|
handler: 'index.handler',
|
|
23
23
|
code: aws_lambda_1.Code.fromInline(`
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
exports.handler = async (event) => {
|
|
25
|
+
console.log("Custom Resource event:", JSON.stringify(event, null, 2));
|
|
26
|
+
|
|
27
|
+
const requestType = event.RequestType;
|
|
28
|
+
if (requestType === 'Create') {
|
|
29
|
+
console.log("Handling CREATE...");
|
|
30
|
+
} else if (requestType === 'Update') {
|
|
31
|
+
console.log("Handling UPDATE...");
|
|
32
|
+
} else if (requestType === 'Delete') {
|
|
33
|
+
console.log("Handling DELETE...");
|
|
34
|
+
}
|
|
35
|
+
|
|
29
36
|
return {
|
|
30
|
-
|
|
37
|
+
PhysicalResourceId: 'JustWorkflowItIntegrationTrigger',
|
|
38
|
+
Data: {
|
|
39
|
+
Message: "Integration Lambda ran successfully"
|
|
40
|
+
}
|
|
31
41
|
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
throw err;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
`),
|
|
42
|
+
};
|
|
43
|
+
`),
|
|
38
44
|
timeout: aws_cdk_lib_1.Duration.seconds(10),
|
|
39
45
|
environment: {
|
|
40
46
|
AUTH_SECRET_NAME: secretName,
|
|
@@ -47,6 +53,9 @@ class JustWorkflowItConstruct extends constructs_1.Construct {
|
|
|
47
53
|
});
|
|
48
54
|
new aws_cdk_lib_1.CustomResource(this, 'JustWorkflowItAutomationLambdaTrigger', {
|
|
49
55
|
serviceToken: provider.serviceToken,
|
|
56
|
+
properties: {
|
|
57
|
+
timestamp: new Date().toISOString()
|
|
58
|
+
}
|
|
50
59
|
});
|
|
51
60
|
const executionRole = new aws_iam_1.Role(this, 'JustWorkflowItAutomationExecutionRole', {
|
|
52
61
|
roleName: 'JustWorkflowItAutomationExecutionRole',
|