@geek-fun/serverlessinsight 0.9.1 → 0.9.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.
- package/.serverlessinsight/state-cdn-flow-app-cdn-flow-service.json.backup +1 -1
- package/.serverlessinsight/state-iam-test-app-iam-test-service.json.backup +2 -2
- package/.serverlessinsight/state-insight-poc-app-insight-poc-tencent.json.backup +4 -8
- package/.serverlessinsight/state-insight-poc-app-log-insight-poc-tencent-log.json.backup +3 -8
- package/.serverlessinsight/state-insight-poc-deploy-app-insight-poc-deploy.json.backup +4 -4
- package/.serverlessinsight/state-insight-poc-destroy-app-insight-poc-destroy.json.backup +1 -1
- package/.serverlessinsight/state-insight-poc-timer-app-insight-poc-timer.json.backup +132 -0
- package/.serverlessinsight/state-insight-volc-app-insight-volc.json.backup +2 -2
- package/.serverlessinsight/state-insight-volc-nested-app-insight-volc-nested.json.backup +3 -3
- package/.serverlessinsight/state-nested-drift-app-nested-drift-service.json.backup +20 -5
- package/.serverlessinsight/state-role-reconcile-test-app-role-reconcile-test-service.json.backup +3 -3
- package/AGENTS.md +10 -0
- package/CHANGELOG.md +51 -0
- package/README.md +103 -13
- package/README.zh-CN.md +73 -13
- package/codecov +0 -0
- package/codecov.SHA256SUM +1 -0
- package/codecov.SHA256SUM.sig +16 -0
- package/dist/package.json +1 -1
- package/dist/src/commands/index.js +92 -24
- package/dist/src/commands/local.js +16 -3
- package/dist/src/commands/plan.js +31 -4
- package/dist/src/commands/schema.js +24 -0
- package/dist/src/commands/show.js +64 -10
- package/dist/src/commands/validate.js +34 -2
- package/dist/src/common/aliyunClient/apigwOperations.js +17 -1
- package/dist/src/common/aliyunClient/fc3Operations.js +39 -2
- package/dist/src/common/aliyunClient/ossOperations.js +214 -221
- package/dist/src/common/bucketPolicy.js +63 -0
- package/dist/src/common/constants.js +7 -1
- package/dist/src/common/domainUtils.js +4 -1
- package/dist/src/common/functionDefinition.js +25 -0
- package/dist/src/common/index.js +4 -0
- package/dist/src/common/jsonOutput.js +82 -0
- package/dist/src/common/logger.js +6 -3
- package/dist/src/common/nameBuilder.js +3 -1
- package/dist/src/common/noColor.js +9 -0
- package/dist/src/common/planCapabilities.js +119 -0
- package/dist/src/common/planCompare.js +119 -66
- package/dist/src/common/planFormatter.js +34 -20
- package/dist/src/common/planRedaction.js +26 -0
- package/dist/src/common/refreshPlanner.js +66 -21
- package/dist/src/common/siCron.js +415 -0
- package/dist/src/common/stateBackend/saasStateBackend.js +5 -4
- package/dist/src/common/tencentClient/cosOperations.js +326 -322
- package/dist/src/common/tencentClient/scfOperations.js +11 -2
- package/dist/src/common/tencentClient/tdsqlcOperations.js +6 -11
- package/dist/src/common/triggerMapper.js +16 -1
- package/dist/src/common/volcengineClient/apigwOperations.js +82 -0
- package/dist/src/common/volcengineClient/iamOperations.js +27 -3
- package/dist/src/common/volcengineClient/tosOperations.js +62 -56
- package/dist/src/common/volcengineClient/vefaasOperations.js +45 -0
- package/dist/src/lang/en.js +70 -3
- package/dist/src/lang/index.js +36 -1
- package/dist/src/lang/zh-CN.js +70 -3
- package/dist/src/parser/eventParser.js +1 -0
- package/dist/src/parser/functionParser.js +48 -2
- package/dist/src/stack/aliyunStack/apigwExecutor.js +1 -1
- package/dist/src/stack/aliyunStack/apigwPlanner.js +103 -23
- package/dist/src/stack/aliyunStack/apigwResource.js +4 -3
- package/dist/src/stack/aliyunStack/apigwTypes.js +3 -7
- package/dist/src/stack/aliyunStack/deployer.js +2 -0
- package/dist/src/stack/aliyunStack/esServerlessTypes.js +8 -4
- package/dist/src/stack/aliyunStack/fc3Executor.js +7 -3
- package/dist/src/stack/aliyunStack/fc3Planner.js +148 -153
- package/dist/src/stack/aliyunStack/fc3Resource.js +206 -53
- package/dist/src/stack/aliyunStack/fc3Types.js +30 -16
- package/dist/src/stack/aliyunStack/ossPlanner.js +15 -1
- package/dist/src/stack/aliyunStack/ossResource.js +113 -102
- package/dist/src/stack/aliyunStack/ossTypes.js +20 -20
- package/dist/src/stack/localStack/aliyunFc.js +1 -6
- package/dist/src/stack/localStack/event.js +31 -71
- package/dist/src/stack/localStack/function.js +25 -77
- package/dist/src/stack/localStack/functionRunner.js +10 -2
- package/dist/src/stack/localStack/httpAdapter.js +54 -0
- package/dist/src/stack/localStack/httpError.js +5 -0
- package/dist/src/stack/localStack/index.js +8 -1
- package/dist/src/stack/localStack/legacyLambda.js +26 -0
- package/dist/src/stack/localStack/localContext.js +29 -0
- package/dist/src/stack/localStack/localRoute.js +12 -0
- package/dist/src/stack/localStack/localRuntimes.js +22 -0
- package/dist/src/stack/localStack/localServer.js +8 -3
- package/dist/src/stack/localStack/requestBody.js +24 -0
- package/dist/src/stack/localStack/requestId.js +18 -0
- package/dist/src/stack/localStack/tencent.js +147 -0
- package/dist/src/stack/localStack/timer.js +183 -0
- package/dist/src/stack/localStack/utils.js +19 -1
- package/dist/src/stack/localStack/volcengine.js +68 -0
- package/dist/src/stack/scfStack/cosPlanner.js +9 -14
- package/dist/src/stack/scfStack/cosResource.js +42 -50
- package/dist/src/stack/scfStack/cosTypes.js +19 -14
- package/dist/src/stack/scfStack/deployer.js +2 -0
- package/dist/src/stack/scfStack/scfExecutor.js +7 -3
- package/dist/src/stack/scfStack/scfHttpTrigger.js +106 -0
- package/dist/src/stack/scfStack/scfPlanner.js +114 -29
- package/dist/src/stack/scfStack/scfResource.js +329 -311
- package/dist/src/stack/scfStack/scfTypes.js +4 -3
- package/dist/src/stack/scfStack/tdsqlcPlanner.js +10 -13
- package/dist/src/stack/volcengineStack/apigwDomains.js +64 -0
- package/dist/src/stack/volcengineStack/apigwPlanner.js +71 -15
- package/dist/src/stack/volcengineStack/apigwResource.js +60 -24
- package/dist/src/stack/volcengineStack/apigwTypes.js +5 -1
- package/dist/src/stack/volcengineStack/deployer.js +6 -0
- package/dist/src/stack/volcengineStack/tosPlanner.js +8 -13
- package/dist/src/stack/volcengineStack/tosResource.js +22 -35
- package/dist/src/stack/volcengineStack/tosTypes.js +5 -8
- package/dist/src/stack/volcengineStack/vefaasPlanner.js +186 -44
- package/dist/src/stack/volcengineStack/vefaasResource.js +232 -14
- package/dist/src/stack/volcengineStack/vefaasTypes.js +6 -3
- package/dist/src/validator/functionSchema.js +25 -2
- package/dist/src/validator/iacSchema.js +2 -1
- package/dist/src/validator/index.js +4 -1
- package/dist/src/validator/rootSchema.js +49 -18
- package/dist/src/validator/schemaExport.js +60 -0
- package/dist/src/validator/semanticValidation.js +79 -0
- package/dist/src/validator/templateRefSchema.js +9 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/release-notes.md +79 -0
- package/samples/aliyun-poc-timer.yml +39 -0
- package/samples/tencent-local/index.js +13 -0
- package/samples/tencent-local/serverlessinsight.yml +23 -0
- package/samples/volcengine-local/index.js +13 -0
- package/samples/volcengine-local/serverlessinsight.yml +28 -0
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"id": "iam-test-app-dev-sls"
|
|
23
23
|
}
|
|
24
24
|
],
|
|
25
|
-
"lastUpdated": "2026-
|
|
25
|
+
"lastUpdated": "2026-10-24T09:46:08.930Z"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
-
"lineage": "
|
|
30
|
+
"lineage": "85e03b0b-0403-48e5-ba77-e1204bc0bd7f",
|
|
31
31
|
"serial": 3
|
|
32
32
|
}
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"diskSize": null,
|
|
22
22
|
"cfsConfig": null,
|
|
23
23
|
"useGpu": null,
|
|
24
|
-
"imageConfig": null
|
|
24
|
+
"imageConfig": null,
|
|
25
|
+
"logEnabled": false
|
|
25
26
|
},
|
|
26
27
|
"instances": [
|
|
27
28
|
{
|
|
@@ -76,19 +77,14 @@
|
|
|
76
77
|
"dnsCache": null,
|
|
77
78
|
"intranetConfig": {},
|
|
78
79
|
"instanceConcurrencyConfig": {}
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"sid": "si:tencent:scf:default:test-fn",
|
|
82
|
-
"type": null,
|
|
83
|
-
"id": "test-fn"
|
|
84
80
|
}
|
|
85
81
|
],
|
|
86
|
-
"lastUpdated": "2026-
|
|
82
|
+
"lastUpdated": "2026-10-24T09:46:45.563Z"
|
|
87
83
|
}
|
|
88
84
|
},
|
|
89
85
|
"shared": {}
|
|
90
86
|
}
|
|
91
87
|
},
|
|
92
|
-
"lineage": "
|
|
88
|
+
"lineage": "bd0e7ed3-4d08-4ad7-9544-bff241577f5a",
|
|
93
89
|
"serial": 4
|
|
94
90
|
}
|
|
@@ -81,11 +81,6 @@
|
|
|
81
81
|
"intranetConfig": {},
|
|
82
82
|
"instanceConcurrencyConfig": {}
|
|
83
83
|
},
|
|
84
|
-
{
|
|
85
|
-
"sid": "si:tencent:scf:default:test-log-fn",
|
|
86
|
-
"type": null,
|
|
87
|
-
"id": "test-log-fn"
|
|
88
|
-
},
|
|
89
84
|
{
|
|
90
85
|
"sid": "si:tencent:cls-topic:default:insight-poc-tencent-log-default-log_fn-fn-logs",
|
|
91
86
|
"type": "TENCENT_CLS_TOPIC",
|
|
@@ -93,7 +88,7 @@
|
|
|
93
88
|
"topicName": "insight-poc-tencent-log-default-log_fn-fn-logs"
|
|
94
89
|
}
|
|
95
90
|
],
|
|
96
|
-
"lastUpdated": "2026-
|
|
91
|
+
"lastUpdated": "2026-10-24T09:42:22.479Z"
|
|
97
92
|
}
|
|
98
93
|
},
|
|
99
94
|
"shared": {
|
|
@@ -113,11 +108,11 @@
|
|
|
113
108
|
"logsetId": "logset-1"
|
|
114
109
|
}
|
|
115
110
|
],
|
|
116
|
-
"lastUpdated": "2026-
|
|
111
|
+
"lastUpdated": "2026-10-24T09:42:22.449Z"
|
|
117
112
|
}
|
|
118
113
|
}
|
|
119
114
|
}
|
|
120
115
|
},
|
|
121
|
-
"lineage": "
|
|
116
|
+
"lineage": "1dd5e229-5a81-4989-87b8-3c6e8dbcc707",
|
|
122
117
|
"serial": 4
|
|
123
118
|
}
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
]
|
|
112
112
|
}
|
|
113
113
|
],
|
|
114
|
-
"lastUpdated": "2026-
|
|
114
|
+
"lastUpdated": "2026-10-24T09:46:58.661Z",
|
|
115
115
|
"status": "ready"
|
|
116
116
|
},
|
|
117
117
|
"events.gateway_event": {
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"stageName": "RELEASE"
|
|
187
187
|
}
|
|
188
188
|
],
|
|
189
|
-
"lastUpdated": "2026-
|
|
189
|
+
"lastUpdated": "2026-10-24T09:46:58.666Z"
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
192
|
"shared": {
|
|
@@ -205,11 +205,11 @@
|
|
|
205
205
|
"id": "insight-poc-deploy-app-dev-sls"
|
|
206
206
|
}
|
|
207
207
|
],
|
|
208
|
-
"lastUpdated": "2026-
|
|
208
|
+
"lastUpdated": "2026-10-24T09:46:53.659Z"
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
|
-
"lineage": "
|
|
213
|
+
"lineage": "0325f40e-8920-407d-8276-90e594078696",
|
|
214
214
|
"serial": 2
|
|
215
215
|
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "3.0",
|
|
3
|
+
"provider": "aliyun",
|
|
4
|
+
"app": "insight-poc-timer-app",
|
|
5
|
+
"service": "insight-poc-timer",
|
|
6
|
+
"stages": {
|
|
7
|
+
"dev": {
|
|
8
|
+
"resources": {
|
|
9
|
+
"functions.insight_poc_fn": {
|
|
10
|
+
"mode": "managed",
|
|
11
|
+
"region": "cn-hangzhou",
|
|
12
|
+
"definition": {
|
|
13
|
+
"functionName": "insight-poc-timer-fn",
|
|
14
|
+
"runtime": "nodejs18",
|
|
15
|
+
"handler": "index.handler",
|
|
16
|
+
"memorySize": 512,
|
|
17
|
+
"timeout": 10,
|
|
18
|
+
"diskSize": null,
|
|
19
|
+
"environment": {},
|
|
20
|
+
"vpcConfig": null,
|
|
21
|
+
"gpuConfig": null,
|
|
22
|
+
"customContainerConfig": null,
|
|
23
|
+
"nasConfig": null,
|
|
24
|
+
"logConfig": {
|
|
25
|
+
"enableRequestMetrics": false,
|
|
26
|
+
"enableInstanceMetrics": false
|
|
27
|
+
},
|
|
28
|
+
"codeHash": "c96b718fa999add5e047823c3d7abfa1397fa8d0075bc6a4f3592785fcd4b76f",
|
|
29
|
+
"timers": [
|
|
30
|
+
{
|
|
31
|
+
"name": "billing-run",
|
|
32
|
+
"cron": "0 23 3 * * *",
|
|
33
|
+
"payload": "{\"job\":\"billing-run\"}",
|
|
34
|
+
"enable": true,
|
|
35
|
+
"description": "daily billing run"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "report-hourly",
|
|
39
|
+
"cron": "@every 1h",
|
|
40
|
+
"enable": false
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"instances": [
|
|
45
|
+
{
|
|
46
|
+
"type": "ALIYUN_FC3_FUNCTION",
|
|
47
|
+
"sid": "si:aliyun:fc3:dev:insight-poc-timer-fn",
|
|
48
|
+
"id": "insight-poc-timer-fn",
|
|
49
|
+
"functionName": "insight-poc-timer-fn",
|
|
50
|
+
"functionArn": null,
|
|
51
|
+
"functionId": null,
|
|
52
|
+
"runtime": "nodejs18",
|
|
53
|
+
"handler": "index.handler",
|
|
54
|
+
"memorySize": 512,
|
|
55
|
+
"timeout": 10,
|
|
56
|
+
"diskSize": null,
|
|
57
|
+
"cpu": null,
|
|
58
|
+
"environment": {},
|
|
59
|
+
"vpcConfig": {},
|
|
60
|
+
"gpuConfig": {},
|
|
61
|
+
"nasConfig": {},
|
|
62
|
+
"logConfig": {
|
|
63
|
+
"project": null,
|
|
64
|
+
"logstore": null,
|
|
65
|
+
"enableRequestMetrics": false,
|
|
66
|
+
"enableInstanceMetrics": false,
|
|
67
|
+
"logBeginRule": null
|
|
68
|
+
},
|
|
69
|
+
"customContainerConfig": {},
|
|
70
|
+
"description": null,
|
|
71
|
+
"internetAccess": null,
|
|
72
|
+
"role": "acs:ram::123456789012:role/insight-poc-timer-app-insight-poc-timer-dev-insight-poc-fn-role",
|
|
73
|
+
"codeChecksum": null,
|
|
74
|
+
"codeSize": null,
|
|
75
|
+
"createdTime": null,
|
|
76
|
+
"lastModifiedTime": null,
|
|
77
|
+
"state": "Running",
|
|
78
|
+
"stateReason": null,
|
|
79
|
+
"stateReasonCode": null,
|
|
80
|
+
"lastUpdateStatus": null,
|
|
81
|
+
"lastUpdateStatusReason": null,
|
|
82
|
+
"lastUpdateStatusReasonCode": null,
|
|
83
|
+
"tags": [
|
|
84
|
+
{
|
|
85
|
+
"key": null,
|
|
86
|
+
"value": null
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"type": "ALIYUN_FC3_TIMER_TRIGGER",
|
|
92
|
+
"id": "billing-run",
|
|
93
|
+
"sid": "si:aliyun:fc3-timer-trigger:dev:insight-poc-timer-fn.billing-run",
|
|
94
|
+
"attributes": {
|
|
95
|
+
"cron": "0 23 3 * * *",
|
|
96
|
+
"payload": "{\"job\":\"billing-run\"}",
|
|
97
|
+
"enable": true,
|
|
98
|
+
"description": "daily billing run"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"type": "ALIYUN_FC3_TIMER_TRIGGER",
|
|
103
|
+
"id": "report-hourly",
|
|
104
|
+
"sid": "si:aliyun:fc3-timer-trigger:dev:insight-poc-timer-fn.report-hourly",
|
|
105
|
+
"attributes": {
|
|
106
|
+
"cron": "@every 1h",
|
|
107
|
+
"enable": false
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"sid": "si:aliyun:ram_role:dev:insight-poc-timer-app-insight-poc-timer-dev-insight-poc-fn-role",
|
|
112
|
+
"id": "insight-poc-timer-app-insight-poc-timer-dev-insight-poc-fn-role",
|
|
113
|
+
"type": "ALIYUN_RAM_ROLE",
|
|
114
|
+
"roleArn": "acs:ram::123456789012:role/insight-poc-timer-app-insight-poc-timer-dev-insight-poc-fn-role",
|
|
115
|
+
"roleName": "insight-poc-timer-app-insight-poc-timer-dev-insight-poc-fn-role",
|
|
116
|
+
"roleId": "role-123",
|
|
117
|
+
"arn": "acs:ram::123456789012:role/insight-poc-timer-app-insight-poc-timer-dev-insight-poc-fn-role",
|
|
118
|
+
"policyName": "insight-poc-timer-app-insight-poc-timer-dev-insight-poc-fn-role-policy",
|
|
119
|
+
"trustedServices": [
|
|
120
|
+
"fc.aliyuncs.com"
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"lastUpdated": "2026-10-24T09:45:13.165Z"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"shared": {}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"lineage": "b56a895e-0206-4c8b-8ea0-e5bdeae3d1f9",
|
|
131
|
+
"serial": 3
|
|
132
|
+
}
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"serverSideEncryptionConfiguration": null
|
|
45
45
|
}
|
|
46
46
|
],
|
|
47
|
-
"lastUpdated": "2026-
|
|
47
|
+
"lastUpdated": "2026-10-24T09:47:19.214Z"
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"shared": {}
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
"lineage": "
|
|
53
|
+
"lineage": "b0e4b648-ee9e-4e33-80f6-e40aa2370837",
|
|
54
54
|
"serial": 4
|
|
55
55
|
}
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
],
|
|
65
65
|
"status": "ready",
|
|
66
|
-
"lastUpdated": "2026-
|
|
66
|
+
"lastUpdated": "2026-10-24T09:42:25.796Z"
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"shared": {
|
|
@@ -83,11 +83,11 @@
|
|
|
83
83
|
"projectId": "proj-123"
|
|
84
84
|
}
|
|
85
85
|
],
|
|
86
|
-
"lastUpdated": "2026-
|
|
86
|
+
"lastUpdated": "2026-10-24T09:42:22.534Z"
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
|
-
"lineage": "
|
|
91
|
+
"lineage": "f3480143-7aa8-4e0f-b167-376825dd84ce",
|
|
92
92
|
"serial": 5
|
|
93
93
|
}
|
|
@@ -36,7 +36,16 @@
|
|
|
36
36
|
}
|
|
37
37
|
]
|
|
38
38
|
},
|
|
39
|
-
"
|
|
39
|
+
"nasStorage": [
|
|
40
|
+
{
|
|
41
|
+
"mount_path": "/mnt/data",
|
|
42
|
+
"storage_class": "STANDARD_PERFORMANCE"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"logConfig": {
|
|
46
|
+
"enableRequestMetrics": false,
|
|
47
|
+
"enableInstanceMetrics": false
|
|
48
|
+
},
|
|
40
49
|
"codeHash": "c96b718fa999add5e047823c3d7abfa1397fa8d0075bc6a4f3592785fcd4b76f"
|
|
41
50
|
},
|
|
42
51
|
"instances": [
|
|
@@ -73,7 +82,13 @@
|
|
|
73
82
|
}
|
|
74
83
|
]
|
|
75
84
|
},
|
|
76
|
-
"logConfig": {
|
|
85
|
+
"logConfig": {
|
|
86
|
+
"project": null,
|
|
87
|
+
"logstore": null,
|
|
88
|
+
"enableRequestMetrics": false,
|
|
89
|
+
"enableInstanceMetrics": false,
|
|
90
|
+
"logBeginRule": null
|
|
91
|
+
},
|
|
77
92
|
"customContainerConfig": {},
|
|
78
93
|
"description": null,
|
|
79
94
|
"internetAccess": null,
|
|
@@ -137,12 +152,12 @@
|
|
|
137
152
|
"accessGroupName": "nested-drift-fn-dev-nas-access-mnt-data"
|
|
138
153
|
}
|
|
139
154
|
],
|
|
140
|
-
"lastUpdated": "2026-
|
|
155
|
+
"lastUpdated": "2026-10-24T09:42:22.394Z"
|
|
141
156
|
}
|
|
142
157
|
},
|
|
143
158
|
"shared": {}
|
|
144
159
|
}
|
|
145
160
|
},
|
|
146
|
-
"lineage": "
|
|
147
|
-
"serial":
|
|
161
|
+
"lineage": "c1b8f5d7-306e-425d-a452-b650b0436fd0",
|
|
162
|
+
"serial": 4
|
|
148
163
|
}
|
package/.serverlessinsight/state-role-reconcile-test-app-role-reconcile-test-service.json.backup
CHANGED
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
]
|
|
119
119
|
}
|
|
120
120
|
],
|
|
121
|
-
"lastUpdated": "2026-
|
|
121
|
+
"lastUpdated": "2026-10-24T09:45:43.481Z",
|
|
122
122
|
"status": "ready"
|
|
123
123
|
}
|
|
124
124
|
},
|
|
@@ -138,11 +138,11 @@
|
|
|
138
138
|
"id": "role-reconcile-test-app-dev-sls"
|
|
139
139
|
}
|
|
140
140
|
],
|
|
141
|
-
"lastUpdated": "2026-
|
|
141
|
+
"lastUpdated": "2026-10-24T09:45:38.480Z"
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
|
-
"lineage": "
|
|
146
|
+
"lineage": "f512fbf2-43ab-4a0c-8e0b-33d1cbd1c1dd",
|
|
147
147
|
"serial": 2
|
|
148
148
|
}
|
package/AGENTS.md
CHANGED
|
@@ -200,6 +200,16 @@ const policyName = `${roleName}-policy`;
|
|
|
200
200
|
3. **In-place migration**: reuse branches key on instance type — existing deployments keep their recorded role/container and get trust/policy updated in place; new names apply only to newly created resources. Never recreate a role or container just to change its name.
|
|
201
201
|
4. **SIDs are per-provider**: `si:<provider>:<service>:<stage>:<id>` — intentionally NOT unified cross-provider; a SID's lifecycle is bound to its physical resource.
|
|
202
202
|
|
|
203
|
+
## Configuration Defaults and Ownership - MANDATORY
|
|
204
|
+
|
|
205
|
+
- Omission restores the documented si default on both creation and update. Never reuse the previous value of a defaulted field merely because the new YAML omits it.
|
|
206
|
+
- Resolve defaults in shared parsers or effective configuration builders before comparison, execution and state persistence. All providers must use the same field contract; provider-specific defaults must be explicit in their builders.
|
|
207
|
+
- Example: `www_bind_apex` defaults to `false`. Changing `true` to omission removes the owned www binding; changing `false` to omission is unchanged. This applies to bucket and event domains, including legacy forms.
|
|
208
|
+
- Defaults include function logging `false`, event-domain protocol `HTTP`, timer enablement `true`, website index `index.html`, and enabled CDN type/scope `web`/`global`. Function memory and timeout defaults are provider-specific and live in the effective builders.
|
|
209
|
+
- Removing an owned optional configuration block removes its recorded dependents. Persist provider-assigned identities immediately so update, retry and destroy can reconcile the exact resources si owns. Do not claim ownership of unrelated resources found during reads.
|
|
210
|
+
- A field with no si default may remain unmanaged when omitted only when its contract explicitly says so. Do not confuse YAML omission with an unavailable cloud field: failed reads propagate, confirmed absence is `null`, and unavailable dimensions are `undefined`.
|
|
211
|
+
- For each defaulted field, test non-default to omission, default to omission, execution and saved-state convergence. Reject a reset the provider cannot apply instead of saving unapplied defaults.
|
|
212
|
+
|
|
203
213
|
## Code Style
|
|
204
214
|
|
|
205
215
|
### TypeScript
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.9.3] - 2026-10-24
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `si local` now invokes veFaaS functions with a veFaaS-native HTTP event and fires
|
|
15
|
+
`triggers.timer` schedules locally with the documented CloudEvents timer envelope,
|
|
16
|
+
so veFaaS HTTP- and timer-driven handlers can be debugged without deploying
|
|
17
|
+
([#268](https://github.com/geek-fun/serverlessinsight/issues/268),
|
|
18
|
+
[#261](https://github.com/geek-fun/serverlessinsight/issues/261)).
|
|
19
|
+
- `si local` runs Tencent SCF functions with an SCF-native invocation context and
|
|
20
|
+
simulates the HTTP trigger contract si deploys (function URL delivering an
|
|
21
|
+
API-Gateway-compatible event), instead of falling back to a generic non-Aliyun
|
|
22
|
+
shape; unsupported contracts are reported clearly rather than silently substituted
|
|
23
|
+
([#267](https://github.com/geek-fun/serverlessinsight/issues/267)).
|
|
24
|
+
- Plans now enforce lifecycle ownership for what si created: removing a bucket `iam`
|
|
25
|
+
policy, a bucket domain, a function HTTP trigger or custom domain, or
|
|
26
|
+
`triggers.timer` from the YAML deletes the corresponding cloud resources (and their
|
|
27
|
+
recorded dependents) on the next deploy instead of silently retaining them, and the
|
|
28
|
+
removals show up in the plan before/after
|
|
29
|
+
([#264](https://github.com/geek-fun/serverlessinsight/issues/264)).
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- `si plan` and `si diff` now work for Volcengine stacks.
|
|
34
|
+
- Deployment diffs now reflect changes made to managed resources directly in the
|
|
35
|
+
cloud, restore documented defaults on update, and repair drifted dependents
|
|
36
|
+
([#264](https://github.com/geek-fun/serverlessinsight/issues/264)).
|
|
37
|
+
- veFaaS functions with `logEnabled` or HTTP/domain triggers no longer crash during
|
|
38
|
+
planning.
|
|
39
|
+
- Bucket planning no longer fails when the account lacks permission to read ACL or
|
|
40
|
+
CORS settings: those optional sub-config values are treated as absent, while
|
|
41
|
+
identity and existence checks remain strict.
|
|
42
|
+
- `si local` no longer fails on non-JSON response metadata in function logs.
|
|
43
|
+
|
|
44
|
+
## [0.9.2] - 2026-10-05
|
|
45
|
+
|
|
10
46
|
### ⚠️ Breaking change
|
|
11
47
|
|
|
12
48
|
- **Generated API Gateway resource names are now collision-safe.** Aliyun apiNames
|
|
@@ -34,6 +70,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
34
70
|
|
|
35
71
|
### Added
|
|
36
72
|
|
|
73
|
+
- Schedule functions with `functions.*.triggers.timer`: a provider-agnostic si-cron
|
|
74
|
+
expression (5-field, 6-field with seconds, or `@every <duration>`, interpreted in
|
|
75
|
+
UTC) is translated to each provider's cron dialect (Aliyun FC3, Tencent SCF,
|
|
76
|
+
Volcengine veFaaS), validated before deploy — including per-provider capability
|
|
77
|
+
limits (Tencent allows at most 10 timers per function) — registered by trigger
|
|
78
|
+
name in state, and drift-checked so console-side edits or deletions are detected
|
|
79
|
+
and repaired on the next deploy
|
|
80
|
+
([#259](https://github.com/geek-fun/serverlessinsight/pull/259)).
|
|
81
|
+
- `si local` now fires `triggers.timer` schedules locally and invokes your handler
|
|
82
|
+
with the provider's timer event shape, so timer-driven code can be debugged
|
|
83
|
+
without deploying
|
|
84
|
+
([#259](https://github.com/geek-fun/serverlessinsight/pull/259)).
|
|
85
|
+
- Agent- and script-friendly CLI foundation: `--json` outputs, exported JSON Schema,
|
|
86
|
+
and documented exit/error code conventions
|
|
87
|
+
([#256](https://github.com/geek-fun/serverlessinsight/pull/256)).
|
|
37
88
|
- Huawei Cloud FunctionGraph is now first-class in runtime compatibility checks:
|
|
38
89
|
standard runtime ids map to the officially supported FunctionGraph runtimes
|
|
39
90
|
(Node.js 10–20, Python 3.6/3.9/3.10/3.12, Java 8/11/17/21, Go 1.x, .NET Core 3.1),
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
+
<img src="docs/brand/brand.jpg" alt="ServerlessInsight" width="420" />
|
|
4
|
+
|
|
3
5
|
# ServerlessInsight
|
|
4
6
|
|
|
5
7
|
**Full life cycle cross-provider serverless management — describe your app, we handle the rest.**
|
|
@@ -95,11 +97,74 @@ si deploy -f serverless.yml -s prod
|
|
|
95
97
|
si destroy -f serverless.yml
|
|
96
98
|
```
|
|
97
99
|
|
|
100
|
+
### Standalone planning
|
|
101
|
+
|
|
102
|
+
`si plan` and its alias `si diff` preview changes on Alibaba Cloud, Tencent Cloud,
|
|
103
|
+
and Volcengine. Volcengine plans include functions, TOS buckets, and API Gateway
|
|
104
|
+
resources in dependency order. Planning reads the configured state backend and
|
|
105
|
+
cloud resources without applying changes or saving state.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
si plan -f serverlessinsight.yml --stage dev
|
|
109
|
+
si diff -f serverlessinsight.yml --stage dev --json
|
|
110
|
+
si plan -f serverlessinsight.yml --stage dev --region cn-beijing -p memory=1024
|
|
111
|
+
si diff -f serverlessinsight.yml --stage dev --no-refresh
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Use `-p, --parameter <key=value>` repeatedly to override configuration variables.
|
|
115
|
+
`--no-refresh` skips live drift checks for tracked resources; ownership probes
|
|
116
|
+
for new resources still run. Credentials and the selected state backend must be
|
|
117
|
+
configured. Read failures exit with an error. Migrated legacy state produces a
|
|
118
|
+
warning and remains unchanged.
|
|
119
|
+
|
|
120
|
+
### Using si with AI agents & scripts
|
|
121
|
+
|
|
122
|
+
The CLI is built to be driven by agents and shell scripts: logs always go to
|
|
123
|
+
**stderr** while result data goes to **stdout**, so piping stdout into `jq`
|
|
124
|
+
always yields a single parseable JSON document.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
si plan --json -f serverless.yml | jq '.summary'
|
|
128
|
+
si validate --json -f serverless.yml | jq '.valid'
|
|
129
|
+
si show --json -f serverless.yml | jq '.resourceCount'
|
|
130
|
+
si schema | jq '.$id' # self-contained draft-07 JSON Schema of the IaC format
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Stable output envelopes** (each carries a version field, so shapes only ever
|
|
134
|
+
change under a new version):
|
|
135
|
+
|
|
136
|
+
- `si plan --json` → `{ planVersion: 1, provider, app, service, stage,
|
|
137
|
+
changes: [{ logicalId, type, action: "create|update|destroy|recreate",
|
|
138
|
+
attributes, drifted?, driftReasons? }], summary: { create, update, destroy,
|
|
139
|
+
recreate, unchanged } }`
|
|
140
|
+
- `si validate --json` → `{ validateVersion: 1, valid, errors: [{ path,
|
|
141
|
+
keyword, message, allowedValues? }] }`
|
|
142
|
+
- `si show --json` → `{ showVersion: 1, provider, app, service, stage,
|
|
143
|
+
stateLocation, backend: "saas|bucket_store|local", locked, lock, resources,
|
|
144
|
+
resourceCount, ... }`
|
|
145
|
+
- failures (in `--json` mode) → `{ error: { code, message } }` on stdout
|
|
146
|
+
|
|
147
|
+
**Exit codes**: `si plan` and `si diff` exit `0` when there are no changes, `2` when
|
|
148
|
+
changes are present (terraform convention), `1` on errors. `si validate`
|
|
149
|
+
exits `0` when valid, `1` when validation fails.
|
|
150
|
+
|
|
151
|
+
**Stable error codes**: error `code`s are the i18n message keys behind the
|
|
152
|
+
translated message (e.g. `RAM_ROLE_NOT_FOUND_IN_CLOUD`) — they are identical
|
|
153
|
+
under every locale, so agents can map codes to self-healing actions regardless
|
|
154
|
+
of `LANG`.
|
|
155
|
+
|
|
156
|
+
**Colors**: ANSI color is disabled when the `NO_COLOR` environment variable is
|
|
157
|
+
set ([no-color.org](https://no-color.org)) or `--no-color` is passed, keeping
|
|
158
|
+
piped output clean in non-TTY environments.
|
|
159
|
+
|
|
98
160
|
### Local Development
|
|
99
161
|
|
|
100
162
|
Run and debug your serverless functions locally without deploying to the cloud.
|
|
101
163
|
|
|
102
164
|
- **LocalStack server** — test functions, buckets, and API endpoints locally
|
|
165
|
+
- **Timer triggers fire locally** — Aliyun, Tencent and Volcengine `functions.*.triggers.timer` schedules run against UTC wall-clock (`@every` from server start) and invoke your handler with the provider's timer event shape
|
|
166
|
+
- **Volcengine HTTP invocation** — veFaaS Node.js events, context and response translation for the [documented local subset](docs/local-development.md), with a [runnable example](samples/volcengine-local/serverlessinsight.yml)
|
|
167
|
+
- **Tencent SCF HTTP invocation** — SCF function-URL events, native context and response translation for `nodejs10`–`nodejs18` packages, with a [runnable example](samples/tencent-local/serverlessinsight.yml)
|
|
103
168
|
- **Bucket file serving** — access local storage files via HTTP for rapid iteration
|
|
104
169
|
- **Same config, different target** — `si local -f serverless.yml -s local` uses your existing config
|
|
105
170
|
|
|
@@ -112,6 +177,41 @@ Configure HTTP endpoints and bind custom domains with automatic DNS verification
|
|
|
112
177
|
- **CDN acceleration** — edge caching and global content delivery for static sites
|
|
113
178
|
- **OSS Transfer Acceleration** — cross-region data transfers through Alibaba backbone
|
|
114
179
|
|
|
180
|
+
### Timer Triggers
|
|
181
|
+
|
|
182
|
+
Schedule functions with a provider-agnostic `si-cron` expression under `functions.*.triggers.timer`:
|
|
183
|
+
|
|
184
|
+
```yaml
|
|
185
|
+
functions:
|
|
186
|
+
my_fn:
|
|
187
|
+
triggers:
|
|
188
|
+
timer:
|
|
189
|
+
- name: billing-run # required — drift detection is name-keyed
|
|
190
|
+
cron: '0 23 3 * * *' # required — si-cron, interpreted in UTC
|
|
191
|
+
payload: '{"job":"billing-run"}' # optional, passed through verbatim
|
|
192
|
+
enable: true # optional, default true
|
|
193
|
+
description: daily billing # optional
|
|
194
|
+
- name: report-hourly
|
|
195
|
+
cron: '@every 1h'
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
`cron` accepts a standard 5-field expression (`minute hour day month weekday`),
|
|
199
|
+
a 6-field expression with a seconds prefix, or `@every <duration>` (`30s`,
|
|
200
|
+
`5m`, `1h`, `1d`, …). si-cron is always **UTC** — the synthesis layer
|
|
201
|
+
translates it into each provider's dialect (Aliyun FC3 6-field, Tencent SCF
|
|
202
|
+
7-field with year, Volcengine veFaaS 5-field crontab) including the UTC+8
|
|
203
|
+
field shift, so the same YAML fires at the same instant everywhere. Invalid
|
|
204
|
+
expressions and provider capability limits (Tencent SCF allows at most 10
|
|
205
|
+
timers per function) fail at `si validate`, before any deploy.
|
|
206
|
+
|
|
207
|
+
**`functions.*.triggers` vs top-level `events`**: `triggers` (http, timer)
|
|
208
|
+
are things that *invoke this function* — they are function-owned, die with
|
|
209
|
+
the function, and have no independent configuration surface. Top-level
|
|
210
|
+
`events` (e.g. `API_GATEWAY`) are infrastructure resources with their own
|
|
211
|
+
config face — custom domains, certificates, route tables — that keep living
|
|
212
|
+
when a backend function is removed. Rule of thumb: independent
|
|
213
|
+
configuration surface → `events`; pure scheduling/event binding → `triggers`.
|
|
214
|
+
|
|
115
215
|
### Resource Management
|
|
116
216
|
|
|
117
217
|
Beyond functions — manage the full serverless stack including storage, databases, and more.
|
|
@@ -209,12 +309,10 @@ More in the [samples](./samples) directory.
|
|
|
209
309
|
## Community
|
|
210
310
|
|
|
211
311
|
<p align="center">
|
|
212
|
-
<img src="
|
|
312
|
+
<img src="docs/images/wechat_official.png" width="300" alt="WeChat Official Account">
|
|
213
313
|
</p>
|
|
214
314
|
|
|
215
315
|
<p align="center">
|
|
216
|
-
<a href="https://discord.gg/5NSUyPK2E"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white" alt="Discord" /></a>
|
|
217
|
-
|
|
218
316
|
<a href="https://x.com/geekfun_club"><img src="https://img.shields.io/badge/X-Follow-000000?logo=x&logoColor=white" alt="X / Twitter" /></a>
|
|
219
317
|
|
|
220
318
|
<a href="https://www.youtube.com/@geekfun-club"><img src="https://img.shields.io/badge/YouTube-Subscribe-FF0000?logo=youtube&logoColor=white" alt="YouTube" /></a>
|
|
@@ -229,19 +327,11 @@ Contributions welcome! Open an issue or pull request. See the [AGENTS.md](AGENTS
|
|
|
229
327
|
## Sponsor
|
|
230
328
|
|
|
231
329
|
<p align="center">
|
|
330
|
+
<img src="docs/images/wechat_ponsor.jpg" width="140" alt="WeChat Sponsor QR">
|
|
331
|
+
|
|
232
332
|
<a href="https://github.com/sponsors/geek-fun"><img src="https://img.shields.io/badge/GitHub_Sponsors-%E2%9D%A4_Support-EA4AAA?logo=githubsponsors&logoColor=white" alt="GitHub Sponsors" /></a>
|
|
233
333
|
</p>
|
|
234
334
|
|
|
235
|
-
## Star History
|
|
236
|
-
|
|
237
|
-
<a href="https://www.star-history.com/?repos=geek-fun/serverlessinsight&type=date">
|
|
238
|
-
<picture>
|
|
239
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=geek-fun/serverlessinsight&type=date&theme=dark" />
|
|
240
|
-
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=geek-fun/serverlessinsight&type=date" />
|
|
241
|
-
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=geek-fun/serverlessinsight&type=date" />
|
|
242
|
-
</picture>
|
|
243
|
-
</a>
|
|
244
|
-
|
|
245
335
|
## License
|
|
246
336
|
|
|
247
337
|
[Apache 2.0](LICENSE) © GEEKFUN
|