@geek-fun/serverlessinsight 0.8.6 → 0.8.8

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.
Files changed (76) hide show
  1. package/.serverlessinsight/state-cdn-flow-app-cdn-flow-service.json.backup +1 -1
  2. package/.serverlessinsight/state-iam-test-app-iam-test-service.json.backup +2 -2
  3. package/.serverlessinsight/state-insight-poc-app-insight-poc-tencent.json.backup +94 -0
  4. package/.serverlessinsight/state-insight-poc-deploy-app-insight-poc-deploy.json.backup +47 -27
  5. package/.serverlessinsight/state-insight-poc-destroy-app-insight-poc-destroy.json.backup +1 -1
  6. package/.serverlessinsight/state-insight-volc-app-insight-volc.json.backup +35 -73
  7. package/.serverlessinsight/state-role-reconcile-test-app-role-reconcile-test-service.json.backup +148 -0
  8. package/AGENTS.md +29 -0
  9. package/dist/package.json +1 -1
  10. package/dist/src/commands/deploy.js +1 -0
  11. package/dist/src/commands/index.js +6 -2
  12. package/dist/src/commands/plan.js +1 -0
  13. package/dist/src/common/aliyunClient/ecsOperations.js +70 -1
  14. package/dist/src/common/aliyunClient/nasOperations.js +21 -0
  15. package/dist/src/common/aliyunClient/ramOperations.js +116 -15
  16. package/dist/src/common/aliyunClient/slsOperations.js +16 -3
  17. package/dist/src/common/concurrency.js +30 -0
  18. package/dist/src/common/context.js +3 -0
  19. package/dist/src/common/dependencyGraph/graph.js +5 -0
  20. package/dist/src/common/iacHelper.js +3 -1
  21. package/dist/src/common/iamStatements.js +21 -1
  22. package/dist/src/common/index.js +5 -0
  23. package/dist/src/common/nameBuilder.js +12 -1
  24. package/dist/src/common/planCompare.js +62 -0
  25. package/dist/src/common/planFormatter.js +15 -3
  26. package/dist/src/common/refreshCache.js +32 -0
  27. package/dist/src/common/refreshPlanner.js +105 -0
  28. package/dist/src/common/tencentClient/camOperations.js +24 -12
  29. package/dist/src/common/tencentClient/clsOperations.js +27 -3
  30. package/dist/src/common/tencentClient/tdsqlcOperations.js +22 -0
  31. package/dist/src/common/throttleRetry.js +56 -0
  32. package/dist/src/common/volcengineClient/iamOperations.js +15 -11
  33. package/dist/src/common/volcengineClient/tlsOperations.js +12 -4
  34. package/dist/src/lang/en.js +23 -0
  35. package/dist/src/lang/zh-CN.js +22 -0
  36. package/dist/src/stack/aliyunStack/apigwExecutor.js +5 -5
  37. package/dist/src/stack/aliyunStack/apigwPlanner.js +75 -7
  38. package/dist/src/stack/aliyunStack/apigwResource.js +10 -8
  39. package/dist/src/stack/aliyunStack/apigwTypes.js +86 -5
  40. package/dist/src/stack/aliyunStack/databasePlanner.js +26 -62
  41. package/dist/src/stack/aliyunStack/deployer.js +33 -3
  42. package/dist/src/stack/aliyunStack/esServerlessTypes.js +50 -1
  43. package/dist/src/stack/aliyunStack/fc3Executor.js +5 -3
  44. package/dist/src/stack/aliyunStack/fc3Planner.js +299 -12
  45. package/dist/src/stack/aliyunStack/fc3Resource.js +358 -34
  46. package/dist/src/stack/aliyunStack/fc3Types.js +61 -1
  47. package/dist/src/stack/aliyunStack/ossPlanner.js +21 -63
  48. package/dist/src/stack/aliyunStack/ossTypes.js +25 -1
  49. package/dist/src/stack/aliyunStack/rdsTypes.js +38 -1
  50. package/dist/src/stack/aliyunStack/sharedLogProject.js +22 -5
  51. package/dist/src/stack/aliyunStack/tablestorePlanner.js +20 -74
  52. package/dist/src/stack/aliyunStack/tablestoreTypes.js +33 -1
  53. package/dist/src/stack/scfStack/cosPlanner.js +30 -50
  54. package/dist/src/stack/scfStack/cosTypes.js +29 -1
  55. package/dist/src/stack/scfStack/esServerlessPlanner.js +21 -54
  56. package/dist/src/stack/scfStack/esServerlessTypes.js +13 -1
  57. package/dist/src/stack/scfStack/scfExecutor.js +5 -3
  58. package/dist/src/stack/scfStack/scfPlanner.js +72 -51
  59. package/dist/src/stack/scfStack/scfResource.js +109 -12
  60. package/dist/src/stack/scfStack/scfTypes.js +35 -1
  61. package/dist/src/stack/scfStack/sharedLogset.js +12 -3
  62. package/dist/src/stack/scfStack/tdsqlcPlanner.js +37 -55
  63. package/dist/src/stack/scfStack/tdsqlcTypes.js +21 -1
  64. package/dist/src/stack/volcengineStack/apigwPlanner.js +59 -8
  65. package/dist/src/stack/volcengineStack/apigwResource.js +52 -30
  66. package/dist/src/stack/volcengineStack/apigwTypes.js +44 -8
  67. package/dist/src/stack/volcengineStack/sharedLogProject.js +9 -3
  68. package/dist/src/stack/volcengineStack/tosPlanner.js +28 -55
  69. package/dist/src/stack/volcengineStack/tosTypes.js +18 -1
  70. package/dist/src/stack/volcengineStack/vefaasExecutor.js +5 -3
  71. package/dist/src/stack/volcengineStack/vefaasPlanner.js +119 -10
  72. package/dist/src/stack/volcengineStack/vefaasResource.js +112 -13
  73. package/dist/src/stack/volcengineStack/vefaasTypes.js +61 -7
  74. package/dist/src/validator/semanticValidation.js +41 -0
  75. package/dist/tsconfig.tsbuildinfo +1 -1
  76. package/package.json +1 -1
@@ -9,6 +9,6 @@
9
9
  "shared": {}
10
10
  }
11
11
  },
12
- "lineage": "b2e9ef02-2d5d-4779-9c83-748e2bf1b564",
12
+ "lineage": "d5940979-1d8f-4022-880f-8e15c4c67047",
13
13
  "serial": 5
14
14
  }
@@ -22,11 +22,11 @@
22
22
  "id": "iam-test-app-dev-sls"
23
23
  }
24
24
  ],
25
- "lastUpdated": "2026-08-28T07:04:25.346Z"
25
+ "lastUpdated": "2026-09-08T17:59:35.725Z"
26
26
  }
27
27
  }
28
28
  }
29
29
  },
30
- "lineage": "2333d026-48b6-46bc-b806-5bcb2271a666",
30
+ "lineage": "56188f6c-281d-4a4e-985b-9b7e4dab161b",
31
31
  "serial": 3
32
32
  }
@@ -0,0 +1,94 @@
1
+ {
2
+ "version": "3.0",
3
+ "provider": "tencent",
4
+ "app": "insight-poc-app",
5
+ "service": "insight-poc-tencent",
6
+ "stages": {
7
+ "default": {
8
+ "resources": {
9
+ "functions.test_fn": {
10
+ "mode": "managed",
11
+ "region": "ap-guangzhou",
12
+ "definition": {
13
+ "functionName": "test-fn",
14
+ "runtime": "Nodejs18.15",
15
+ "handler": "index.handler",
16
+ "memorySize": 512,
17
+ "timeout": 10,
18
+ "environment": {},
19
+ "codeHash": "c96b718fa999add5e047823c3d7abfa1397fa8d0075bc6a4f3592785fcd4b76f",
20
+ "vpcConfig": null,
21
+ "diskSize": null,
22
+ "cfsConfig": null,
23
+ "useGpu": null,
24
+ "imageConfig": null
25
+ },
26
+ "instances": [
27
+ {
28
+ "sid": "si:tencent:scf:default:test-fn",
29
+ "id": "test-fn",
30
+ "functionName": "test-fn",
31
+ "runtime": "Nodejs18.15",
32
+ "handler": "index.handler",
33
+ "memorySize": 256,
34
+ "timeout": 10,
35
+ "environment": {},
36
+ "modTime": null,
37
+ "codeSha256": null,
38
+ "codeInfo": null,
39
+ "description": null,
40
+ "triggers": [],
41
+ "codeSize": null,
42
+ "functionVersion": null,
43
+ "vpcConfig": {},
44
+ "useGpu": null,
45
+ "codeResult": null,
46
+ "codeError": null,
47
+ "errNo": null,
48
+ "namespace": null,
49
+ "role": null,
50
+ "installDependency": null,
51
+ "status": "Active",
52
+ "statusDesc": null,
53
+ "clsLogsetId": null,
54
+ "clsTopicId": null,
55
+ "functionId": null,
56
+ "tags": [],
57
+ "eipConfig": {},
58
+ "accessInfo": {},
59
+ "type": null,
60
+ "l5Enable": null,
61
+ "layers": [],
62
+ "deadLetterConfig": {},
63
+ "addTime": null,
64
+ "publicNetConfig": {},
65
+ "onsEnable": null,
66
+ "cfsConfig": {},
67
+ "availableStatus": null,
68
+ "qualifier": null,
69
+ "initTimeout": null,
70
+ "statusReasons": [],
71
+ "asyncRunEnable": null,
72
+ "traceEnable": null,
73
+ "imageConfig": {},
74
+ "protocolType": null,
75
+ "protocolParams": {},
76
+ "dnsCache": null,
77
+ "intranetConfig": {},
78
+ "instanceConcurrencyConfig": {}
79
+ },
80
+ {
81
+ "sid": "si:tencent:scf:default:test-fn",
82
+ "type": null,
83
+ "id": "test-fn"
84
+ }
85
+ ],
86
+ "lastUpdated": "2026-09-08T18:00:08.516Z"
87
+ }
88
+ },
89
+ "shared": {}
90
+ }
91
+ },
92
+ "lineage": "a4eafdb5-e34b-448c-a277-0e1527c9b410",
93
+ "serial": 4
94
+ }
@@ -27,7 +27,7 @@
27
27
  "nasConfig": null,
28
28
  "logConfig": {
29
29
  "project": "insight-poc-deploy-app-dev-sls",
30
- "logstore": "insight-poc-deploy-dev-fn-logs",
30
+ "logstore": "insight-poc-deploy-dev-insight-poc-fn-fn-logs",
31
31
  "enableRequestMetrics": true,
32
32
  "enableInstanceMetrics": true
33
33
  },
@@ -37,25 +37,35 @@
37
37
  {
38
38
  "type": "ALIYUN_FC3_FUNCTION",
39
39
  "sid": "si:aliyun:fc3:dev:insight-poc-fn",
40
- "id": "test-function",
41
- "functionName": "test-function",
40
+ "id": "insight-poc-fn",
41
+ "functionName": "insight-poc-fn",
42
42
  "functionArn": null,
43
43
  "functionId": null,
44
44
  "runtime": "nodejs18",
45
45
  "handler": "index.handler",
46
- "memorySize": 128,
47
- "timeout": 60,
46
+ "memorySize": 512,
47
+ "timeout": 10,
48
48
  "diskSize": null,
49
49
  "cpu": null,
50
- "environment": {},
50
+ "environment": {
51
+ "NODE_ENV": "development",
52
+ "TEST_VAR": "testVarValue",
53
+ "TEST_VAR_EXTRA": "abcds-testVarValue-andyou"
54
+ },
51
55
  "vpcConfig": {},
52
56
  "gpuConfig": {},
53
57
  "nasConfig": {},
54
- "logConfig": {},
58
+ "logConfig": {
59
+ "project": "insight-poc-deploy-app-dev-sls",
60
+ "logstore": "insight-poc-deploy-dev-insight-poc-fn-fn-logs",
61
+ "enableRequestMetrics": true,
62
+ "enableInstanceMetrics": true,
63
+ "logBeginRule": null
64
+ },
55
65
  "customContainerConfig": {},
56
66
  "description": null,
57
67
  "internetAccess": null,
58
- "role": null,
68
+ "role": "acs:ram::123456789012:role/insight-poc-deploy-app-insight-poc-deploy-dev-insig-role-160n4hk",
59
69
  "codeChecksum": null,
60
70
  "codeSize": null,
61
71
  "createdTime": null,
@@ -65,33 +75,43 @@
65
75
  "stateReasonCode": null,
66
76
  "lastUpdateStatus": null,
67
77
  "lastUpdateStatusReason": null,
68
- "lastUpdateStatusReasonCode": null
78
+ "lastUpdateStatusReasonCode": null,
79
+ "tags": [
80
+ {
81
+ "key": null,
82
+ "value": null
83
+ }
84
+ ]
69
85
  },
70
86
  {
71
- "sid": "si:aliyun:sls_logstore:dev:insight-poc-deploy-app-dev-sls/insight-poc-deploy-dev-fn-logs",
72
- "id": "insight-poc-deploy-app-dev-sls/insight-poc-deploy-dev-fn-logs",
87
+ "sid": "si:aliyun:sls_logstore:dev:insight-poc-deploy-app-dev-sls/insight-poc-deploy-dev-insight-poc-fn-fn-logs",
88
+ "id": "insight-poc-deploy-app-dev-sls/insight-poc-deploy-dev-insight-poc-fn-fn-logs",
73
89
  "type": "ALIYUN_SLS_LOGSTORE",
74
- "logstoreName": "insight-poc-deploy-dev-fn-logs"
90
+ "logstoreName": "insight-poc-deploy-dev-insight-poc-fn-fn-logs"
75
91
  },
76
92
  {
77
- "sid": "si:aliyun:sls_index:dev:insight-poc-deploy-app-dev-sls/insight-poc-deploy-dev-fn-logs/index",
78
- "id": "insight-poc-deploy-app-dev-sls/insight-poc-deploy-dev-fn-logs/index",
93
+ "sid": "si:aliyun:sls_index:dev:insight-poc-deploy-app-dev-sls/insight-poc-deploy-dev-insight-poc-fn-fn-logs/index",
94
+ "id": "insight-poc-deploy-app-dev-sls/insight-poc-deploy-dev-insight-poc-fn-fn-logs/index",
79
95
  "type": "ALIYUN_SLS_INDEX",
80
96
  "projectName": "insight-poc-deploy-app-dev-sls",
81
- "logstoreName": "insight-poc-deploy-dev-fn-logs"
97
+ "logstoreName": "insight-poc-deploy-dev-insight-poc-fn-fn-logs"
82
98
  },
83
99
  {
84
- "sid": "si:aliyun:ram_role:dev:insight-poc-deploy-app-insight-poc-deploy-dev-fc-role",
85
- "id": "insight-poc-deploy-app-insight-poc-deploy-dev-fc-role",
100
+ "sid": "si:aliyun:ram_role:dev:insight-poc-deploy-app-insight-poc-deploy-dev-insig-role-160n4hk",
101
+ "id": "insight-poc-deploy-app-insight-poc-deploy-dev-insig-role-160n4hk",
86
102
  "type": "ALIYUN_RAM_ROLE",
87
- "body": {
88
- "Role": {
89
- "RoleName": "test-role"
90
- }
91
- }
103
+ "roleArn": "acs:ram::123456789012:role/insight-poc-deploy-app-insight-poc-deploy-dev-insig-role-160n4hk",
104
+ "roleName": "insight-poc-deploy-app-insight-poc-deploy-dev-insig-role-160n4hk",
105
+ "roleId": "role-123",
106
+ "arn": "acs:ram::123456789012:role/insight-poc-deploy-app-insight-poc-deploy-dev-insig-role-160n4hk",
107
+ "policyName": "insight-poc-deploy-app-insight-poc-deploy-dev-insig-role-160n4hk-policy",
108
+ "trustedServices": [
109
+ "fc.aliyuncs.com",
110
+ "apigateway.aliyuncs.com"
111
+ ]
92
112
  }
93
113
  ],
94
- "lastUpdated": "2026-08-28T07:05:06.430Z",
114
+ "lastUpdated": "2026-09-08T18:00:20.520Z",
95
115
  "status": "ready"
96
116
  },
97
117
  "events.gateway_event": {
@@ -105,7 +125,7 @@
105
125
  {
106
126
  "method": "GET",
107
127
  "path": "/api/hello",
108
- "backend": "${functions.insight_poc_fn}"
128
+ "backend": "insight-poc-fn"
109
129
  }
110
130
  ],
111
131
  "domain": null
@@ -166,7 +186,7 @@
166
186
  "stageName": "RELEASE"
167
187
  }
168
188
  ],
169
- "lastUpdated": "2026-08-28T07:05:06.432Z"
189
+ "lastUpdated": "2026-09-08T18:00:20.522Z"
170
190
  }
171
191
  },
172
192
  "shared": {
@@ -185,11 +205,11 @@
185
205
  "id": "insight-poc-deploy-app-dev-sls"
186
206
  }
187
207
  ],
188
- "lastUpdated": "2026-08-28T07:05:01.428Z"
208
+ "lastUpdated": "2026-09-08T18:00:15.518Z"
189
209
  }
190
210
  }
191
211
  }
192
212
  },
193
- "lineage": "eb2aaf5d-2401-42b0-820e-1059f98fced9",
213
+ "lineage": "1f2dbb20-0ba7-4b2a-8ec8-63e12103d223",
194
214
  "serial": 2
195
215
  }
@@ -9,6 +9,6 @@
9
9
  "shared": {}
10
10
  }
11
11
  },
12
- "lineage": "33a22c7c-a582-4194-971b-0586ae8216ac",
12
+ "lineage": "7bf9db5a-0d05-4f9c-8d85-bad0750b10eb",
13
13
  "serial": 1
14
14
  }
@@ -4,90 +4,52 @@
4
4
  "app": "insight-volc-app",
5
5
  "service": "insight-volc",
6
6
  "stages": {
7
- "dev": {
7
+ "default": {
8
8
  "resources": {
9
- "functions.insight_poc_fn": {
9
+ "buckets.static_site": {
10
10
  "mode": "managed",
11
11
  "region": "cn-beijing",
12
12
  "definition": {
13
- "functionName": "insight-poc-fn",
14
- "runtime": "node20/v1",
15
- "handler": "index.handler",
16
- "memorySize": 128,
17
- "timeout": 30,
18
- "environment": {
19
- "NODE_ENV": "production"
20
- },
21
- "codeHash": "c96b718fa999add5e047823c3d7abfa1397fa8d0075bc6a4f3592785fcd4b76f",
22
- "role": "trn:iam::123456789012:role/test-role",
23
- "logConfig": {
24
- "project": "insight-volc-app-dev-tls",
25
- "topic": "insight-volc-dev-fn-logs"
26
- }
13
+ "bucketName": "insight-volc-static-bucket",
14
+ "acl": "public-read",
15
+ "storageClass": null,
16
+ "websiteConfiguration": null,
17
+ "websiteCodeHash": null,
18
+ "policy": null
27
19
  },
28
20
  "instances": [
29
21
  {
30
- "type": "VOLCENGINE_VEFAAS_FUNCTION",
31
- "sid": "si:volcengine:insight-volc:dev:insight-poc-fn",
32
- "id": "test-function",
33
- "functionName": "test-function",
34
- "functionId": "func-123",
35
- "runtime": "node20/v1",
36
- "handler": "index.handler",
37
- "memorySize": 128,
38
- "timeout": 30,
39
- "environment": {},
40
- "status": "Active",
41
- "createdTime": null,
42
- "lastUpdateTime": null
43
- },
44
- {
45
- "sid": "si:volcengine:tls_topic:dev:insight-volc-app-dev-tls/insight-volc-dev-fn-logs",
46
- "id": "insight-volc-app-dev-tls/insight-volc-dev-fn-logs",
47
- "type": "VOLCENGINE_TLS_TOPIC",
48
- "topicName": "insight-volc-dev-fn-logs",
49
- "topicId": "topic-123"
50
- },
51
- {
52
- "sid": "si:volcengine:tls_index:dev:insight-volc-app-dev-tls/insight-volc-dev-fn-logs/index",
53
- "id": "insight-volc-app-dev-tls/insight-volc-dev-fn-logs/index",
54
- "type": "VOLCENGINE_TLS_INDEX"
55
- },
56
- {
57
- "sid": "si:volcengine:iam_role:dev:insight-volc-app-insight-volc-dev-role",
58
- "id": "insight-volc-app-insight-volc-dev-role",
59
- "type": "VOLCENGINE_IAM_ROLE",
60
- "trn": "trn:iam::123456789012:role/test-role",
61
- "roleName": "test-role",
62
- "roleId": "role-123"
22
+ "type": "VOLCENGINE_TOS_BUCKET",
23
+ "sid": "si:volcengine:tos:default:insight-volc-static-bucket",
24
+ "id": "insight-volc-static-bucket",
25
+ "bucketName": "insight-volc-static-bucket",
26
+ "location": null,
27
+ "creationDate": null,
28
+ "storageClass": null,
29
+ "extranetEndpoint": null,
30
+ "intranetEndpoint": null,
31
+ "acl": "private",
32
+ "websiteConfig": null,
33
+ "Tags": [],
34
+ "owner": null,
35
+ "projectName": null,
36
+ "bucketType": null,
37
+ "azRedundancy": null,
38
+ "extranetS3Endpoint": null,
39
+ "intranetS3Endpoint": null,
40
+ "versioning": null,
41
+ "crossRegionReplication": null,
42
+ "transferAcceleration": null,
43
+ "accessMonitor": null,
44
+ "serverSideEncryptionConfiguration": null
63
45
  }
64
46
  ],
65
- "status": "ready",
66
- "lastUpdated": "2026-08-28T07:04:40.381Z"
47
+ "lastUpdated": "2026-09-08T18:00:27.796Z"
67
48
  }
68
49
  },
69
- "shared": {
70
- "logs.project": {
71
- "mode": "managed",
72
- "region": "cn-beijing",
73
- "definition": {
74
- "projectName": "insight-volc-app-dev-tls",
75
- "region": "cn-beijing",
76
- "stage": "dev"
77
- },
78
- "instances": [
79
- {
80
- "sid": "si:volcengine:tls:dev:insight-volc-app-dev-tls",
81
- "type": "VOLCENGINE_TLS_PROJECT",
82
- "id": "insight-volc-app-dev-tls",
83
- "projectId": "proj-123"
84
- }
85
- ],
86
- "lastUpdated": "2026-08-28T07:04:37.380Z"
87
- }
88
- }
50
+ "shared": {}
89
51
  }
90
52
  },
91
- "lineage": "baa21867-64c2-45c9-9199-9727a751bc7b",
92
- "serial": 1
53
+ "lineage": "3324775c-7bca-4588-84e4-9ae533f28646",
54
+ "serial": 4
93
55
  }
@@ -0,0 +1,148 @@
1
+ {
2
+ "version": "3.0",
3
+ "provider": "aliyun",
4
+ "app": "role-reconcile-test-app",
5
+ "service": "role-reconcile-test-service",
6
+ "stages": {
7
+ "dev": {
8
+ "resources": {
9
+ "functions.role_reconcile_fn": {
10
+ "mode": "managed",
11
+ "region": "cn-hangzhou",
12
+ "definition": {
13
+ "functionName": "role-reconcile-fn",
14
+ "runtime": "nodejs18",
15
+ "handler": "index.handler",
16
+ "memorySize": 128,
17
+ "timeout": 10,
18
+ "diskSize": null,
19
+ "environment": {},
20
+ "vpcConfig": null,
21
+ "gpuConfig": null,
22
+ "customContainerConfig": null,
23
+ "nasConfig": null,
24
+ "logConfig": {
25
+ "project": "role-reconcile-test-app-dev-sls",
26
+ "logstore": "role-reconcile-test-service-dev-role-reconcile-fn-fn-logs",
27
+ "enableRequestMetrics": true,
28
+ "enableInstanceMetrics": true
29
+ },
30
+ "codeHash": "c96b718fa999add5e047823c3d7abfa1397fa8d0075bc6a4f3592785fcd4b76f",
31
+ "iam": {
32
+ "role": {
33
+ "statements": [
34
+ {
35
+ "sid": "OSSRead",
36
+ "effect": "Allow",
37
+ "action": [
38
+ "oss:GetObject"
39
+ ],
40
+ "resource": [
41
+ "acs:oss:*:*:my-bucket/*"
42
+ ]
43
+ }
44
+ ]
45
+ }
46
+ }
47
+ },
48
+ "instances": [
49
+ {
50
+ "type": "ALIYUN_FC3_FUNCTION",
51
+ "sid": "si:aliyun:fc3:dev:role-reconcile-fn",
52
+ "id": "role-reconcile-fn",
53
+ "functionName": "role-reconcile-fn",
54
+ "functionArn": null,
55
+ "functionId": null,
56
+ "runtime": "nodejs18",
57
+ "handler": "index.handler",
58
+ "memorySize": 128,
59
+ "timeout": 10,
60
+ "diskSize": null,
61
+ "cpu": null,
62
+ "environment": {},
63
+ "vpcConfig": {},
64
+ "gpuConfig": {},
65
+ "nasConfig": {},
66
+ "logConfig": {
67
+ "project": "role-reconcile-test-app-dev-sls",
68
+ "logstore": "role-reconcile-test-service-dev-role-reconcile-fn-fn-logs",
69
+ "enableRequestMetrics": true,
70
+ "enableInstanceMetrics": true,
71
+ "logBeginRule": null
72
+ },
73
+ "customContainerConfig": {},
74
+ "description": null,
75
+ "internetAccess": null,
76
+ "role": "acs:ram::123456789012:role/role-reconcile-test-app-role-reconcile-test-service-role-0kzfky0",
77
+ "codeChecksum": null,
78
+ "codeSize": null,
79
+ "createdTime": null,
80
+ "lastModifiedTime": null,
81
+ "state": "Running",
82
+ "stateReason": null,
83
+ "stateReasonCode": null,
84
+ "lastUpdateStatus": null,
85
+ "lastUpdateStatusReason": null,
86
+ "lastUpdateStatusReasonCode": null,
87
+ "tags": [
88
+ {
89
+ "key": null,
90
+ "value": null
91
+ }
92
+ ]
93
+ },
94
+ {
95
+ "sid": "si:aliyun:sls_logstore:dev:role-reconcile-test-app-dev-sls/role-reconcile-test-service-dev-role-reconcile-fn-fn-logs",
96
+ "id": "role-reconcile-test-app-dev-sls/role-reconcile-test-service-dev-role-reconcile-fn-fn-logs",
97
+ "type": "ALIYUN_SLS_LOGSTORE",
98
+ "logstoreName": "role-reconcile-test-service-dev-role-reconcile-fn-fn-logs"
99
+ },
100
+ {
101
+ "sid": "si:aliyun:sls_index:dev:role-reconcile-test-app-dev-sls/role-reconcile-test-service-dev-role-reconcile-fn-fn-logs/index",
102
+ "id": "role-reconcile-test-app-dev-sls/role-reconcile-test-service-dev-role-reconcile-fn-fn-logs/index",
103
+ "type": "ALIYUN_SLS_INDEX",
104
+ "projectName": "role-reconcile-test-app-dev-sls",
105
+ "logstoreName": "role-reconcile-test-service-dev-role-reconcile-fn-fn-logs"
106
+ },
107
+ {
108
+ "sid": "si:aliyun:ram_role:dev:role-reconcile-test-app-role-reconcile-test-service-role-0kzfky0",
109
+ "id": "role-reconcile-test-app-role-reconcile-test-service-role-0kzfky0",
110
+ "type": "ALIYUN_RAM_ROLE",
111
+ "roleArn": "acs:ram::123456789012:role/role-reconcile-test-app-role-reconcile-test-service-role-0kzfky0",
112
+ "roleName": "role-reconcile-test-app-role-reconcile-test-service-role-0kzfky0",
113
+ "roleId": "role-123",
114
+ "arn": "acs:ram::123456789012:role/role-reconcile-test-app-role-reconcile-test-service-role-0kzfky0",
115
+ "policyName": "role-reconcile-test-app-role-reconcile-test-service-role-0kzfky0-policy",
116
+ "trustedServices": [
117
+ "fc.aliyuncs.com"
118
+ ]
119
+ }
120
+ ],
121
+ "lastUpdated": "2026-09-08T17:59:12.175Z",
122
+ "status": "ready"
123
+ }
124
+ },
125
+ "shared": {
126
+ "logs.project": {
127
+ "mode": "managed",
128
+ "region": "cn-hangzhou",
129
+ "definition": {
130
+ "projectName": "role-reconcile-test-app-dev-sls",
131
+ "region": "cn-hangzhou",
132
+ "stage": "dev"
133
+ },
134
+ "instances": [
135
+ {
136
+ "sid": "si:aliyun:sls_project:dev:role-reconcile-test-app-dev-sls",
137
+ "type": "ALIYUN_SLS_PROJECT",
138
+ "id": "role-reconcile-test-app-dev-sls"
139
+ }
140
+ ],
141
+ "lastUpdated": "2026-09-08T17:59:07.174Z"
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "lineage": "899f83f9-c924-4b09-9f3d-06d5d26ce0ad",
147
+ "serial": 2
148
+ }
package/AGENTS.md CHANGED
@@ -171,6 +171,35 @@ import { createRamOperations } from '../../common/aliyunClient/ramOperations';
171
171
  - Keep abstractions provider-agnostic
172
172
  - Clean separation of concerns between providers
173
173
 
174
+ ## Resource Naming (Cross-Platform) - MANDATORY
175
+
176
+ All si-generated cloud resource names MUST come from shared builders — never inline name templates. One name template appearing in more than one place (planner / executor / validator) is a defect: duplicated templates drift.
177
+
178
+ ### Canonical Builders
179
+
180
+ | Resource | Builder (single source of truth) | Shape |
181
+ |---|---|---|
182
+ | Function execution role | `buildFunctionRoleName` (`src/common/nameBuilder.ts`) | `${app}-${service}-${stage}-${fn.key}-role` — identical on every provider |
183
+ | Role execution policy | `buildRolePolicyName` (`src/common/nameBuilder.ts`) | `${roleName}-policy` |
184
+ | Function log topic/logstore | per-provider shared-log module (`buildFunctionLogTopicName` / `buildFunctionLogstoreName`) | `${service}-${stage}-${fn.key}-fn-logs` |
185
+ | Shared log project/logset | `buildSharedProjectName` / `buildSharedLogsetName` | `${app}-${stage}-sls` / `-tls` / `-cls` |
186
+ | Length-limited names | `buildConstrainedName` with the provider's cloud limit | truncate + hash deterministically |
187
+
188
+ ```typescript
189
+ // GOOD
190
+ const policyName = buildRolePolicyName(roleName);
191
+
192
+ // AVOID - duplicated template, drifts from the other call sites
193
+ const policyName = `${roleName}-policy`;
194
+ ```
195
+
196
+ ### Rules
197
+
198
+ 1. **Per-owner teardown**: a log container owned by a function/event includes that owner's key in its name (issue #214), so removing one owner never deletes a container another owner still uses. Provider-level singletons (e.g. the aliyun gateway log config, instance id `${region}:PROVIDER`) are the exception: service-scoped, with deletion guarded by active-reference checks.
199
+ 2. **Stored-first on rename**: when a name derivation changes, executors and planners MUST read the recorded name from state instances first and apply the new derivation only to fresh creates (see `resolveTlsTopicNameFromInstances` in volcengine `apigwResource.ts`). Otherwise existing deployments phantom-drift and orphan containers.
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
+ 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
+
174
203
  ## Code Style
175
204
 
176
205
  ### TypeScript
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geek-fun/serverlessinsight",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
4
4
  "description": "Full life cycle cross providers serverless application management for your fast-growing business.",
5
5
  "homepage": "https://serverlessinsight.com",
6
6
  "main": "dist/src/index.js",
@@ -74,6 +74,7 @@ const deploy = async (options) => {
74
74
  service: rawIac.service,
75
75
  iacProvider: rawIac.provider,
76
76
  stages: rawIac.stages,
77
+ refresh: options.refresh ?? true,
77
78
  }, true);
78
79
  const context = (0, common_1.getContext)();
79
80
  const iac = (0, parser_1.revalYaml)(iacLocation, context);
@@ -126,7 +126,8 @@ program
126
126
  .option('-k, --accessKeyId <accessKeyId>', 'specify the AccessKeyId')
127
127
  .option('-x, --accessKeySecret <accessKeySecret>', 'specify the AccessKeySecret')
128
128
  .option('-n, --securityToken <securityToken>', 'specify the SecurityToken')
129
- .action(actionWrapper('plan', async ({ stage, file, region, provider, accessKeyId, accessKeySecret, securityToken }) => {
129
+ .option('--no-refresh', 'skip live cloud probing; diff config against state only (no drift detection)')
130
+ .action(actionWrapper('plan', async ({ stage, file, region, provider, accessKeyId, accessKeySecret, securityToken, refresh, }) => {
130
131
  await (0, plan_1.plan)({
131
132
  stage,
132
133
  location: file,
@@ -135,6 +136,7 @@ program
135
136
  accessKeyId,
136
137
  accessKeySecret,
137
138
  securityToken,
139
+ refresh,
138
140
  });
139
141
  }));
140
142
  program
@@ -149,12 +151,13 @@ program
149
151
  .option('-n, --securityToken <securityToken>', 'specify the SecurityToken')
150
152
  .option('--si-api-key <key>', 'ServerlessInsight API key (overrides SI_API_KEY env)')
151
153
  .option('-y, --auto-approve', 'skip interactive approval of plan before deploying')
154
+ .option('--no-refresh', 'skip live cloud probing; diff config against state only (no drift detection)')
152
155
  .option('-p, --parameter <key=value>', 'override parameters', (value, previous) => {
153
156
  const [key, val] = value.split('=');
154
157
  previous[key] = val;
155
158
  return previous;
156
159
  }, {})
157
- .action(actionWrapper('deploy', async ({ stage, parameter, file, region, provider, accessKeyId, accessKeySecret, securityToken, siApiKey, autoApprove, }) => {
160
+ .action(actionWrapper('deploy', async ({ stage, parameter, file, region, provider, accessKeyId, accessKeySecret, securityToken, siApiKey, autoApprove, refresh, }) => {
158
161
  await (0, deploy_1.deploy)({
159
162
  stage,
160
163
  parameters: parameter,
@@ -166,6 +169,7 @@ program
166
169
  securityToken,
167
170
  siApiKey,
168
171
  autoApprove,
172
+ refresh,
169
173
  });
170
174
  }));
171
175
  program
@@ -18,6 +18,7 @@ const plan = async (options) => {
18
18
  service: rawIac.service,
19
19
  iacProvider: rawIac.provider,
20
20
  stages: rawIac.stages,
21
+ refresh: options.refresh ?? true,
21
22
  }, true);
22
23
  const context = (0, common_1.getContext)();
23
24
  const iac = (0, parser_1.revalYaml)(iacLocation, context);