@izara_project/izara-market-library-service-schemas 1.0.18 → 1.0.19
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.
- package/package.json +2 -2
- package/src/GenerateCodeLibs/src/Consts.js +32 -2
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +3 -61
- package/src/SourceManager/src/Utils.js +16 -1
- package/src/TemplateManager/src/GenerateCode.js +134 -45
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +1 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +1 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +42 -23
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/template.ejs +0 -1
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/template.ejs +13 -11
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +34 -18
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler/mainFunction → PerActionEndpoint/libs}/data.js +12 -23
- package/src/TemplateManager/src/PerActionEndpoint/libs/template.ejs +46 -0
- package/src/TemplateManager/src/externalService/LambdaRole/data.js +114 -4
- package/src/TemplateManager/src/externalService/LambdaRole/template.ejs +3 -4
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +31 -6
- package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/dynamoDb/ReservedTableData.js +65 -0
- package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/functionYaml/data.js +3 -2
- package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/handler/data.js +1 -1
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/functionYaml/data.js +77 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/FlowSchemaEndpoint/InProcessFlowSchema}/functionYaml/template.ejs +9 -3
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/data.js +47 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/FlowSchemaEndpoint/InProcessFlowSchema}/handler/template.ejs +25 -52
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/data.js +46 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/data.js +36 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/data.js +102 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/template.ejs +30 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/data.js +58 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/template.ejs +126 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/data.js +51 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/template.ejs +121 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/data.js +64 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/template.ejs +45 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/UploadS3Case/createObject}/functionYaml/data.js +35 -12
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/functionYaml/template.ejs +37 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/data.js +72 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/template.ejs +107 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler/handler → flowSchema/UploadS3Case/createObject/mainFunction}/data.js +11 -15
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/UploadS3Case/createObject}/mainFunction/template.ejs +4 -4
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/functionYaml/data.js +6 -4
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/functionYaml/template.ejs +30 -0
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/handler/data.js +1 -1
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/handler/template.ejs +10 -10
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/mainFunction/data.js +3 -4
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/mainFunction/template.ejs +86 -0
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/sns-sqs/data.js +4 -2
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/sns-sqs/template.ejs +49 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/functionYaml/data.js +85 -0
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc}/functionYaml/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/data.js +57 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/template.ejs +120 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/data.js +51 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/template.ejs +164 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/data.js +65 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/template.ejs +53 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/data.js +112 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/template.ejs +30 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/data.js +57 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/template.ejs +126 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/data.js +54 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/template.ejs +254 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/data.js +64 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/template.ejs +45 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/data.js +94 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateAsyncHandler.ejs +110 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateSyncHandler.ejs +49 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/hookLogic/data.js +44 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/data.js +66 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/template.ejs +7 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/data.js +73 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/snsTemplate.ejs +59 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/data.js +87 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/template.ejs +30 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/data.js +112 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/template.ejs +38 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/data.js +45 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/template.ejs +151 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/data.js +43 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/template.ejs +68 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/data.js +43 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/template.ejs +392 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/data.js +77 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/dsqTemplatePath.ejs +32 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/s3Template.ejs +59 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/data.js +51 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/template.ejs +13 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/data.js +42 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/template.ejs +137 -0
- package/src/TemplateManager/src/libs/Consts.js +57 -28
- package/src/TemplateManager/src/flowTag/webSocket/webSocketComplete/mainFunction/template.ejs +0 -180
- /package/src/TemplateManager/src/{flowTag/resources/dynamoDb/data.js → flowSchema/DefaultWebSocketResource/dynamoDb/WebSocketTaskData.js} +0 -0
- /package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/functionYaml/template.ejs +0 -0
- /package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/handler/template.ejs +0 -0
- /package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete/sns-sqs/template.ejs → flowSchema/UploadS3Case/hookCode/queue/sqsTemplate.ejs} +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
|
|
23
|
+
const { SOURCE_PATH, defaultIamRolePerAction, shortNameHandler, SAVE_FILE_NAME, createIamRole, RESOURCE_CLASSES, SNS_RESOURCE, resourceNames, DYNAMO_RESOURCE } = require('../../../../libs/Consts');
|
|
24
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function data(_izContext, flowSchema, srcPath) {
|
|
28
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
32
|
+
let functionName = "InProcessWebSocket";
|
|
33
|
+
let handlerType = "HdrWbs"
|
|
34
|
+
let additionalResourcePermission = defaultIamRolePerAction();
|
|
35
|
+
let functionNameConfig = upperCase(functionName) + upperCase(shortNameHandler(handlerType))
|
|
36
|
+
|
|
37
|
+
additionalResourcePermission.push(
|
|
38
|
+
createIamRole(
|
|
39
|
+
{
|
|
40
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
41
|
+
},
|
|
42
|
+
[
|
|
43
|
+
resourceNames(RESOURCE_CLASSES.sns, `InProcess${flowSchema.flowTag}`)
|
|
44
|
+
]
|
|
45
|
+
),
|
|
46
|
+
createIamRole(
|
|
47
|
+
{
|
|
48
|
+
[RESOURCE_CLASSES.dynamoDbTable]: [
|
|
49
|
+
DYNAMO_RESOURCE.putItem,
|
|
50
|
+
DYNAMO_RESOURCE.deleteItem
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "WebSocketTask")
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
templatePath: templatePath,
|
|
59
|
+
templateData: {
|
|
60
|
+
functionName,
|
|
61
|
+
handlerType,
|
|
62
|
+
functionNameConfig,
|
|
63
|
+
additionalResourcePermission,
|
|
64
|
+
resourceLocation: SOURCE_PATH.resourceLocationWebSocket,
|
|
65
|
+
route: flowSchema.flowTag
|
|
66
|
+
},
|
|
67
|
+
setting: {
|
|
68
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
69
|
+
saveFileName: upperCase(SAVE_FILE_NAME.flowSchema),
|
|
70
|
+
fileExtension: '.yml',
|
|
71
|
+
isAppend: true
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
module.exports = data;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
<%_ const join = require('path').join; _%>
|
|
2
|
-
<%- firstLetterUpperCase(
|
|
2
|
+
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
|
|
4
|
+
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
5
|
events:
|
|
6
|
+
- websocket:
|
|
7
|
+
route: $connect
|
|
8
|
+
- websocket:
|
|
9
|
+
route: $disconnect
|
|
10
|
+
- websocket:
|
|
11
|
+
route: $default
|
|
6
12
|
- websocket:
|
|
7
13
|
route: <%- route %>
|
|
8
|
-
|
|
14
|
+
# authorizer: ${self:custom.iz_authorizerAppLevel}
|
|
9
15
|
# identifierResource: 'route.request.header.Auth'
|
|
10
16
|
iamRoleStatements:
|
|
11
17
|
<%_ additionalResourcePermission.forEach(resourcePermission => { _%>
|
package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/data.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
|
|
23
|
+
const { SOURCE_PATH } = require('../../../../libs/Consts');
|
|
24
|
+
const templatePath = path.join(__dirname, './template.ejs')
|
|
25
|
+
|
|
26
|
+
function data(_izContext, srcPath) {
|
|
27
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createSourceParams(_izContext, srcPath) {
|
|
31
|
+
let functionName = "InProcessWebSocket";
|
|
32
|
+
let handlerType = "HdrWbs";
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
templatePath: templatePath,
|
|
36
|
+
templateData: {},
|
|
37
|
+
setting: {
|
|
38
|
+
savePath: path.join(srcPath, SOURCE_PATH.webSocket),
|
|
39
|
+
saveFileName: upperCase(functionName) + upperCase(handlerType),
|
|
40
|
+
fileExtension: ".js",
|
|
41
|
+
isAppend: true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
module.exports = data;
|
|
@@ -25,47 +25,56 @@ const izaraShared = require('@izara_project/izara-shared')
|
|
|
25
25
|
const dynamodbSharedLib = izaraShared.dynamodbSharedLib
|
|
26
26
|
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
27
27
|
const hash = require('object-hash')
|
|
28
|
+
// const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
|
|
29
|
+
const consts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
30
|
+
const { postToConnection } = require("../../libs/source/ImportDataLib");
|
|
31
|
+
const createObject = require('./CreateObjectS3_Main');
|
|
28
32
|
|
|
29
|
-
const { ApiGatewayManagementApiClient, PostToConnectionCommand } = require("@aws-sdk/client-apigatewaymanagementapi");
|
|
30
|
-
const flowSchema = require('./FlowSchema_Main');
|
|
31
|
-
|
|
32
|
-
const client = new ApiGatewayManagementApiClient({
|
|
33
|
-
endpoint: `https://${process.env.iz_webSocketEndpoint}`
|
|
34
|
-
})
|
|
35
33
|
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
36
34
|
|
|
37
35
|
event._izContext.logger.debug('Event:', event);
|
|
38
36
|
|
|
39
37
|
try {
|
|
40
38
|
|
|
41
|
-
let eventParams = JSON.parse(event.body)
|
|
42
|
-
|
|
43
39
|
if (event.requestContext) {
|
|
44
40
|
const route = event.requestContext.routeKey;
|
|
45
41
|
const connectionId = event.requestContext.connectionId;
|
|
46
42
|
|
|
47
43
|
switch (route) {
|
|
48
|
-
case
|
|
49
|
-
console.log(
|
|
44
|
+
case "$connect":
|
|
45
|
+
console.log("webSocket Connect");
|
|
46
|
+
break
|
|
47
|
+
case "$disconnect":
|
|
48
|
+
console.log("webSocket Disconnect");
|
|
49
|
+
break
|
|
50
|
+
case '$default':
|
|
51
|
+
console.log('Received unknown route:', route);
|
|
50
52
|
break
|
|
51
53
|
case 'webSocket':
|
|
52
|
-
console.log("event in route", event)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
console.log("event in route webSocket", event);
|
|
55
|
+
|
|
56
|
+
let eventParams = JSON.parse(event.body)
|
|
57
|
+
|
|
58
|
+
let callingFlow = eventParams?.callingFlow ? eventParams.callingFlow : {};
|
|
59
|
+
|
|
60
|
+
await createObject.createObject(
|
|
56
61
|
event._izContext,
|
|
57
62
|
eventParams,
|
|
58
63
|
//(<additionalParams>)
|
|
64
|
+
event,
|
|
59
65
|
//(</additionalParams>)
|
|
60
66
|
callingFlowSharedLib.addCallingFlowToPassOnProperties(callingFlow)
|
|
61
67
|
)
|
|
62
68
|
|
|
69
|
+
let correlationId = event._izContext.correlationIds.get(consts.X_CORRELATION_ID)
|
|
70
|
+
event._izContext.logger.debug("correlationId", correlationId)
|
|
71
|
+
|
|
63
72
|
// if (returnValueFlowSchema) {
|
|
64
73
|
await dynamodbSharedLib.putItem(
|
|
65
74
|
event._izContext,
|
|
66
75
|
await dynamodbSharedLib.tableName(event._izContext, "WebSocketTask"),
|
|
67
76
|
{
|
|
68
|
-
taskKey:
|
|
77
|
+
taskKey: correlationId,
|
|
69
78
|
connectionId: connectionId,
|
|
70
79
|
}
|
|
71
80
|
)
|
|
@@ -91,40 +100,4 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
91
100
|
await postToConnection({ message: err.message }, connId);
|
|
92
101
|
return (izara.response.failure(err));
|
|
93
102
|
}
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
async function postMessage(data, connectionId) {
|
|
97
|
-
const params = {
|
|
98
|
-
ConnectionId: connectionId,
|
|
99
|
-
Data: JSON.stringify(data),
|
|
100
|
-
}
|
|
101
|
-
return api.postToConnection(params).promise();
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
async function sendErrorMessage(errorMessage, connectionId) {
|
|
105
|
-
const params = {
|
|
106
|
-
ConnectionId: connectionId,
|
|
107
|
-
Data: JSON.stringify(errorMessage)
|
|
108
|
-
}
|
|
109
|
-
return api.postToConnection(params).promise();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const postToConnection = async (message, connectionId) => {
|
|
113
|
-
try {
|
|
114
|
-
const messageParams = JSON.stringify(message)
|
|
115
|
-
const command = new PostToConnectionCommand({
|
|
116
|
-
ConnectionId: connectionId,
|
|
117
|
-
Data: Buffer.from(messageParams)
|
|
118
|
-
})
|
|
119
|
-
// console.log("command::", command)
|
|
120
|
-
// console.log("client::", client)
|
|
121
|
-
await client.send(command);
|
|
122
|
-
console.log(`send Message: ${JSON.stringify(message)} to ${connectionId} 1`)
|
|
123
|
-
} catch (err) {
|
|
124
|
-
if (err.name === "GoneException") {
|
|
125
|
-
console.log(`message send to connectionIds ${connectionId} is no longer connect`)
|
|
126
|
-
} else {
|
|
127
|
-
console.error(`Error post message: ${err}`)
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
103
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
|
|
23
|
+
const { SOURCE_PATH } = require('../../../../libs/Consts');
|
|
24
|
+
const templatePath = path.join(__dirname, './template.ejs')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function data(_izContext, srcPath) {
|
|
28
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function createSourceParams(_izContext, srcPath) {
|
|
32
|
+
let functionName = "InProcessWebSocket";
|
|
33
|
+
return {
|
|
34
|
+
templatePath: templatePath,
|
|
35
|
+
templateData: {},
|
|
36
|
+
setting: {
|
|
37
|
+
savePath: path.join(srcPath, SOURCE_PATH.webSocket),
|
|
38
|
+
saveFileName: `${functionName}_Main`,
|
|
39
|
+
fileExtension: ".js",
|
|
40
|
+
isAppend: false
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
module.exports = data;
|
|
File without changes
|
package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/data.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
|
|
23
|
+
const { SOURCE_PATH } = require('../../../../libs/Consts');
|
|
24
|
+
const templatePath = path.join(__dirname, './template.ejs')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function data(_izContext, srcPath) {
|
|
28
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function createSourceParams(_izContext, srcPath) {
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
module.exports = data;
|
|
File without changes
|
package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/data.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
|
|
23
|
+
const { SOURCE_PATH } = require('../../libs/Consts');
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
function data(_izContext, srcPath) {
|
|
27
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createSourceParams(_izContext, srcPath) {
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
module.exports = data;
|
package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/template.ejs
ADDED
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
|
|
23
|
+
const { SOURCE_PATH } = require('../../libs/Consts');
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
function data(_izContext, srcPath) {
|
|
27
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createSourceParams(_izContext, srcPath) {
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
module.exports = data;
|
package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/template.ejs
ADDED
|
File without changes
|
package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/data.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
|
|
23
|
+
const { SOURCE_PATH } = require('../../libs/Consts');
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
function data(_izContext, srcPath) {
|
|
27
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createSourceParams(_izContext, srcPath) {
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
module.exports = data;
|
package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/template.ejs
ADDED
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
|
|
23
|
+
const { SOURCE_PATH } = require('../../libs/Consts');
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
function data(_izContext, srcPath) {
|
|
27
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createSourceParams(_izContext, srcPath) {
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
module.exports = data;
|
package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/template.ejs
ADDED
|
File without changes
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2021 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
|
|
20
|
+
const path = require('path');
|
|
21
|
+
|
|
22
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
23
|
+
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
25
|
+
const { HANDLER, defaultIamRolePerAction, createIamRole, RESOURCE_CLASSES, SQS_RESOURCE, SNS_RESOURCE, resourceNames, shortNameHandler, SOURCE_PATH, SAVE_FILE_NAME, awaitingMultipleStepsRole, externalResourceSns, externalResourceName, DYNAMO_RESOURCE, LAMBDA_RESOURCE } = require('../../../../libs/Consts');
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* receive objectSchema
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} flowSchema
|
|
31
|
+
* @return {{ templatePath, templateData, setting } }
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
function data(_izContext, srcPath) {
|
|
35
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function createSourceParams(_izContext, srcPath) {
|
|
39
|
+
let functionName = "ConfirmNewReserved";
|
|
40
|
+
let handlerType = upperCase(HANDLER.hdrSqs);
|
|
41
|
+
let additionalResourcePermission = defaultIamRolePerAction();
|
|
42
|
+
|
|
43
|
+
additionalResourcePermission.push(
|
|
44
|
+
createIamRole(
|
|
45
|
+
{
|
|
46
|
+
[RESOURCE_CLASSES.sqs]: [
|
|
47
|
+
SQS_RESOURCE.receiveMessage,
|
|
48
|
+
SQS_RESOURCE.sendMessage,
|
|
49
|
+
SQS_RESOURCE.deleteMessage,
|
|
50
|
+
SQS_RESOURCE.getQueueAttributes
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
[
|
|
54
|
+
resourceNames(RESOURCE_CLASSES.sqs, functionName + handlerType),
|
|
55
|
+
resourceNames(RESOURCE_CLASSES.sqs, functionName + "DLQ"),
|
|
56
|
+
]
|
|
57
|
+
),
|
|
58
|
+
createIamRole(
|
|
59
|
+
{
|
|
60
|
+
[RESOURCE_CLASSES.dynamoDbTable]: [
|
|
61
|
+
DYNAMO_RESOURCE.query,
|
|
62
|
+
DYNAMO_RESOURCE.deleteItem,
|
|
63
|
+
DYNAMO_RESOURCE.updateItem,
|
|
64
|
+
DYNAMO_RESOURCE.putItem
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
[
|
|
68
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "ReservedDataMain"),
|
|
69
|
+
]
|
|
70
|
+
),
|
|
71
|
+
createIamRole(
|
|
72
|
+
{
|
|
73
|
+
[RESOURCE_CLASSES.lambda]: [LAMBDA_RESOURCE.invokeFunction],
|
|
74
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
75
|
+
},
|
|
76
|
+
[
|
|
77
|
+
resourceNames(RESOURCE_CLASSES.lambda, "ImportBatchMainGetHdrInv"),
|
|
78
|
+
resourceNames(RESOURCE_CLASSES.sns, "InImportBatchMainUpdate")
|
|
79
|
+
]
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
templatePath: templatePath,
|
|
85
|
+
templateData: {
|
|
86
|
+
functionName,
|
|
87
|
+
handlerType,
|
|
88
|
+
functionNameConfig: functionName + upperCase(handlerType),
|
|
89
|
+
resourceLocation: SOURCE_PATH.resourceLocationWebSocket,
|
|
90
|
+
additionalResourcePermission,
|
|
91
|
+
functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
92
|
+
},
|
|
93
|
+
setting: {
|
|
94
|
+
saveFileName: upperCase(SAVE_FILE_NAME.flowSchema),
|
|
95
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
96
|
+
fileExtension: ".yml",
|
|
97
|
+
isAppend: true
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
module.exports = data
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<%_ const join = require('path').join; _%>
|
|
2
|
+
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
|
+
handler: <%- join(resourceLocation, `${functionName}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
|
+
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
events:
|
|
6
|
+
- sqs:
|
|
7
|
+
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
8
|
+
batchSize: 10
|
|
9
|
+
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>"]}}} # functionName of callingFlow
|
|
11
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
+
iamRoleStatements:
|
|
13
|
+
<%_ additionalResourcePermission.forEach(resourcePermission => { _%>
|
|
14
|
+
- Effect: <%- resourcePermission.effect %>
|
|
15
|
+
Action:
|
|
16
|
+
<%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
|
|
17
|
+
<%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
|
|
18
|
+
- <%- resourcePerAction %>:<%- permission %>
|
|
19
|
+
<%_ }) _%>
|
|
20
|
+
<%_ }) _%>
|
|
21
|
+
Resource:
|
|
22
|
+
<%_ resourcePermission.resource.forEach(resource => { _%>
|
|
23
|
+
- "<%- resource %>"
|
|
24
|
+
<%_ }) _%>
|
|
25
|
+
<%_}) _%>
|
|
26
|
+
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
27
|
+
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
28
|
+
<%_ function firstLetterUpperCase(text){
|
|
29
|
+
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
30
|
+
} _%>
|