@geek-fun/serverlessinsight 0.8.9 → 0.9.1
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 +2 -2
- package/.serverlessinsight/state-insight-poc-app-log-insight-poc-tencent-log.json.backup +123 -0
- 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-volc-app-insight-volc.json.backup +2 -2
- package/.serverlessinsight/state-insight-volc-nested-app-insight-volc-nested.json.backup +93 -0
- package/.serverlessinsight/state-nested-drift-app-nested-drift-service.json.backup +148 -0
- package/.serverlessinsight/state-role-reconcile-test-app-role-reconcile-test-service.json.backup +3 -3
- package/CHANGELOG.md +29 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/dist/package.json +2 -2
- package/dist/src/commands/deploy.js +12 -4
- package/dist/src/commands/destroy.js +8 -2
- package/dist/src/commands/forceUnlock.js +5 -5
- package/dist/src/commands/index.js +114 -53
- package/dist/src/commands/login.js +12 -1
- package/dist/src/commands/migrate.js +287 -0
- package/dist/src/commands/plan.js +7 -1
- package/dist/src/commands/show.js +37 -25
- package/dist/src/common/aliyunClient/apigwOperations.js +4 -4
- package/dist/src/common/aliyunClient/ecsOperations.js +22 -13
- package/dist/src/common/aliyunClient/fc3Operations.js +12 -3
- package/dist/src/common/aliyunClient/nasOperations.js +4 -3
- package/dist/src/common/aliyunClient/ossOperations.js +52 -8
- package/dist/src/common/aliyunClient/slsOperations.js +3 -2
- package/dist/src/common/aliyunClient/tablestoreOperations.js +22 -11
- package/dist/src/common/apiClient.js +22 -5
- package/dist/src/common/context.js +5 -4
- package/dist/src/common/lockManager.js +1 -1
- package/dist/src/common/migrationMarker.js +34 -0
- package/dist/src/common/nameBuilder.js +13 -1
- package/dist/src/common/planCompare.js +31 -1
- package/dist/src/common/planFormatter.js +69 -54
- package/dist/src/common/refreshPlanner.js +31 -8
- package/dist/src/common/runtimeMapper.js +7 -3
- package/dist/src/common/stateBackend/cosStateBackend.js +1 -1
- package/dist/src/common/stateBackend/index.js +5 -2
- package/dist/src/common/stateBackend/localStateBackend.js +8 -2
- package/dist/src/common/stateBackend/ossStateBackend.js +1 -1
- package/dist/src/common/stateBackend/remoteStateBackend.js +19 -2
- package/dist/src/common/stateBackend/saasStateBackend.js +83 -5
- package/dist/src/common/stateManager.js +56 -5
- package/dist/src/common/tencentClient/cosOperations.js +1 -1
- package/dist/src/common/tencentClient/scfOperations.js +2 -1
- package/dist/src/common/volcengineClient/apigwOperations.js +2 -2
- package/dist/src/common/volcengineClient/index.js +6 -2
- package/dist/src/common/volcengineClient/vefaasOperations.js +3 -3
- package/dist/src/lang/en.js +231 -7
- package/dist/src/lang/zh-CN.js +230 -7
- package/dist/src/parser/index.js +1 -1
- package/dist/src/stack/aliyunStack/apigwExecutor.js +2 -2
- package/dist/src/stack/aliyunStack/apigwPlanner.js +26 -5
- package/dist/src/stack/aliyunStack/apigwResource.js +22 -10
- package/dist/src/stack/aliyunStack/databaseExecutor.js +5 -5
- package/dist/src/stack/aliyunStack/databasePlanner.js +8 -3
- package/dist/src/stack/aliyunStack/databaseResource.js +28 -12
- package/dist/src/stack/aliyunStack/deployer.js +30 -13
- package/dist/src/stack/aliyunStack/esServerlessTypes.js +2 -1
- package/dist/src/stack/aliyunStack/fc3Executor.js +2 -2
- package/dist/src/stack/aliyunStack/fc3Planner.js +46 -25
- package/dist/src/stack/aliyunStack/fc3Resource.js +80 -31
- package/dist/src/stack/aliyunStack/ossExecutor.js +2 -2
- package/dist/src/stack/aliyunStack/ossPlanner.js +6 -1
- package/dist/src/stack/aliyunStack/ossResource.js +14 -3
- package/dist/src/stack/aliyunStack/rdsTypes.js +5 -1
- package/dist/src/stack/aliyunStack/tablestoreExecutor.js +2 -2
- package/dist/src/stack/aliyunStack/tablestorePlanner.js +2 -1
- package/dist/src/stack/aliyunStack/tablestoreResource.js +5 -4
- package/dist/src/stack/aliyunStack/tablestoreTypes.js +3 -2
- package/dist/src/stack/deploy.js +12 -7
- package/dist/src/stack/localStack/functionRunner.js +5 -4
- package/dist/src/stack/scfStack/cosExecutor.js +2 -2
- package/dist/src/stack/scfStack/cosPlanner.js +6 -1
- package/dist/src/stack/scfStack/cosResource.js +8 -4
- package/dist/src/stack/scfStack/deployer.js +21 -6
- package/dist/src/stack/scfStack/esServerlessExecutor.js +5 -5
- package/dist/src/stack/scfStack/esServerlessPlanner.js +6 -1
- package/dist/src/stack/scfStack/esServerlessResource.js +12 -4
- package/dist/src/stack/scfStack/esServerlessTypes.js +2 -1
- package/dist/src/stack/scfStack/scfExecutor.js +2 -2
- package/dist/src/stack/scfStack/scfPlanner.js +26 -27
- package/dist/src/stack/scfStack/scfResource.js +38 -13
- package/dist/src/stack/scfStack/tdsqlcExecutor.js +5 -5
- package/dist/src/stack/scfStack/tdsqlcPlanner.js +6 -1
- package/dist/src/stack/scfStack/tdsqlcResource.js +12 -4
- package/dist/src/stack/volcengineStack/apigwExecutor.js +2 -2
- package/dist/src/stack/volcengineStack/apigwPlanner.js +5 -1
- package/dist/src/stack/volcengineStack/apigwResource.js +7 -4
- package/dist/src/stack/volcengineStack/deployer.js +15 -4
- package/dist/src/stack/volcengineStack/tosExecutor.js +2 -2
- package/dist/src/stack/volcengineStack/tosPlanner.js +6 -1
- package/dist/src/stack/volcengineStack/tosResource.js +11 -4
- package/dist/src/stack/volcengineStack/vefaasExecutor.js +2 -2
- package/dist/src/stack/volcengineStack/vefaasPlanner.js +39 -11
- package/dist/src/stack/volcengineStack/vefaasResource.js +11 -3
- package/dist/src/validator/rootSchema.js +29 -2
- package/dist/src/validator/semanticValidation.js +24 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -28,18 +28,33 @@ const handlePartialFailure = (failure) => {
|
|
|
28
28
|
throw error;
|
|
29
29
|
};
|
|
30
30
|
const collectSuccessfulItems = (results) => results.flatMap((result) => result.partialFailure?.successfulItems ?? []);
|
|
31
|
-
|
|
31
|
+
// Issue #246: when the approved plan is passed through, the executor runs
|
|
32
|
+
// exactly the displayed items — partitioned by resourceType, no re-probe.
|
|
33
|
+
const partitionPlan = (plan, types) => ({
|
|
34
|
+
items: plan.items.filter((item) => types.includes(item.resourceType)),
|
|
35
|
+
});
|
|
36
|
+
const deployTencentStack = async (iac, backend, approvedPlan) => {
|
|
32
37
|
const context = (0, common_1.getContext)();
|
|
33
38
|
common_1.logger.info(lang_1.lang.__('DEPLOYING_STACK_PUBLISHING_ASSETS'));
|
|
34
39
|
let state = await backend.loadState(iac.provider.name, iac.app, iac.service, context.stage);
|
|
35
40
|
const onStateChange = createSaveStateFn(backend, iac, context.stage);
|
|
36
41
|
common_1.logger.info(lang_1.lang.__('GENERATING_PLAN'));
|
|
37
|
-
const functionPlan =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
42
|
+
const functionPlan = approvedPlan
|
|
43
|
+
? partitionPlan(approvedPlan, ['SCF'])
|
|
44
|
+
: await (0, scfPlanner_1.generateFunctionPlan)(context, state, iac.functions);
|
|
45
|
+
const bucketPlan = approvedPlan
|
|
46
|
+
? partitionPlan(approvedPlan, ['COS_BUCKET'])
|
|
47
|
+
: await (0, cosPlanner_1.generateBucketPlan)(context, state, iac.buckets);
|
|
48
|
+
const databasePlan = approvedPlan
|
|
49
|
+
? partitionPlan(approvedPlan, ['TDSQL_C_SERVERLESS'])
|
|
50
|
+
: await (0, tdsqlcPlanner_1.generateDatabasePlan)(context, state, iac.databases);
|
|
51
|
+
const esPlan = approvedPlan
|
|
52
|
+
? partitionPlan(approvedPlan, ['TENCENT_ES_SERVERLESS'])
|
|
53
|
+
: await (0, esServerlessPlanner_1.generateEsPlan)(context, state, iac.databases);
|
|
41
54
|
const combinedPlan = {
|
|
42
|
-
items:
|
|
55
|
+
items: approvedPlan
|
|
56
|
+
? [...approvedPlan.items]
|
|
57
|
+
: [...functionPlan.items, ...bucketPlan.items, ...databasePlan.items, ...esPlan.items],
|
|
43
58
|
};
|
|
44
59
|
common_1.logger.info(`${lang_1.lang.__('PLAN_GENERATED')}: ${combinedPlan.items.length} ${lang_1.lang.__('ACTIONS')}`);
|
|
45
60
|
combinedPlan.items.forEach((item) => {
|
|
@@ -48,22 +48,22 @@ const executeSingleItem = async (context, item, databasesMap, currentState) => {
|
|
|
48
48
|
case 'create': {
|
|
49
49
|
const database = databasesMap.get(item.logicalId);
|
|
50
50
|
if (!database) {
|
|
51
|
-
throw new Error(
|
|
51
|
+
throw new Error(lang_1.lang.__('RESOURCE_DATABASE_NOT_FOUND', { logicalId: item.logicalId }));
|
|
52
52
|
}
|
|
53
53
|
return executeCreateAction(context, database, currentState);
|
|
54
54
|
}
|
|
55
55
|
case 'update': {
|
|
56
56
|
const database = databasesMap.get(item.logicalId);
|
|
57
57
|
if (!database) {
|
|
58
|
-
throw new Error(
|
|
58
|
+
throw new Error(lang_1.lang.__('RESOURCE_DATABASE_NOT_FOUND', { logicalId: item.logicalId }));
|
|
59
59
|
}
|
|
60
60
|
const state = (0, stateManager_1.getResource)(currentState, item.logicalId);
|
|
61
61
|
if (!state) {
|
|
62
|
-
throw new Error(
|
|
62
|
+
throw new Error(lang_1.lang.__('EXECUTOR_STATE_NOT_FOUND', { logicalId: item.logicalId }));
|
|
63
63
|
}
|
|
64
64
|
const spaceId = state.metadata?.spaceId || state.instances?.[0]?.id;
|
|
65
65
|
if (!spaceId) {
|
|
66
|
-
throw new Error(
|
|
66
|
+
throw new Error(lang_1.lang.__('RESOURCE_SPACE_ID_NOT_FOUND', { logicalId: item.logicalId }));
|
|
67
67
|
}
|
|
68
68
|
return executeUpdateAction(context, database, spaceId, currentState);
|
|
69
69
|
}
|
|
@@ -75,7 +75,7 @@ const executeSingleItem = async (context, item, databasesMap, currentState) => {
|
|
|
75
75
|
}
|
|
76
76
|
const spaceId = state.metadata?.spaceId || state.instances?.[0]?.id;
|
|
77
77
|
if (!spaceId) {
|
|
78
|
-
throw new Error(
|
|
78
|
+
throw new Error(lang_1.lang.__('RESOURCE_SPACE_ID_NOT_FOUND', { logicalId: item.logicalId }));
|
|
79
79
|
}
|
|
80
80
|
return executeDeleteAction(context, spaceId, item.logicalId, currentState);
|
|
81
81
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateEsPlan = void 0;
|
|
4
|
+
const lang_1 = require("../../lang");
|
|
4
5
|
const tencentClient_1 = require("../../common/tencentClient");
|
|
5
6
|
const refreshCache_1 = require("../../common/refreshCache");
|
|
6
7
|
const concurrency_1 = require("../../common/concurrency");
|
|
@@ -44,7 +45,11 @@ const generateEsPlan = async (context, state, databases) => {
|
|
|
44
45
|
? (0, refreshCache_1.cachedRefreshRead)(context, `es.getSpace:${spaceId}`, () => client.es.getSpace(spaceId))
|
|
45
46
|
: Promise.resolve(null),
|
|
46
47
|
isOwned: (remote) => (0, ownershipTag_1.isOwnedByStack)(context, logicalId, remote.Tags),
|
|
47
|
-
foreignError: () => new Error(
|
|
48
|
+
foreignError: () => new Error(lang_1.lang.__('RESOURCE_EXISTS_NOT_OWNED', {
|
|
49
|
+
resourceType: 'ES space',
|
|
50
|
+
resourceName: config.SpaceName,
|
|
51
|
+
tagKey: ownershipTag_1.OWNERSHIP_TAG_KEY,
|
|
52
|
+
})),
|
|
48
53
|
cloudToDefinition: esServerlessTypes_1.cloudTencentEsToDefinition,
|
|
49
54
|
refresh: context.refresh,
|
|
50
55
|
});
|
|
@@ -97,7 +97,7 @@ const createEsResource = async (context, database, state) => {
|
|
|
97
97
|
// Refresh state from provider to get all attributes
|
|
98
98
|
const spaceInfo = await client.es.getSpace(spaceId);
|
|
99
99
|
if (!spaceInfo) {
|
|
100
|
-
throw new Error(
|
|
100
|
+
throw new Error(lang_1.lang.__('REFRESH_STATE_ES_SPACE', { spaceId }));
|
|
101
101
|
}
|
|
102
102
|
return (0, stateManager_1.setResource)(state, logicalId, buildResourceState(spaceInfo));
|
|
103
103
|
}
|
|
@@ -110,10 +110,18 @@ const createEsResource = async (context, database, state) => {
|
|
|
110
110
|
// fail loudly rather than silently taking it over.
|
|
111
111
|
const probe = await client.es.getSpaceByName(config.SpaceName);
|
|
112
112
|
if (probe && (0, ownershipTag_1.isOwnedByStack)(context, logicalId, probe.Tags)) {
|
|
113
|
-
logger_1.logger.info(
|
|
113
|
+
logger_1.logger.info(lang_1.lang.__('RESOURCE_OWNERSHIP_TAG_ADOPT', {
|
|
114
|
+
resourceType: 'ES space',
|
|
115
|
+
name: config.SpaceName,
|
|
116
|
+
tag: ownershipTag_1.OWNERSHIP_TAG_KEY,
|
|
117
|
+
}));
|
|
114
118
|
return (0, stateManager_1.setResource)(state, logicalId, buildResourceState(probe));
|
|
115
119
|
}
|
|
116
|
-
throw new types_1.PartialResourceError(stateAfterDependents, new Error(
|
|
120
|
+
throw new types_1.PartialResourceError(stateAfterDependents, new Error(lang_1.lang.__('RESOURCE_EXISTS_NOT_OWNED_ADOPT', {
|
|
121
|
+
resourceType: 'ES space',
|
|
122
|
+
resourceName: config.SpaceName,
|
|
123
|
+
tagKey: ownershipTag_1.OWNERSHIP_TAG_KEY,
|
|
124
|
+
})));
|
|
117
125
|
}
|
|
118
126
|
throw new types_1.PartialResourceError(stateAfterDependents, error instanceof Error ? error : new Error(String(error)));
|
|
119
127
|
}
|
|
@@ -134,7 +142,7 @@ const updateEsResource = async (context, database, spaceId, state) => {
|
|
|
134
142
|
// Refresh state from provider to get all attributes
|
|
135
143
|
const spaceInfo = await client.es.getSpace(spaceId);
|
|
136
144
|
if (!spaceInfo) {
|
|
137
|
-
throw new Error(
|
|
145
|
+
throw new Error(lang_1.lang.__('REFRESH_STATE_ES_SPACE', { spaceId }));
|
|
138
146
|
}
|
|
139
147
|
const definition = (0, esServerlessTypes_1.extractTencentEsDefinition)(config);
|
|
140
148
|
const sid = (0, common_1.buildSid)('tencent', 'es', context.stage, spaceId);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cloudTencentEsToDefinition = exports.extractTencentEsDefinition = exports.databaseToTencentEsConfig = void 0;
|
|
4
|
+
const lang_1 = require("../../lang");
|
|
4
5
|
// Map database versions to ES versions
|
|
5
6
|
const esVersionMap = new Map([
|
|
6
7
|
[
|
|
@@ -15,7 +16,7 @@ const esVersionMap = new Map([
|
|
|
15
16
|
const databaseToTencentEsConfig = (database) => {
|
|
16
17
|
const engineConfig = esVersionMap.get(`${database.type}-${database.version}`);
|
|
17
18
|
if (!engineConfig) {
|
|
18
|
-
throw new Error(
|
|
19
|
+
throw new Error(lang_1.lang.__('ES_DB_TYPE_VERSION_UNSUPPORTED', { type: database.type, version: database.version }));
|
|
19
20
|
}
|
|
20
21
|
const config = {
|
|
21
22
|
SpaceName: database.name,
|
|
@@ -35,14 +35,14 @@ const executeSingleItem = async (context, item, functionsMap, currentState) => {
|
|
|
35
35
|
case 'create': {
|
|
36
36
|
const fn = functionsMap.get(item.logicalId);
|
|
37
37
|
if (!fn) {
|
|
38
|
-
throw new Error(
|
|
38
|
+
throw new Error(lang_1.lang.__('RESOURCE_FUNCTION_NOT_FOUND', { logicalId: item.logicalId }));
|
|
39
39
|
}
|
|
40
40
|
return executeCreateAction(context, fn, currentState);
|
|
41
41
|
}
|
|
42
42
|
case 'update': {
|
|
43
43
|
const fn = functionsMap.get(item.logicalId);
|
|
44
44
|
if (!fn) {
|
|
45
|
-
throw new Error(
|
|
45
|
+
throw new Error(lang_1.lang.__('RESOURCE_FUNCTION_NOT_FOUND', { logicalId: item.logicalId }));
|
|
46
46
|
}
|
|
47
47
|
return executeUpdateAction(context, fn, currentState, item.drifted);
|
|
48
48
|
}
|
|
@@ -43,46 +43,45 @@ const generateFunctionPlan = async (context, state, functions) => {
|
|
|
43
43
|
const desiredCodeHash = await (0, hashUtils_1.computeZipContentHash)(codePath);
|
|
44
44
|
const desiredDefinition = (0, scfTypes_1.extractScfDefinition)(config, desiredCodeHash, fn.iam);
|
|
45
45
|
const client = (0, tencentClient_1.createTencentClient)(context);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
currentState
|
|
50
|
-
|
|
51
|
-
context.
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
return (0, refreshPlanner_1.planRefreshedResource)({
|
|
47
|
+
logicalId,
|
|
48
|
+
resourceType: 'SCF',
|
|
49
|
+
currentState,
|
|
50
|
+
desiredDefinition,
|
|
51
|
+
read: () => (0, refreshCache_1.cachedRefreshRead)(context, `scf.getFunction:${fn.name}`, () => client.scf.getFunction(fn.name)),
|
|
52
|
+
isOwned: (remote) => (0, ownershipTag_1.isOwnedByStack)(context, logicalId, remote.Tags),
|
|
53
|
+
foreignError: () => new Error(lang_1.lang.__('RESOURCE_EXISTS_NOT_OWNED', {
|
|
54
|
+
resourceType: 'Function',
|
|
55
|
+
resourceName: fn.name,
|
|
56
|
+
tagKey: ownershipTag_1.OWNERSHIP_TAG_KEY,
|
|
57
|
+
})),
|
|
58
|
+
extraUpdate: async () => {
|
|
59
|
+
// Issue #234 M3: nested topic drift — probed only when logging is
|
|
60
|
+
// declared; unresolvable/unreadable topics are not drift. Runs via
|
|
61
|
+
// the skeleton's extraUpdate hook (issue #246) so a topic-only
|
|
62
|
+
// drift gets the live→desired diff baseline too.
|
|
63
|
+
const topicInstance = currentState?.instances?.find((i) => i.type === 'TENCENT_CLS_TOPIC');
|
|
64
|
+
if (!fn.log || !topicInstance?.id) {
|
|
65
|
+
return { update: false, drifted: false };
|
|
66
|
+
}
|
|
54
67
|
const topicId = topicInstance.id;
|
|
55
68
|
try {
|
|
56
69
|
const liveTopic = await (0, refreshCache_1.cachedRefreshRead)(context, `cls.getTopicById:${topicId}`, () => client.cls.getTopicById(topicId));
|
|
57
70
|
const topicDrifted = !liveTopic ||
|
|
58
71
|
liveTopic.StorageType !== clsOperations_1.CLS_TOPIC_STORAGE_TYPE ||
|
|
59
72
|
liveTopic.Period !== clsOperations_1.CLS_TOPIC_PERIOD;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
action: 'update',
|
|
64
|
-
resourceType: 'SCF',
|
|
65
|
-
changes: { before: currentState.definition || {}, after: desiredDefinition },
|
|
66
|
-
drifted: true,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
73
|
+
return topicDrifted
|
|
74
|
+
? { update: true, drifted: true, reason: 'PLAN_DRIFT_CLS_TOPIC' }
|
|
75
|
+
: { update: false, drifted: false };
|
|
69
76
|
}
|
|
70
77
|
catch (error) {
|
|
71
78
|
logger_1.logger.warn(lang_1.lang.__('PLAN_FUNCTION_NESTED_PROBE_FAILED', {
|
|
72
79
|
functionName: fn.name,
|
|
73
80
|
error: String(error),
|
|
74
81
|
}));
|
|
82
|
+
return { update: false, drifted: false };
|
|
75
83
|
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return (0, refreshPlanner_1.planRefreshedResource)({
|
|
79
|
-
logicalId,
|
|
80
|
-
resourceType: 'SCF',
|
|
81
|
-
currentState,
|
|
82
|
-
desiredDefinition,
|
|
83
|
-
read: () => (0, refreshCache_1.cachedRefreshRead)(context, `scf.getFunction:${fn.name}`, () => client.scf.getFunction(fn.name)),
|
|
84
|
-
isOwned: (remote) => (0, ownershipTag_1.isOwnedByStack)(context, logicalId, remote.Tags),
|
|
85
|
-
foreignError: () => new Error(`Function ${fn.name} already exists in provider but is not owned by this stack (missing ${ownershipTag_1.OWNERSHIP_TAG_KEY} tag). Refusing to create — resolve manually.`),
|
|
84
|
+
},
|
|
86
85
|
cloudToDefinition: scfTypes_1.cloudScfToDefinition,
|
|
87
86
|
enrichRemoteAttributes: async (remote, attributes) => {
|
|
88
87
|
// Resolve cloud CLS ids back to the stable names the desired
|
|
@@ -508,7 +508,7 @@ const createResource = async (context, fn, state) => {
|
|
|
508
508
|
// triggers below.
|
|
509
509
|
let adoptedInfo = existingFunctionOnRetry;
|
|
510
510
|
if (existingFunctionOnRetry) {
|
|
511
|
-
logger_1.logger.info(
|
|
511
|
+
logger_1.logger.info(lang_1.lang.__('TAINTED_RECOVERY_SKIP_CREATE', { resourceType: 'Function', resourceName: fn.name }));
|
|
512
512
|
}
|
|
513
513
|
try {
|
|
514
514
|
if (!existingFunctionOnRetry) {
|
|
@@ -519,12 +519,15 @@ const createResource = async (context, fn, state) => {
|
|
|
519
519
|
}
|
|
520
520
|
catch (error) {
|
|
521
521
|
if (isRecoverableCreateError(error)) {
|
|
522
|
-
logger_1.logger.warn(
|
|
522
|
+
logger_1.logger.warn(lang_1.lang.__('FC3_CREATE_RECOVERABLE_RECONCILE', {
|
|
523
|
+
functionName: fn.name,
|
|
524
|
+
error: String(error),
|
|
525
|
+
}));
|
|
523
526
|
await delay(RECOVERY_GET_FUNCTION_DELAY_MS);
|
|
524
527
|
const afterError = await client.scf.getFunction(fn.name);
|
|
525
528
|
if (afterError) {
|
|
526
529
|
adoptedInfo = afterError;
|
|
527
|
-
logger_1.logger.info(
|
|
530
|
+
logger_1.logger.info(lang_1.lang.__('FC3_FOUND_AFTER_CREATE_RECONCILE', { functionName: fn.name }));
|
|
528
531
|
}
|
|
529
532
|
else {
|
|
530
533
|
throw new types_1.PartialResourceError(stateAfterDependents, new Error(toErrorMessage(error)));
|
|
@@ -540,10 +543,18 @@ const createResource = async (context, fn, state) => {
|
|
|
540
543
|
const probe = await client.scf.getFunction(fn.name);
|
|
541
544
|
if (probe && (0, ownershipTag_1.isOwnedByStack)(context, logicalId, probe.Tags)) {
|
|
542
545
|
adoptedInfo = probe;
|
|
543
|
-
logger_1.logger.info(
|
|
546
|
+
logger_1.logger.info(lang_1.lang.__('RESOURCE_OWNERSHIP_TAG_ADOPT', {
|
|
547
|
+
resourceType: 'Function',
|
|
548
|
+
name: fn.name,
|
|
549
|
+
tag: ownershipTag_1.OWNERSHIP_TAG_KEY,
|
|
550
|
+
}));
|
|
544
551
|
}
|
|
545
552
|
else {
|
|
546
|
-
throw new types_1.PartialResourceError(stateAfterDependents, new Error(
|
|
553
|
+
throw new types_1.PartialResourceError(stateAfterDependents, new Error(lang_1.lang.__('RESOURCE_EXISTS_NOT_OWNED_ADOPT', {
|
|
554
|
+
resourceType: 'Function',
|
|
555
|
+
resourceName: fn.name,
|
|
556
|
+
tagKey: ownershipTag_1.OWNERSHIP_TAG_KEY,
|
|
557
|
+
})));
|
|
547
558
|
}
|
|
548
559
|
}
|
|
549
560
|
else {
|
|
@@ -570,7 +581,7 @@ const createResource = async (context, fn, state) => {
|
|
|
570
581
|
}
|
|
571
582
|
const triggerAlreadyAttached = providerTriggers.some(isFunctionUrlTrigger);
|
|
572
583
|
if (triggerAlreadyAttached) {
|
|
573
|
-
logger_1.logger.info(
|
|
584
|
+
logger_1.logger.info(lang_1.lang.__('SCF_HTTP_TRIGGER_ALREADY_ATTACHED', { triggerName, functionName: fn.name }));
|
|
574
585
|
}
|
|
575
586
|
else {
|
|
576
587
|
logger_1.logger.info(lang_1.lang.__('CREATING_HTTP_TRIGGER', { triggerName, functionName: fn.name }));
|
|
@@ -587,7 +598,11 @@ const createResource = async (context, fn, state) => {
|
|
|
587
598
|
}
|
|
588
599
|
catch (error) {
|
|
589
600
|
if ((0, alreadyExists_1.isResourceAlreadyExistsError)(error)) {
|
|
590
|
-
logger_1.logger.warn(
|
|
601
|
+
logger_1.logger.warn(lang_1.lang.__('SCF_HTTP_TRIGGER_ALREADY_EXISTS', {
|
|
602
|
+
triggerName,
|
|
603
|
+
functionName: fn.name,
|
|
604
|
+
error: String(error),
|
|
605
|
+
}));
|
|
591
606
|
}
|
|
592
607
|
else {
|
|
593
608
|
// The function exists in the cloud but the trigger failed to attach —
|
|
@@ -638,7 +653,7 @@ const createResource = async (context, fn, state) => {
|
|
|
638
653
|
throw new types_1.PartialResourceError(stateAfterDependents, new Error(toErrorMessage(error)));
|
|
639
654
|
}
|
|
640
655
|
if (!functionInfo) {
|
|
641
|
-
throw new types_1.PartialResourceError(stateAfterDependents, new Error(
|
|
656
|
+
throw new types_1.PartialResourceError(stateAfterDependents, new Error(lang_1.lang.__('REFRESH_STATE_FUNCTION', { name: fn.name })));
|
|
642
657
|
}
|
|
643
658
|
const sid = (0, common_1.buildSid)('tencent', 'scf', context.stage, fn.name);
|
|
644
659
|
const resourceState = {
|
|
@@ -830,12 +845,18 @@ const updateResource = async (context, fn, state, options) => {
|
|
|
830
845
|
if (desiredDefinition.handler &&
|
|
831
846
|
existingDefinition.handler &&
|
|
832
847
|
desiredDefinition.handler !== existingDefinition.handler) {
|
|
833
|
-
throw new Error(
|
|
848
|
+
throw new Error(lang_1.lang.__('SCF_HANDLER_IMMUTABLE', {
|
|
849
|
+
oldHandler: String(existingDefinition.handler),
|
|
850
|
+
newHandler: String(desiredDefinition.handler),
|
|
851
|
+
}));
|
|
834
852
|
}
|
|
835
853
|
if (desiredDefinition.runtime &&
|
|
836
854
|
existingDefinition.runtime &&
|
|
837
855
|
desiredDefinition.runtime !== existingDefinition.runtime) {
|
|
838
|
-
throw new Error(
|
|
856
|
+
throw new Error(lang_1.lang.__('SCF_RUNTIME_IMMUTABLE', {
|
|
857
|
+
oldRuntime: String(existingDefinition.runtime),
|
|
858
|
+
newRuntime: String(desiredDefinition.runtime),
|
|
859
|
+
}));
|
|
839
860
|
}
|
|
840
861
|
const configChanged = mutableKeys.some((k) => desiredDefinition[k] !== existingDefinition[k]) ||
|
|
841
862
|
isLogConfigChanged(desiredDefinition, existingDefinition) ||
|
|
@@ -910,7 +931,7 @@ const updateResource = async (context, fn, state, options) => {
|
|
|
910
931
|
const probe = await client.scf.getFunction(fn.name);
|
|
911
932
|
const providerTriggerAttached = (probe?.Triggers ?? []).some(isFunctionUrlTrigger);
|
|
912
933
|
if (providerTriggerAttached) {
|
|
913
|
-
logger_1.logger.info(
|
|
934
|
+
logger_1.logger.info(lang_1.lang.__('SCF_HTTP_TRIGGER_ALREADY_ATTACHED', { triggerName, functionName: fn.name }));
|
|
914
935
|
}
|
|
915
936
|
else {
|
|
916
937
|
logger_1.logger.info(lang_1.lang.__('CREATING_HTTP_TRIGGER', { triggerName, functionName: fn.name }));
|
|
@@ -927,7 +948,11 @@ const updateResource = async (context, fn, state, options) => {
|
|
|
927
948
|
}
|
|
928
949
|
catch (error) {
|
|
929
950
|
if ((0, alreadyExists_1.isResourceAlreadyExistsError)(error)) {
|
|
930
|
-
logger_1.logger.warn(
|
|
951
|
+
logger_1.logger.warn(lang_1.lang.__('SCF_HTTP_TRIGGER_ALREADY_EXISTS', {
|
|
952
|
+
triggerName,
|
|
953
|
+
functionName: fn.name,
|
|
954
|
+
error: String(error),
|
|
955
|
+
}));
|
|
931
956
|
}
|
|
932
957
|
else {
|
|
933
958
|
throw error;
|
|
@@ -1025,7 +1050,7 @@ const updateResource = async (context, fn, state, options) => {
|
|
|
1025
1050
|
// Refresh state from provider to get all attributes (including triggers)
|
|
1026
1051
|
const functionInfo = await client.scf.getFunction(fn.name);
|
|
1027
1052
|
if (!functionInfo) {
|
|
1028
|
-
throw new Error(
|
|
1053
|
+
throw new Error(lang_1.lang.__('REFRESH_STATE_FUNCTION', { name: fn.name }));
|
|
1029
1054
|
}
|
|
1030
1055
|
const definition = (0, scfTypes_1.extractScfDefinition)(config, codeHash, fn.iam);
|
|
1031
1056
|
const sid = (0, common_1.buildSid)('tencent', 'scf', context.stage, fn.name);
|
|
@@ -36,22 +36,22 @@ const executeSingleItem = async (context, item, databasesMap, currentState) => {
|
|
|
36
36
|
case 'create': {
|
|
37
37
|
const database = databasesMap.get(item.logicalId);
|
|
38
38
|
if (!database) {
|
|
39
|
-
throw new Error(
|
|
39
|
+
throw new Error(lang_1.lang.__('RESOURCE_DATABASE_NOT_FOUND', { logicalId: item.logicalId }));
|
|
40
40
|
}
|
|
41
41
|
return executeCreateAction(context, database, currentState);
|
|
42
42
|
}
|
|
43
43
|
case 'update': {
|
|
44
44
|
const database = databasesMap.get(item.logicalId);
|
|
45
45
|
if (!database) {
|
|
46
|
-
throw new Error(
|
|
46
|
+
throw new Error(lang_1.lang.__('RESOURCE_DATABASE_NOT_FOUND', { logicalId: item.logicalId }));
|
|
47
47
|
}
|
|
48
48
|
const state = (0, stateManager_1.getResource)(currentState, item.logicalId);
|
|
49
49
|
if (!state) {
|
|
50
|
-
throw new Error(
|
|
50
|
+
throw new Error(lang_1.lang.__('EXECUTOR_STATE_NOT_FOUND', { logicalId: item.logicalId }));
|
|
51
51
|
}
|
|
52
52
|
const clusterId = state.metadata?.clusterId || state.instances?.[0]?.id;
|
|
53
53
|
if (!clusterId) {
|
|
54
|
-
throw new Error(
|
|
54
|
+
throw new Error(lang_1.lang.__('RESOURCE_CLUSTER_ID_NOT_FOUND', { logicalId: item.logicalId }));
|
|
55
55
|
}
|
|
56
56
|
return executeUpdateAction(context, database, clusterId, currentState);
|
|
57
57
|
}
|
|
@@ -63,7 +63,7 @@ const executeSingleItem = async (context, item, databasesMap, currentState) => {
|
|
|
63
63
|
}
|
|
64
64
|
const clusterId = state.metadata?.clusterId || state.instances?.[0]?.id;
|
|
65
65
|
if (!clusterId) {
|
|
66
|
-
throw new Error(
|
|
66
|
+
throw new Error(lang_1.lang.__('RESOURCE_CLUSTER_ID_NOT_FOUND', { logicalId: item.logicalId }));
|
|
67
67
|
}
|
|
68
68
|
return executeDeleteAction(context, clusterId, item.logicalId, currentState);
|
|
69
69
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateDatabasePlan = void 0;
|
|
4
|
+
const lang_1 = require("../../lang");
|
|
4
5
|
const tencentClient_1 = require("../../common/tencentClient");
|
|
5
6
|
const refreshCache_1 = require("../../common/refreshCache");
|
|
6
7
|
const concurrency_1 = require("../../common/concurrency");
|
|
@@ -49,7 +50,11 @@ const generateDatabasePlan = async (context, state, databases) => {
|
|
|
49
50
|
? (0, refreshCache_1.cachedRefreshRead)(context, `tdsqlc.getCluster:${clusterId}`, () => client.tdsqlc.getCluster(clusterId))
|
|
50
51
|
: Promise.resolve(null),
|
|
51
52
|
isOwned: (remote) => (0, ownershipTag_1.isOwnedByStack)(context, logicalId, (0, tdsqlcTypes_1.tdsqlcTagsToOwnershipTags)(remote.ResourceTags)),
|
|
52
|
-
foreignError: () => new Error(
|
|
53
|
+
foreignError: () => new Error(lang_1.lang.__('RESOURCE_EXISTS_NOT_OWNED', {
|
|
54
|
+
resourceType: 'Cluster',
|
|
55
|
+
resourceName: database.name,
|
|
56
|
+
tagKey: ownershipTag_1.OWNERSHIP_TAG_KEY,
|
|
57
|
+
})),
|
|
53
58
|
cloudToDefinition: tdsqlcTypes_1.cloudTdsqlcToDefinition,
|
|
54
59
|
extraUpdate: async () => {
|
|
55
60
|
// AutoPause needs a dedicated read: DescribeClusters reports the
|
|
@@ -146,12 +146,20 @@ const createDatabaseResource = async (context, database, state) => {
|
|
|
146
146
|
const probe = await client.tdsqlc.getClusterByName(database.name);
|
|
147
147
|
if (probe &&
|
|
148
148
|
(0, ownershipTag_1.isOwnedByStack)(context, logicalId, (0, tdsqlcTypes_1.tdsqlcTagsToOwnershipTags)(probe.ResourceTags))) {
|
|
149
|
-
logger_1.logger.info(
|
|
149
|
+
logger_1.logger.info(lang_1.lang.__('RESOURCE_OWNERSHIP_TAG_ADOPT', {
|
|
150
|
+
resourceType: 'Cluster',
|
|
151
|
+
name: database.name,
|
|
152
|
+
tag: ownershipTag_1.OWNERSHIP_TAG_KEY,
|
|
153
|
+
}));
|
|
150
154
|
clusterId = probe.ClusterId;
|
|
151
155
|
clusterInfo = probe;
|
|
152
156
|
}
|
|
153
157
|
else {
|
|
154
|
-
throw new types_1.PartialResourceError(stateAfterDependents, new Error(
|
|
158
|
+
throw new types_1.PartialResourceError(stateAfterDependents, new Error(lang_1.lang.__('RESOURCE_EXISTS_NOT_OWNED_ADOPT', {
|
|
159
|
+
resourceType: 'Cluster',
|
|
160
|
+
resourceName: database.name,
|
|
161
|
+
tagKey: ownershipTag_1.OWNERSHIP_TAG_KEY,
|
|
162
|
+
})));
|
|
155
163
|
}
|
|
156
164
|
}
|
|
157
165
|
else {
|
|
@@ -162,7 +170,7 @@ const createDatabaseResource = async (context, database, state) => {
|
|
|
162
170
|
if (!clusterInfo) {
|
|
163
171
|
clusterInfo = await client.tdsqlc.getCluster(clusterId);
|
|
164
172
|
if (!clusterInfo) {
|
|
165
|
-
throw new Error(
|
|
173
|
+
throw new Error(lang_1.lang.__('REFRESH_STATE_CLUSTER', { clusterId }));
|
|
166
174
|
}
|
|
167
175
|
}
|
|
168
176
|
const sid = (0, common_1.buildSid)('tencent', 'cynosdb', context.stage, clusterId);
|
|
@@ -200,7 +208,7 @@ const updateDatabaseResource = async (context, database, clusterId, state) => {
|
|
|
200
208
|
// Refresh state from provider to get all attributes
|
|
201
209
|
const clusterInfo = await client.tdsqlc.getCluster(clusterId);
|
|
202
210
|
if (!clusterInfo) {
|
|
203
|
-
throw new Error(
|
|
211
|
+
throw new Error(lang_1.lang.__('REFRESH_STATE_CLUSTER', { clusterId }));
|
|
204
212
|
}
|
|
205
213
|
const definition = (0, tdsqlcTypes_1.extractTdsqlcDefinition)(config);
|
|
206
214
|
const sid = (0, common_1.buildSid)('tencent', 'cynosdb', context.stage, clusterId);
|
|
@@ -15,7 +15,7 @@ const executeSingleItem = async (context, item, eventsMap, serviceName, currentS
|
|
|
15
15
|
case 'create': {
|
|
16
16
|
const event = eventsMap.get(item.logicalId);
|
|
17
17
|
if (!event) {
|
|
18
|
-
throw new Error(
|
|
18
|
+
throw new Error(lang_1.lang.__('RESOURCE_EVENT_NOT_FOUND', { logicalId: item.logicalId }));
|
|
19
19
|
}
|
|
20
20
|
common_1.logger.info(lang_1.lang.__('CREATING_RESOURCE', { resourceType: 'API Gateway resources', name: event.name }));
|
|
21
21
|
const newState = await (0, apigwResource_1.createApigwResource)(context, event, serviceName, currentState);
|
|
@@ -25,7 +25,7 @@ const executeSingleItem = async (context, item, eventsMap, serviceName, currentS
|
|
|
25
25
|
case 'update': {
|
|
26
26
|
const event = eventsMap.get(item.logicalId);
|
|
27
27
|
if (!event) {
|
|
28
|
-
throw new Error(
|
|
28
|
+
throw new Error(lang_1.lang.__('RESOURCE_EVENT_NOT_FOUND', { logicalId: item.logicalId }));
|
|
29
29
|
}
|
|
30
30
|
common_1.logger.info(lang_1.lang.__('UPDATING_RESOURCE', { resourceType: 'API Gateway resources', name: event.name }));
|
|
31
31
|
const newState = await (0, apigwResource_1.updateApigwResource)(context, event, serviceName, currentState);
|
|
@@ -42,7 +42,11 @@ const generateApigwPlan = async (context, state, events, serviceName) => {
|
|
|
42
42
|
// is account-scoped, so only refuse when the NAMED one is foreign.
|
|
43
43
|
const remoteGateway = await (0, refreshCache_1.cachedRefreshRead)(context, `apigw.findGatewayByName:${serviceName}:${context.stage}`, () => client.apigw.findGatewayByName((0, apigwTypes_1.buildGatewayName)(serviceName, context.stage)));
|
|
44
44
|
if (remoteGateway?.gatewayId && !(0, ownershipTag_1.isOwnedByStack)(context, logicalId, remoteGateway.tags)) {
|
|
45
|
-
throw new Error(
|
|
45
|
+
throw new Error(lang_1.lang.__('RESOURCE_EXISTS_NOT_OWNED', {
|
|
46
|
+
resourceType: 'API Gateway',
|
|
47
|
+
resourceName: (0, apigwTypes_1.buildGatewayName)(serviceName, context.stage),
|
|
48
|
+
tagKey: ownershipTag_1.OWNERSHIP_TAG_KEY,
|
|
49
|
+
}));
|
|
46
50
|
}
|
|
47
51
|
return {
|
|
48
52
|
logicalId,
|
|
@@ -150,7 +150,7 @@ const resolveFunctionIdFromState = async (state, backendRef, client) => {
|
|
|
150
150
|
if (templateKey) {
|
|
151
151
|
// Template function with no state Id: deploy failed or state is stale —
|
|
152
152
|
// do not mask it by adopting a same-named foreign function.
|
|
153
|
-
throw new Error(
|
|
153
|
+
throw new Error(lang_1.lang.__('VOLC_BACKEND_FUNCTION_ID_UNRESOLVED', { backend: backendRef, functionKey: fnKey }));
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
const external = await client.vefaas.getFunction(String(backendRef ?? ''));
|
|
@@ -177,7 +177,7 @@ const createApigwResource = async (context, event, serviceName, state) => {
|
|
|
177
177
|
// NetworkSpec (vpc_id + subnet_ids) is required by CreateGateway for all
|
|
178
178
|
// types — verified live: omitting it returns "missing NetworkSpec".
|
|
179
179
|
if (!gatewayConfig.network) {
|
|
180
|
-
throw new Error(
|
|
180
|
+
throw new Error(lang_1.lang.__('VOLC_APIGW_NETWORK_REQUIRED', { eventKey: event.key }));
|
|
181
181
|
}
|
|
182
182
|
try {
|
|
183
183
|
gatewayInfo = await client.apigw.createGateway(gatewayConfig);
|
|
@@ -190,7 +190,10 @@ const createApigwResource = async (context, event, serviceName, state) => {
|
|
|
190
190
|
gatewayInfo = probe;
|
|
191
191
|
}
|
|
192
192
|
else {
|
|
193
|
-
throw new types_1.PartialResourceError(state, new Error(
|
|
193
|
+
throw new types_1.PartialResourceError(state, new Error(lang_1.lang.__('VOLC_APIGW_ADOPT_REFUSED', {
|
|
194
|
+
gatewayName: gatewayConfig.gatewayName,
|
|
195
|
+
tag: ownershipTag_1.OWNERSHIP_TAG_KEY,
|
|
196
|
+
})));
|
|
194
197
|
}
|
|
195
198
|
}
|
|
196
199
|
else {
|
|
@@ -199,7 +202,7 @@ const createApigwResource = async (context, event, serviceName, state) => {
|
|
|
199
202
|
}
|
|
200
203
|
}
|
|
201
204
|
if (!gatewayInfo?.gatewayId) {
|
|
202
|
-
throw new Error('
|
|
205
|
+
throw new Error(lang_1.lang.__('VOLC_APIGW_CREATE_OR_REUSE_FAILED'));
|
|
203
206
|
}
|
|
204
207
|
const gatewayId = gatewayInfo.gatewayId;
|
|
205
208
|
// Gateway creation is async — service/upstream/route calls are rejected
|
|
@@ -32,7 +32,12 @@ const formatApiError = (error) => {
|
|
|
32
32
|
}
|
|
33
33
|
return parts.join(' | ');
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
// Issue #246: when the approved plan is passed through, the executor runs
|
|
36
|
+
// exactly the displayed items — partitioned by resourceType, no re-probe.
|
|
37
|
+
const partitionPlan = (plan, types) => ({
|
|
38
|
+
items: plan.items.filter((item) => types.includes(item.resourceType)),
|
|
39
|
+
});
|
|
40
|
+
const deployVolcengineStack = async (iac, backend, approvedPlan) => {
|
|
36
41
|
const context = (0, common_1.getContext)();
|
|
37
42
|
common_1.logger.info(lang_1.lang.__('DEPLOYING_STACK'));
|
|
38
43
|
let state = await backend.loadState('volcengine', iac.app, iac.service, context.stage);
|
|
@@ -41,9 +46,15 @@ const deployVolcengineStack = async (iac, backend) => {
|
|
|
41
46
|
await backend.saveState(state, iac.app, iac.service, context.stage);
|
|
42
47
|
};
|
|
43
48
|
common_1.logger.info(lang_1.lang.__('GENERATING_PLAN'));
|
|
44
|
-
const functionPlan =
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
const functionPlan = approvedPlan
|
|
50
|
+
? partitionPlan(approvedPlan, ['VOLCENGINE_VEFAAS'])
|
|
51
|
+
: await (0, vefaasPlanner_1.generateFunctionPlan)(context, state, iac.functions);
|
|
52
|
+
const bucketPlan = approvedPlan
|
|
53
|
+
? partitionPlan(approvedPlan, ['VOLCENGINE_TOS_BUCKET'])
|
|
54
|
+
: await (0, tosPlanner_1.generateBucketPlan)(context, state, iac.buckets);
|
|
55
|
+
const apigwPlan = approvedPlan
|
|
56
|
+
? partitionPlan(approvedPlan, ['VOLCENGINE_APIGW'])
|
|
57
|
+
: await (0, apigwPlanner_1.generateApigwPlan)(context, state, iac.events, iac.service);
|
|
47
58
|
const bucketResult = await (0, tosExecutor_1.executeBucketPlan)(context, bucketPlan, iac.buckets, state, onStateChange);
|
|
48
59
|
if (bucketResult.partialFailure) {
|
|
49
60
|
const error = bucketResult.partialFailure.error;
|
|
@@ -33,14 +33,14 @@ const executeSingleItem = async (context, item, bucketsMap, currentState) => {
|
|
|
33
33
|
case 'create': {
|
|
34
34
|
const bucket = bucketsMap.get(item.logicalId);
|
|
35
35
|
if (!bucket) {
|
|
36
|
-
throw new Error(
|
|
36
|
+
throw new Error(lang_1.lang.__('RESOURCE_BUCKET_NOT_FOUND', { logicalId: item.logicalId }));
|
|
37
37
|
}
|
|
38
38
|
return executeCreateAction(context, bucket, currentState);
|
|
39
39
|
}
|
|
40
40
|
case 'update': {
|
|
41
41
|
const bucket = bucketsMap.get(item.logicalId);
|
|
42
42
|
if (!bucket) {
|
|
43
|
-
throw new Error(
|
|
43
|
+
throw new Error(lang_1.lang.__('RESOURCE_BUCKET_NOT_FOUND', { logicalId: item.logicalId }));
|
|
44
44
|
}
|
|
45
45
|
return executeUpdateAction(context, bucket, currentState);
|
|
46
46
|
}
|