@aws-cdk/integ-runner 2.190.3 → 2.190.4
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/lib/workers/extract/index.js +354 -87
- package/package.json +6 -6
|
@@ -4878,7 +4878,7 @@ var require_semver2 = __commonJS({
|
|
|
4878
4878
|
// ../cloud-assembly-schema/cli-version.json
|
|
4879
4879
|
var require_cli_version = __commonJS({
|
|
4880
4880
|
"../cloud-assembly-schema/cli-version.json"(exports2, module2) {
|
|
4881
|
-
module2.exports = { version: "2.
|
|
4881
|
+
module2.exports = { version: "2.1029.0" };
|
|
4882
4882
|
}
|
|
4883
4883
|
});
|
|
4884
4884
|
|
|
@@ -9830,7 +9830,7 @@ var require_placeholders = __commonJS({
|
|
|
9830
9830
|
exports2.EnvironmentPlaceholders = void 0;
|
|
9831
9831
|
var jsiiDeprecationWarnings = require_warnings_jsii();
|
|
9832
9832
|
var JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
9833
|
-
var
|
|
9833
|
+
var EnvironmentPlaceholders5 = class _EnvironmentPlaceholders {
|
|
9834
9834
|
static {
|
|
9835
9835
|
__name(this, "EnvironmentPlaceholders");
|
|
9836
9836
|
}
|
|
@@ -9910,12 +9910,12 @@ var require_placeholders = __commonJS({
|
|
|
9910
9910
|
return ret;
|
|
9911
9911
|
}
|
|
9912
9912
|
};
|
|
9913
|
-
exports2.EnvironmentPlaceholders =
|
|
9913
|
+
exports2.EnvironmentPlaceholders = EnvironmentPlaceholders5;
|
|
9914
9914
|
_a2 = JSII_RTTI_SYMBOL_1;
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9915
|
+
EnvironmentPlaceholders5[_a2] = { fqn: "@aws-cdk/cx-api.EnvironmentPlaceholders", version: "2.213.0" };
|
|
9916
|
+
EnvironmentPlaceholders5.CURRENT_REGION = "${AWS::Region}";
|
|
9917
|
+
EnvironmentPlaceholders5.CURRENT_ACCOUNT = "${AWS::AccountId}";
|
|
9918
|
+
EnvironmentPlaceholders5.CURRENT_PARTITION = "${AWS::Partition}";
|
|
9919
9919
|
function replaceAll(s3, search, replace) {
|
|
9920
9920
|
return s3.split(search).join(replace);
|
|
9921
9921
|
}
|
|
@@ -80205,6 +80205,11 @@ var init_messages = __esm({
|
|
|
80205
80205
|
description: "Refactor result",
|
|
80206
80206
|
interface: "RefactorResult"
|
|
80207
80207
|
}),
|
|
80208
|
+
CDK_TOOLKIT_I8910: question({
|
|
80209
|
+
code: "CDK_TOOLKIT_I8910",
|
|
80210
|
+
description: "Confirm refactor",
|
|
80211
|
+
interface: "ConfirmationRequest"
|
|
80212
|
+
}),
|
|
80208
80213
|
CDK_TOOLKIT_W8010: warn({
|
|
80209
80214
|
code: "CDK_TOOLKIT_W8010",
|
|
80210
80215
|
description: "Refactor execution not yet supported"
|
|
@@ -110311,7 +110316,7 @@ var require_dist_cjs56 = __commonJS({
|
|
|
110311
110316
|
CreateGeneratedTemplateCommand: /* @__PURE__ */ __name(() => CreateGeneratedTemplateCommand2, "CreateGeneratedTemplateCommand"),
|
|
110312
110317
|
CreateStackCommand: /* @__PURE__ */ __name(() => CreateStackCommand2, "CreateStackCommand"),
|
|
110313
110318
|
CreateStackInstancesCommand: /* @__PURE__ */ __name(() => CreateStackInstancesCommand, "CreateStackInstancesCommand"),
|
|
110314
|
-
CreateStackRefactorCommand: /* @__PURE__ */ __name(() =>
|
|
110319
|
+
CreateStackRefactorCommand: /* @__PURE__ */ __name(() => CreateStackRefactorCommand2, "CreateStackRefactorCommand"),
|
|
110315
110320
|
CreateStackSetCommand: /* @__PURE__ */ __name(() => CreateStackSetCommand, "CreateStackSetCommand"),
|
|
110316
110321
|
CreatedButModifiedException: /* @__PURE__ */ __name(() => CreatedButModifiedException, "CreatedButModifiedException"),
|
|
110317
110322
|
DeactivateOrganizationsAccessCommand: /* @__PURE__ */ __name(() => DeactivateOrganizationsAccessCommand, "DeactivateOrganizationsAccessCommand"),
|
|
@@ -110351,7 +110356,7 @@ var require_dist_cjs56 = __commonJS({
|
|
|
110351
110356
|
EstimateTemplateCostCommand: /* @__PURE__ */ __name(() => EstimateTemplateCostCommand, "EstimateTemplateCostCommand"),
|
|
110352
110357
|
EvaluationType: /* @__PURE__ */ __name(() => EvaluationType, "EvaluationType"),
|
|
110353
110358
|
ExecuteChangeSetCommand: /* @__PURE__ */ __name(() => ExecuteChangeSetCommand2, "ExecuteChangeSetCommand"),
|
|
110354
|
-
ExecuteStackRefactorCommand: /* @__PURE__ */ __name(() =>
|
|
110359
|
+
ExecuteStackRefactorCommand: /* @__PURE__ */ __name(() => ExecuteStackRefactorCommand2, "ExecuteStackRefactorCommand"),
|
|
110355
110360
|
ExecutionStatus: /* @__PURE__ */ __name(() => ExecutionStatus, "ExecutionStatus"),
|
|
110356
110361
|
GeneratedTemplateDeletionPolicy: /* @__PURE__ */ __name(() => GeneratedTemplateDeletionPolicy, "GeneratedTemplateDeletionPolicy"),
|
|
110357
110362
|
GeneratedTemplateNotFoundException: /* @__PURE__ */ __name(() => GeneratedTemplateNotFoundException, "GeneratedTemplateNotFoundException"),
|
|
@@ -110514,8 +110519,8 @@ var require_dist_cjs56 = __commonJS({
|
|
|
110514
110519
|
waitUntilStackDeleteComplete: /* @__PURE__ */ __name(() => waitUntilStackDeleteComplete, "waitUntilStackDeleteComplete"),
|
|
110515
110520
|
waitUntilStackExists: /* @__PURE__ */ __name(() => waitUntilStackExists, "waitUntilStackExists"),
|
|
110516
110521
|
waitUntilStackImportComplete: /* @__PURE__ */ __name(() => waitUntilStackImportComplete, "waitUntilStackImportComplete"),
|
|
110517
|
-
waitUntilStackRefactorCreateComplete: /* @__PURE__ */ __name(() =>
|
|
110518
|
-
waitUntilStackRefactorExecuteComplete: /* @__PURE__ */ __name(() =>
|
|
110522
|
+
waitUntilStackRefactorCreateComplete: /* @__PURE__ */ __name(() => waitUntilStackRefactorCreateComplete2, "waitUntilStackRefactorCreateComplete"),
|
|
110523
|
+
waitUntilStackRefactorExecuteComplete: /* @__PURE__ */ __name(() => waitUntilStackRefactorExecuteComplete2, "waitUntilStackRefactorExecuteComplete"),
|
|
110519
110524
|
waitUntilStackRollbackComplete: /* @__PURE__ */ __name(() => waitUntilStackRollbackComplete, "waitUntilStackRollbackComplete"),
|
|
110520
110525
|
waitUntilStackUpdateComplete: /* @__PURE__ */ __name(() => waitUntilStackUpdateComplete, "waitUntilStackUpdateComplete"),
|
|
110521
110526
|
waitUntilTypeRegistrationComplete: /* @__PURE__ */ __name(() => waitUntilTypeRegistrationComplete, "waitUntilTypeRegistrationComplete")
|
|
@@ -120607,7 +120612,7 @@ var require_dist_cjs56 = __commonJS({
|
|
|
120607
120612
|
__name2(this, "CreateStackInstancesCommand");
|
|
120608
120613
|
}
|
|
120609
120614
|
};
|
|
120610
|
-
var
|
|
120615
|
+
var CreateStackRefactorCommand2 = class extends import_smithy_client28.Command.classBuilder().ep(commonParams3).m(function(Command, cs, config, o3) {
|
|
120611
120616
|
return [
|
|
120612
120617
|
(0, import_middleware_serde5.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
120613
120618
|
(0, import_middleware_endpoint8.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
@@ -121049,7 +121054,7 @@ var require_dist_cjs56 = __commonJS({
|
|
|
121049
121054
|
__name2(this, "ExecuteChangeSetCommand");
|
|
121050
121055
|
}
|
|
121051
121056
|
};
|
|
121052
|
-
var
|
|
121057
|
+
var ExecuteStackRefactorCommand2 = class extends import_smithy_client28.Command.classBuilder().ep(commonParams3).m(function(Command, cs, config, o3) {
|
|
121053
121058
|
return [
|
|
121054
121059
|
(0, import_middleware_serde5.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
121055
121060
|
(0, import_middleware_endpoint8.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
@@ -121644,7 +121649,7 @@ var require_dist_cjs56 = __commonJS({
|
|
|
121644
121649
|
CreateGeneratedTemplateCommand: CreateGeneratedTemplateCommand2,
|
|
121645
121650
|
CreateStackCommand: CreateStackCommand2,
|
|
121646
121651
|
CreateStackInstancesCommand,
|
|
121647
|
-
CreateStackRefactorCommand,
|
|
121652
|
+
CreateStackRefactorCommand: CreateStackRefactorCommand2,
|
|
121648
121653
|
CreateStackSetCommand,
|
|
121649
121654
|
DeactivateOrganizationsAccessCommand,
|
|
121650
121655
|
DeactivateTypeCommand,
|
|
@@ -121678,7 +121683,7 @@ var require_dist_cjs56 = __commonJS({
|
|
|
121678
121683
|
DetectStackSetDriftCommand,
|
|
121679
121684
|
EstimateTemplateCostCommand,
|
|
121680
121685
|
ExecuteChangeSetCommand: ExecuteChangeSetCommand2,
|
|
121681
|
-
ExecuteStackRefactorCommand,
|
|
121686
|
+
ExecuteStackRefactorCommand: ExecuteStackRefactorCommand2,
|
|
121682
121687
|
GetGeneratedTemplateCommand: GetGeneratedTemplateCommand2,
|
|
121683
121688
|
GetStackPolicyCommand,
|
|
121684
121689
|
GetTemplateCommand: GetTemplateCommand2,
|
|
@@ -122362,7 +122367,7 @@ var require_dist_cjs56 = __commonJS({
|
|
|
122362
122367
|
const serviceDefaults = { minDelay: 5, maxDelay: 120 };
|
|
122363
122368
|
return (0, import_util_waiter.createWaiter)({ ...serviceDefaults, ...params }, input, checkState6);
|
|
122364
122369
|
}, "waitForStackRefactorCreateComplete");
|
|
122365
|
-
var
|
|
122370
|
+
var waitUntilStackRefactorCreateComplete2 = /* @__PURE__ */ __name2(async (params, input) => {
|
|
122366
122371
|
const serviceDefaults = { minDelay: 5, maxDelay: 120 };
|
|
122367
122372
|
const result2 = await (0, import_util_waiter.createWaiter)({ ...serviceDefaults, ...params }, input, checkState6);
|
|
122368
122373
|
return (0, import_util_waiter.checkExceptions)(result2);
|
|
@@ -122411,7 +122416,7 @@ var require_dist_cjs56 = __commonJS({
|
|
|
122411
122416
|
const serviceDefaults = { minDelay: 15, maxDelay: 120 };
|
|
122412
122417
|
return (0, import_util_waiter.createWaiter)({ ...serviceDefaults, ...params }, input, checkState7);
|
|
122413
122418
|
}, "waitForStackRefactorExecuteComplete");
|
|
122414
|
-
var
|
|
122419
|
+
var waitUntilStackRefactorExecuteComplete2 = /* @__PURE__ */ __name2(async (params, input) => {
|
|
122415
122420
|
const serviceDefaults = { minDelay: 15, maxDelay: 120 };
|
|
122416
122421
|
const result2 = await (0, import_util_waiter.createWaiter)({ ...serviceDefaults, ...params }, input, checkState7);
|
|
122417
122422
|
return (0, import_util_waiter.checkExceptions)(result2);
|
|
@@ -305502,7 +305507,35 @@ var init_sdk = __esm({
|
|
|
305502
305507
|
stackResources.push(...page?.StackSummaries || []);
|
|
305503
305508
|
}
|
|
305504
305509
|
return stackResources;
|
|
305505
|
-
}, "paginatedListStacks")
|
|
305510
|
+
}, "paginatedListStacks"),
|
|
305511
|
+
createStackRefactor: /* @__PURE__ */ __name((input) => {
|
|
305512
|
+
return client.send(new import_client_cloudformation.CreateStackRefactorCommand(input));
|
|
305513
|
+
}, "createStackRefactor"),
|
|
305514
|
+
executeStackRefactor: /* @__PURE__ */ __name((input) => {
|
|
305515
|
+
return client.send(new import_client_cloudformation.ExecuteStackRefactorCommand(input));
|
|
305516
|
+
}, "executeStackRefactor"),
|
|
305517
|
+
waitUntilStackRefactorCreateComplete: /* @__PURE__ */ __name((input) => {
|
|
305518
|
+
return (0, import_client_cloudformation.waitUntilStackRefactorCreateComplete)(
|
|
305519
|
+
{
|
|
305520
|
+
client,
|
|
305521
|
+
maxWaitTime: 600,
|
|
305522
|
+
minDelay: 6,
|
|
305523
|
+
maxDelay: 6
|
|
305524
|
+
},
|
|
305525
|
+
input
|
|
305526
|
+
);
|
|
305527
|
+
}, "waitUntilStackRefactorCreateComplete"),
|
|
305528
|
+
waitUntilStackRefactorExecuteComplete: /* @__PURE__ */ __name((input) => {
|
|
305529
|
+
return (0, import_client_cloudformation.waitUntilStackRefactorExecuteComplete)(
|
|
305530
|
+
{
|
|
305531
|
+
client,
|
|
305532
|
+
maxWaitTime: 600,
|
|
305533
|
+
minDelay: 6,
|
|
305534
|
+
maxDelay: 6
|
|
305535
|
+
},
|
|
305536
|
+
input
|
|
305537
|
+
);
|
|
305538
|
+
}, "waitUntilStackRefactorExecuteComplete")
|
|
305506
305539
|
};
|
|
305507
305540
|
}
|
|
305508
305541
|
cloudWatchLogs() {
|
|
@@ -311239,7 +311272,7 @@ var init_notices = __esm({
|
|
|
311239
311272
|
* Refresh the list of notices this instance is aware of.
|
|
311240
311273
|
*
|
|
311241
311274
|
* This method throws an error if the data source fails to fetch notices.
|
|
311242
|
-
* When using, consider if execution should halt immdiately or if catching the
|
|
311275
|
+
* When using, consider if execution should halt immdiately or if catching the error and continuing is more appropriate
|
|
311243
311276
|
*
|
|
311244
311277
|
* @throws on failure to refresh the data source
|
|
311245
311278
|
*/
|
|
@@ -315612,10 +315645,14 @@ function equalSets(a3, b3) {
|
|
|
315612
315645
|
}
|
|
315613
315646
|
return true;
|
|
315614
315647
|
}
|
|
315648
|
+
function setDiff(a3, b3) {
|
|
315649
|
+
return new Set(Array.from(a3).filter((x3) => !b3.has(x3)));
|
|
315650
|
+
}
|
|
315615
315651
|
var init_sets = __esm({
|
|
315616
315652
|
"../toolkit-lib/lib/util/sets.ts"() {
|
|
315617
315653
|
"use strict";
|
|
315618
315654
|
__name(equalSets, "equalSets");
|
|
315655
|
+
__name(setDiff, "setDiff");
|
|
315619
315656
|
}
|
|
315620
315657
|
});
|
|
315621
315658
|
|
|
@@ -329453,6 +329490,8 @@ function formatAmbiguousMappings(stream2, pairs) {
|
|
|
329453
329490
|
formatter.print("Detected ambiguities:");
|
|
329454
329491
|
formatter.print(tables.join("\n\n"));
|
|
329455
329492
|
formatter.print(" ");
|
|
329493
|
+
formatter.print(chalk11.yellow("Please provide an override file to resolve these ambiguous mappings."));
|
|
329494
|
+
formatter.print(" ");
|
|
329456
329495
|
function renderTable([removed, added]) {
|
|
329457
329496
|
return formatTable([["", "Resource"], renderRemoval(removed), renderAddition(added)], void 0);
|
|
329458
329497
|
}
|
|
@@ -332880,6 +332919,9 @@ var init_cloudformation3 = __esm({
|
|
|
332880
332919
|
equalTo(other) {
|
|
332881
332920
|
return this.logicalResourceId === other.logicalResourceId && this.stack.stackName === other.stack.stackName;
|
|
332882
332921
|
}
|
|
332922
|
+
get stackName() {
|
|
332923
|
+
return this.stack.stackName;
|
|
332924
|
+
}
|
|
332883
332925
|
};
|
|
332884
332926
|
ResourceMapping = class {
|
|
332885
332927
|
constructor(source, destination) {
|
|
@@ -332898,6 +332940,18 @@ var init_cloudformation3 = __esm({
|
|
|
332898
332940
|
destinationPath: this.destination.toPath()
|
|
332899
332941
|
};
|
|
332900
332942
|
}
|
|
332943
|
+
toCloudFormation() {
|
|
332944
|
+
return {
|
|
332945
|
+
Source: {
|
|
332946
|
+
StackName: this.source.stack.stackName,
|
|
332947
|
+
LogicalResourceId: this.source.logicalResourceId
|
|
332948
|
+
},
|
|
332949
|
+
Destination: {
|
|
332950
|
+
StackName: this.destination.stack.stackName,
|
|
332951
|
+
LogicalResourceId: this.destination.logicalResourceId
|
|
332952
|
+
}
|
|
332953
|
+
};
|
|
332954
|
+
}
|
|
332901
332955
|
};
|
|
332902
332956
|
}
|
|
332903
332957
|
});
|
|
@@ -332947,15 +333001,17 @@ var init_graph = __esm({
|
|
|
332947
333001
|
}
|
|
332948
333002
|
if ("Fn::ImportValue" in value) {
|
|
332949
333003
|
const exp = exports2[value["Fn::ImportValue"]];
|
|
332950
|
-
|
|
332951
|
-
|
|
332952
|
-
|
|
332953
|
-
|
|
332954
|
-
|
|
332955
|
-
|
|
332956
|
-
|
|
333004
|
+
if (exp != null) {
|
|
333005
|
+
const v6 = exp.value;
|
|
333006
|
+
if ("Fn::GetAtt" in v6) {
|
|
333007
|
+
const id = Array.isArray(v6["Fn::GetAtt"]) ? v6["Fn::GetAtt"][0] : v6["Fn::GetAtt"].split(".")[0];
|
|
333008
|
+
return [`${exp.stackName}.${id}`];
|
|
333009
|
+
}
|
|
333010
|
+
if ("Ref" in v6) {
|
|
333011
|
+
return [`${exp.stackName}.${v6.Ref}`];
|
|
333012
|
+
}
|
|
333013
|
+
return [`${exp.stackName}.${v6}`];
|
|
332957
333014
|
}
|
|
332958
|
-
return [`${exp.stackName}.${v6}`];
|
|
332959
333015
|
}
|
|
332960
333016
|
const result2 = [];
|
|
332961
333017
|
if ("DependsOn" in value) {
|
|
@@ -333096,11 +333152,14 @@ function stripReferences(value, exports2) {
|
|
|
333096
333152
|
return { __cloud_ref__: "DependsOn" };
|
|
333097
333153
|
}
|
|
333098
333154
|
if ("Fn::ImportValue" in value) {
|
|
333099
|
-
const
|
|
333100
|
-
if (
|
|
333101
|
-
|
|
333102
|
-
|
|
333103
|
-
|
|
333155
|
+
const exp = exports2[value["Fn::ImportValue"]];
|
|
333156
|
+
if (exp != null) {
|
|
333157
|
+
const v6 = exp.value;
|
|
333158
|
+
if ("Ref" in v6) {
|
|
333159
|
+
return { __cloud_ref__: "Ref" };
|
|
333160
|
+
} else if ("Fn::GetAtt" in v6) {
|
|
333161
|
+
return { __cloud_ref__: "Fn::GetAtt" };
|
|
333162
|
+
}
|
|
333104
333163
|
}
|
|
333105
333164
|
}
|
|
333106
333165
|
const result2 = {};
|
|
@@ -333149,14 +333208,30 @@ function structuralOverrides(deployedStacks, localStacks) {
|
|
|
333149
333208
|
function resourceMoves(before, after, direction = "direct", ignoreModifications = false) {
|
|
333150
333209
|
const digestsBefore = resourceDigests(before, direction);
|
|
333151
333210
|
const digestsAfter = resourceDigests(after, direction);
|
|
333152
|
-
const stackNames = /* @__PURE__ */ __name((stacks) => stacks.map((s3) => s3.stackName).sort().join(", "), "stackNames");
|
|
333153
333211
|
if (!(ignoreModifications || isomorphic(digestsBefore, digestsAfter))) {
|
|
333154
|
-
const message2 = [
|
|
333155
|
-
|
|
333156
|
-
|
|
333157
|
-
|
|
333158
|
-
|
|
333159
|
-
|
|
333212
|
+
const message2 = ["A refactor operation cannot add, remove or update resources. Only resource moves and renames are allowed."];
|
|
333213
|
+
const difference2 = /* @__PURE__ */ __name((a3, b3) => {
|
|
333214
|
+
return Array.from(setDiff(new Set(Object.keys(a3)), new Set(Object.keys(b3)))).flatMap((k3) => a3[k3]).map((x3) => ` - ${x3.toPath()}`).sort().join("\n");
|
|
333215
|
+
}, "difference");
|
|
333216
|
+
const stackNames = /* @__PURE__ */ __name((stacks) => stacks.length === 0 ? "NONE" : stacks.map((s3) => s3.stackName).sort().join(", "), "stackNames");
|
|
333217
|
+
const onlyDeployed = difference2(digestsBefore, digestsAfter);
|
|
333218
|
+
const onlyLocal = difference2(digestsAfter, digestsBefore);
|
|
333219
|
+
if (onlyDeployed.length > 0) {
|
|
333220
|
+
message2.push(`The following resources are present only in the AWS environment:
|
|
333221
|
+
${onlyDeployed}`);
|
|
333222
|
+
}
|
|
333223
|
+
if (onlyLocal.length > 0) {
|
|
333224
|
+
message2.push(`
|
|
333225
|
+
The following resources are present only in your CDK application:
|
|
333226
|
+
${onlyLocal}`);
|
|
333227
|
+
}
|
|
333228
|
+
message2.push("");
|
|
333229
|
+
message2.push("The following stacks were used in the comparison:");
|
|
333230
|
+
message2.push(` - Deployed: ${stackNames(before)}`);
|
|
333231
|
+
message2.push(` - Local: ${stackNames(after)}`);
|
|
333232
|
+
message2.push("");
|
|
333233
|
+
message2.push("Hint: by default, only deployed stacks that have the same name as a local stack are included.");
|
|
333234
|
+
message2.push("If you want to include additional deployed stacks for comparison, re-run the command with the option '--additional-stack-name=<STACK>' for each stack.");
|
|
333160
333235
|
throw new ToolkitError(message2.join("\n"));
|
|
333161
333236
|
}
|
|
333162
333237
|
return Object.values(removeUnmovedResources(zip(digestsBefore, digestsAfter)));
|
|
@@ -333263,20 +333338,49 @@ function partitionByAmbiguity(overrides, moves) {
|
|
|
333263
333338
|
__name(remove, "remove");
|
|
333264
333339
|
return [nonAmbiguous, ambiguous];
|
|
333265
333340
|
}
|
|
333266
|
-
|
|
333341
|
+
async function replaceAwsPlaceholders2(object, aws) {
|
|
333342
|
+
let partition = /* @__PURE__ */ __name(async () => {
|
|
333343
|
+
const p3 = await aws.discoverPartition();
|
|
333344
|
+
partition = /* @__PURE__ */ __name(() => Promise.resolve(p3), "partition");
|
|
333345
|
+
return p3;
|
|
333346
|
+
}, "partition");
|
|
333347
|
+
let account = /* @__PURE__ */ __name(async () => {
|
|
333348
|
+
const a3 = await aws.discoverCurrentAccount();
|
|
333349
|
+
account = /* @__PURE__ */ __name(() => Promise.resolve(a3), "account");
|
|
333350
|
+
return a3;
|
|
333351
|
+
}, "account");
|
|
333352
|
+
return import_cx_api10.EnvironmentPlaceholders.replaceAsync(object, {
|
|
333353
|
+
async region() {
|
|
333354
|
+
return object.region ?? aws.discoverDefaultRegion();
|
|
333355
|
+
},
|
|
333356
|
+
async accountId() {
|
|
333357
|
+
return (await account()).accountId;
|
|
333358
|
+
},
|
|
333359
|
+
async partition() {
|
|
333360
|
+
return partition();
|
|
333361
|
+
}
|
|
333362
|
+
});
|
|
333363
|
+
}
|
|
333364
|
+
var import_cdk_assets_lib4, import_cx_api10, RefactoringContext;
|
|
333267
333365
|
var init_context3 = __esm({
|
|
333268
333366
|
"../toolkit-lib/lib/api/refactoring/context.ts"() {
|
|
333269
333367
|
"use strict";
|
|
333368
|
+
import_cdk_assets_lib4 = __toESM(require_lib8());
|
|
333369
|
+
import_cx_api10 = __toESM(require_lib3());
|
|
333270
333370
|
init_cloudformation3();
|
|
333271
333371
|
init_digest();
|
|
333272
333372
|
init_toolkit_error();
|
|
333273
333373
|
init_sets();
|
|
333374
|
+
init_environment();
|
|
333375
|
+
init_plugin2();
|
|
333274
333376
|
RefactoringContext = class {
|
|
333275
333377
|
static {
|
|
333276
333378
|
__name(this, "RefactoringContext");
|
|
333277
333379
|
}
|
|
333278
333380
|
_mappings = [];
|
|
333279
333381
|
ambiguousMoves = [];
|
|
333382
|
+
localStacks;
|
|
333383
|
+
assumeRoleArn;
|
|
333280
333384
|
environment;
|
|
333281
333385
|
constructor(props) {
|
|
333282
333386
|
this.environment = props.environment;
|
|
@@ -333285,6 +333389,8 @@ var init_context3 = __esm({
|
|
|
333285
333389
|
const overrides = (props.overrides ?? []).concat(additionalOverrides);
|
|
333286
333390
|
const [nonAmbiguousMoves, ambiguousMoves] = partitionByAmbiguity(overrides, moves);
|
|
333287
333391
|
this.ambiguousMoves = ambiguousMoves;
|
|
333392
|
+
this.localStacks = props.localStacks;
|
|
333393
|
+
this.assumeRoleArn = props.assumeRoleArn;
|
|
333288
333394
|
this._mappings = resourceMappings(nonAmbiguousMoves);
|
|
333289
333395
|
}
|
|
333290
333396
|
get ambiguousPaths() {
|
|
@@ -333297,6 +333403,68 @@ var init_context3 = __esm({
|
|
|
333297
333403
|
get mappings() {
|
|
333298
333404
|
return this._mappings;
|
|
333299
333405
|
}
|
|
333406
|
+
async execute(stackDefinitions, sdkProvider, ioHelper) {
|
|
333407
|
+
if (this.mappings.length === 0) {
|
|
333408
|
+
return;
|
|
333409
|
+
}
|
|
333410
|
+
const assumeRoleArn = this.assumeRoleArn ?? await this.findRoleToAssume(sdkProvider);
|
|
333411
|
+
const sdk = (await sdkProvider.forEnvironment(this.environment, 1 /* ForWriting */, {
|
|
333412
|
+
assumeRoleArn
|
|
333413
|
+
})).sdk;
|
|
333414
|
+
await this.checkBootstrapVersion(sdk, ioHelper);
|
|
333415
|
+
const cfn = sdk.cloudFormation();
|
|
333416
|
+
const mappings = this.mappings;
|
|
333417
|
+
const input = {
|
|
333418
|
+
ResourceMappings: mappings.map((m3) => m3.toCloudFormation()),
|
|
333419
|
+
StackDefinitions: stackDefinitions
|
|
333420
|
+
};
|
|
333421
|
+
const refactor = await cfn.createStackRefactor(input);
|
|
333422
|
+
await cfn.waitUntilStackRefactorCreateComplete({
|
|
333423
|
+
StackRefactorId: refactor.StackRefactorId
|
|
333424
|
+
});
|
|
333425
|
+
await cfn.executeStackRefactor({
|
|
333426
|
+
StackRefactorId: refactor.StackRefactorId
|
|
333427
|
+
});
|
|
333428
|
+
await cfn.waitUntilStackRefactorExecuteComplete({
|
|
333429
|
+
StackRefactorId: refactor.StackRefactorId
|
|
333430
|
+
});
|
|
333431
|
+
}
|
|
333432
|
+
async checkBootstrapVersion(sdk, ioHelper) {
|
|
333433
|
+
const environmentResourcesRegistry = new EnvironmentResourcesRegistry();
|
|
333434
|
+
const envResources = environmentResourcesRegistry.for(this.environment, sdk, ioHelper);
|
|
333435
|
+
let bootstrapVersion = void 0;
|
|
333436
|
+
try {
|
|
333437
|
+
bootstrapVersion = (await envResources.lookupToolkit()).version;
|
|
333438
|
+
} catch (e3) {
|
|
333439
|
+
}
|
|
333440
|
+
if (bootstrapVersion != null && bootstrapVersion < 28) {
|
|
333441
|
+
const environment = `aws://${this.environment.account}/${this.environment.region}`;
|
|
333442
|
+
throw new ToolkitError(
|
|
333443
|
+
`The CDK toolkit stack in environment ${environment} doesn't support refactoring. Please run 'cdk bootstrap ${environment}' to update it.`
|
|
333444
|
+
);
|
|
333445
|
+
}
|
|
333446
|
+
}
|
|
333447
|
+
async findRoleToAssume(sdkProvider) {
|
|
333448
|
+
const env = this.environment;
|
|
333449
|
+
const roleArns = new Set(
|
|
333450
|
+
this.localStacks.filter((s3) => s3.environment.account === env.account && s3.environment.region === env.region).map((s3) => s3.assumeRoleArn)
|
|
333451
|
+
);
|
|
333452
|
+
if (roleArns.size === 0) {
|
|
333453
|
+
return void 0;
|
|
333454
|
+
}
|
|
333455
|
+
if (roleArns.size !== 1) {
|
|
333456
|
+
throw new ToolkitError(
|
|
333457
|
+
`Multiple stacks in environment aws://${env.account}/${env.region} have different deployment role ARNs. Cannot proceed.`
|
|
333458
|
+
);
|
|
333459
|
+
}
|
|
333460
|
+
const arn = Array.from(roleArns)[0];
|
|
333461
|
+
if (arn != null) {
|
|
333462
|
+
const resolvedEnv = await sdkProvider.resolveEnvironment(env);
|
|
333463
|
+
const region = resolvedEnv.region;
|
|
333464
|
+
return (await replaceAwsPlaceholders2({ region, assumeRoleArn: arn }, new import_cdk_assets_lib4.DefaultAwsClient())).assumeRoleArn;
|
|
333465
|
+
}
|
|
333466
|
+
return void 0;
|
|
333467
|
+
}
|
|
333300
333468
|
};
|
|
333301
333469
|
__name(structuralOverrides, "structuralOverrides");
|
|
333302
333470
|
__name(resourceMoves, "resourceMoves");
|
|
@@ -333307,6 +333475,7 @@ var init_context3 = __esm({
|
|
|
333307
333475
|
__name(isAmbiguousMove, "isAmbiguousMove");
|
|
333308
333476
|
__name(resourceMappings, "resourceMappings");
|
|
333309
333477
|
__name(partitionByAmbiguity, "partitionByAmbiguity");
|
|
333478
|
+
__name(replaceAwsPlaceholders2, "replaceAwsPlaceholders");
|
|
333310
333479
|
}
|
|
333311
333480
|
});
|
|
333312
333481
|
|
|
@@ -333732,14 +333901,14 @@ function bootstrapVersionFromTemplate(template) {
|
|
|
333732
333901
|
function bootstrapVariantFromTemplate(template) {
|
|
333733
333902
|
return template.Parameters?.[BOOTSTRAP_VARIANT_PARAMETER]?.Default ?? DEFAULT_BOOTSTRAP_VARIANT;
|
|
333734
333903
|
}
|
|
333735
|
-
var os8, path22, import_cloud_assembly_schema7,
|
|
333904
|
+
var os8, path22, import_cloud_assembly_schema7, import_cx_api11, fs25, BootstrapStack;
|
|
333736
333905
|
var init_deploy_bootstrap = __esm({
|
|
333737
333906
|
"../toolkit-lib/lib/api/bootstrap/deploy-bootstrap.ts"() {
|
|
333738
333907
|
"use strict";
|
|
333739
333908
|
os8 = __toESM(require("os"));
|
|
333740
333909
|
path22 = __toESM(require("path"));
|
|
333741
333910
|
import_cloud_assembly_schema7 = __toESM(require_lib2());
|
|
333742
|
-
|
|
333911
|
+
import_cx_api11 = __toESM(require_lib3());
|
|
333743
333912
|
fs25 = __toESM(require_lib6());
|
|
333744
333913
|
init_bootstrap_props();
|
|
333745
333914
|
init_deployments2();
|
|
@@ -333809,14 +333978,14 @@ var init_deploy_bootstrap = __esm({
|
|
|
333809
333978
|
}
|
|
333810
333979
|
}
|
|
333811
333980
|
const outdir = await fs25.mkdtemp(path22.join(os8.tmpdir(), "cdk-bootstrap"));
|
|
333812
|
-
const builder = new
|
|
333981
|
+
const builder = new import_cx_api11.CloudAssemblyBuilder(outdir);
|
|
333813
333982
|
const templateFile = `${this.toolkitStackName}.template.json`;
|
|
333814
333983
|
await fs25.writeJson(path22.join(builder.outdir, templateFile), template, {
|
|
333815
333984
|
spaces: 2
|
|
333816
333985
|
});
|
|
333817
333986
|
builder.addArtifact(this.toolkitStackName, {
|
|
333818
333987
|
type: import_cloud_assembly_schema7.ArtifactType.AWS_CLOUDFORMATION_STACK,
|
|
333819
|
-
environment:
|
|
333988
|
+
environment: import_cx_api11.EnvironmentUtils.format(this.resolvedEnvironment.account, this.resolvedEnvironment.region),
|
|
333820
333989
|
properties: {
|
|
333821
333990
|
templateFile,
|
|
333822
333991
|
terminationProtection: options.terminationProtection ?? false
|
|
@@ -335553,6 +335722,59 @@ var init_logs_monitor3 = __esm({
|
|
|
335553
335722
|
}
|
|
335554
335723
|
});
|
|
335555
335724
|
|
|
335725
|
+
// ../toolkit-lib/lib/api/refactoring/stack-definitions.ts
|
|
335726
|
+
function generateStackDefinitions(mappings, deployedStacks, localStacks) {
|
|
335727
|
+
const deployedStackMap = new Map(deployedStacks.map((s3) => [s3.stackName, s3]));
|
|
335728
|
+
for (const localStack of localStacks) {
|
|
335729
|
+
const deployedStack = deployedStackMap.get(localStack.stackName);
|
|
335730
|
+
const localTemplate = localStack.template;
|
|
335731
|
+
const deployedTemplate = deployedStack?.template;
|
|
335732
|
+
if (deployedTemplate?.Resources?.CDKMetadata != null) {
|
|
335733
|
+
localTemplate.Resources = localTemplate.Resources ?? {};
|
|
335734
|
+
localTemplate.Resources.CDKMetadata = deployedTemplate.Resources.CDKMetadata;
|
|
335735
|
+
} else {
|
|
335736
|
+
delete localTemplate.Resources?.CDKMetadata;
|
|
335737
|
+
}
|
|
335738
|
+
}
|
|
335739
|
+
const stacksToProcess = localStacks.filter((localStack) => {
|
|
335740
|
+
const deployedStack = deployedStackMap.get(localStack.stackName);
|
|
335741
|
+
return !deployedStack || !deepEqual4(localStack.template, deployedStack.template);
|
|
335742
|
+
});
|
|
335743
|
+
for (let mapping of mappings) {
|
|
335744
|
+
const stackName = mapping.source.stackName;
|
|
335745
|
+
if (!localStacks.some((s3) => s3.stackName === stackName)) {
|
|
335746
|
+
const deployedStack = deployedStackMap.get(stackName);
|
|
335747
|
+
delete deployedStack?.template.Resources?.[mapping.source.logicalResourceId];
|
|
335748
|
+
delete deployedStack?.template.Outputs;
|
|
335749
|
+
if (deployedStack && !stacksToProcess.some((s3) => s3.stackName === stackName)) {
|
|
335750
|
+
stacksToProcess.push(deployedStack);
|
|
335751
|
+
}
|
|
335752
|
+
}
|
|
335753
|
+
}
|
|
335754
|
+
for (const stack of stacksToProcess) {
|
|
335755
|
+
if (!deployedStacks.some((deployed) => deployed.stackName === stack.stackName)) {
|
|
335756
|
+
if ("Rules" in stack.template) {
|
|
335757
|
+
delete stack.template.Rules;
|
|
335758
|
+
}
|
|
335759
|
+
if ("Parameters" in stack.template) {
|
|
335760
|
+
delete stack.template.Parameters;
|
|
335761
|
+
}
|
|
335762
|
+
}
|
|
335763
|
+
}
|
|
335764
|
+
return stacksToProcess.map((stack) => ({
|
|
335765
|
+
StackName: stack.stackName,
|
|
335766
|
+
TemplateBody: JSON.stringify(stack.template)
|
|
335767
|
+
}));
|
|
335768
|
+
}
|
|
335769
|
+
var deepEqual4;
|
|
335770
|
+
var init_stack_definitions = __esm({
|
|
335771
|
+
"../toolkit-lib/lib/api/refactoring/stack-definitions.ts"() {
|
|
335772
|
+
"use strict";
|
|
335773
|
+
deepEqual4 = require_fast_deep_equal();
|
|
335774
|
+
__name(generateStackDefinitions, "generateStackDefinitions");
|
|
335775
|
+
}
|
|
335776
|
+
});
|
|
335777
|
+
|
|
335556
335778
|
// ../toolkit-lib/lib/api/tags/private/util.ts
|
|
335557
335779
|
function tagsForStack(stack) {
|
|
335558
335780
|
return Object.entries(stack.tags).map(([Key, Value]) => ({ Key, Value }));
|
|
@@ -335944,11 +336166,11 @@ function stacksFromAssets(artifacts) {
|
|
|
335944
336166
|
function onlyStacks(artifacts) {
|
|
335945
336167
|
return artifacts.filter((x3) => cxapi7.CloudFormationStackArtifact.isCloudFormationStackArtifact(x3));
|
|
335946
336168
|
}
|
|
335947
|
-
var
|
|
336169
|
+
var import_cdk_assets_lib5, cxapi7, WorkGraphBuilder;
|
|
335948
336170
|
var init_work_graph_builder = __esm({
|
|
335949
336171
|
"../toolkit-lib/lib/api/work-graph/work-graph-builder.ts"() {
|
|
335950
336172
|
"use strict";
|
|
335951
|
-
|
|
336173
|
+
import_cdk_assets_lib5 = __toESM(require_lib8());
|
|
335952
336174
|
cxapi7 = __toESM(require_lib3());
|
|
335953
336175
|
init_work_graph();
|
|
335954
336176
|
init_work_graph_types();
|
|
@@ -336045,7 +336267,7 @@ var init_work_graph_builder = __esm({
|
|
|
336045
336267
|
if (cxapi7.CloudFormationStackArtifact.isCloudFormationStackArtifact(artifact)) {
|
|
336046
336268
|
this.addStack(artifact);
|
|
336047
336269
|
} else if (cxapi7.AssetManifestArtifact.isAssetManifestArtifact(artifact)) {
|
|
336048
|
-
const manifest =
|
|
336270
|
+
const manifest = import_cdk_assets_lib5.AssetManifest.fromFile(artifact.file);
|
|
336049
336271
|
for (const entry of manifest.entries) {
|
|
336050
336272
|
const parentStack = parentStacks.get(artifact);
|
|
336051
336273
|
if (parentStack === void 0) {
|
|
@@ -336169,6 +336391,7 @@ var init_toolkit = __esm({
|
|
|
336169
336391
|
init_refactoring();
|
|
336170
336392
|
init_cloudformation3();
|
|
336171
336393
|
init_context3();
|
|
336394
|
+
init_stack_definitions();
|
|
336172
336395
|
init_resource_import();
|
|
336173
336396
|
init_private9();
|
|
336174
336397
|
init_toolkit_info();
|
|
@@ -336951,7 +337174,7 @@ ${deployResult.stackArn}`));
|
|
|
336951
337174
|
this.requireUnstableFeature("refactor");
|
|
336952
337175
|
const ioHelper = asIoHelper(this.ioHost, "refactor");
|
|
336953
337176
|
const assembly = __using(_stack, await assemblyFromSource(ioHelper, cx), true);
|
|
336954
|
-
return await this._refactor(assembly, ioHelper, options);
|
|
337177
|
+
return await this._refactor(assembly, ioHelper, cx, options);
|
|
336955
337178
|
} catch (_3) {
|
|
336956
337179
|
var _error = _3, _hasError = true;
|
|
336957
337180
|
} finally {
|
|
@@ -336959,20 +337182,27 @@ ${deployResult.stackArn}`));
|
|
|
336959
337182
|
_promise && await _promise;
|
|
336960
337183
|
}
|
|
336961
337184
|
}
|
|
336962
|
-
async _refactor(assembly, ioHelper, options = {}) {
|
|
336963
|
-
if (!options.dryRun) {
|
|
336964
|
-
throw new ToolkitError("Refactor is not available yet. Too see the proposed changes, use the --dry-run flag.");
|
|
336965
|
-
}
|
|
337185
|
+
async _refactor(assembly, ioHelper, cx, options = {}) {
|
|
336966
337186
|
const sdkProvider = await this.sdkProvider("refactor");
|
|
336967
337187
|
const selectedStacks = await assembly.selectStacksV2(options.stacks ?? ALL_STACKS);
|
|
336968
337188
|
const groups = await groupStacks(sdkProvider, selectedStacks.stackArtifacts, options.additionalStackNames ?? []);
|
|
336969
337189
|
for (let { environment, localStacks, deployedStacks } of groups) {
|
|
336970
337190
|
await ioHelper.defaults.info(formatEnvironmentSectionHeader2(environment));
|
|
337191
|
+
const newStacks = localStacks.filter((s3) => !deployedStacks.map((t3) => t3.stackName).includes(s3.stackName));
|
|
337192
|
+
if (newStacks.length > 0) {
|
|
337193
|
+
let message2 = `The following stack${newStacks.length === 1 ? " is" : "s are"} new: ${newStacks.map((s3) => s3.stackName).join(", ")}
|
|
337194
|
+
`;
|
|
337195
|
+
message2 += "Creation of new stacks is not yet supported by the refactor command. ";
|
|
337196
|
+
message2 += "Please deploy any new stacks separately before refactoring your stacks.";
|
|
337197
|
+
await ioHelper.defaults.error(chalk21.red(message2));
|
|
337198
|
+
continue;
|
|
337199
|
+
}
|
|
336971
337200
|
try {
|
|
336972
337201
|
const context = new RefactoringContext({
|
|
336973
337202
|
environment,
|
|
336974
337203
|
deployedStacks,
|
|
336975
337204
|
localStacks,
|
|
337205
|
+
assumeRoleArn: options.roleArn,
|
|
336976
337206
|
overrides: getOverrides(environment, deployedStacks, localStacks)
|
|
336977
337207
|
});
|
|
336978
337208
|
const mappings = context.mappings;
|
|
@@ -336983,48 +337213,85 @@ ${deployResult.stackArn}`));
|
|
|
336983
337213
|
const typedMappings = mappings.map((m3) => m3.toTypedMapping()).filter((m3) => m3.type !== "AWS::CDK::Metadata");
|
|
336984
337214
|
let refactorMessage = formatTypedMappings2(typedMappings);
|
|
336985
337215
|
const refactorResult = { typedMappings };
|
|
337216
|
+
const stackDefinitions = generateStackDefinitions(mappings, deployedStacks, localStacks);
|
|
336986
337217
|
if (context.ambiguousPaths.length > 0) {
|
|
336987
337218
|
const paths = context.ambiguousPaths;
|
|
336988
337219
|
refactorMessage += "\n" + formatAmbiguousMappings2(paths);
|
|
336989
337220
|
refactorResult.ambiguousPaths = paths;
|
|
336990
337221
|
}
|
|
336991
337222
|
await ioHelper.notify(IO.CDK_TOOLKIT_I8900.msg(refactorMessage, refactorResult));
|
|
337223
|
+
if (options.dryRun || context.mappings.length === 0 || context.ambiguousPaths.length > 0) {
|
|
337224
|
+
continue;
|
|
337225
|
+
}
|
|
337226
|
+
if (process.stdout.isTTY && !await confirm2(options.force ?? false)) {
|
|
337227
|
+
await ioHelper.defaults.info(chalk21.red(`Refactoring canceled for environment aws://${environment.account}/${environment.region}
|
|
337228
|
+
`));
|
|
337229
|
+
continue;
|
|
337230
|
+
}
|
|
337231
|
+
await ioHelper.defaults.info("Refactoring...");
|
|
337232
|
+
await context.execute(stackDefinitions, sdkProvider, ioHelper);
|
|
337233
|
+
await ioHelper.defaults.info("\u2705 Stack refactor complete");
|
|
337234
|
+
await ioHelper.defaults.info("Deploying updated stacks to finalize refactor...");
|
|
337235
|
+
await this.deploy(cx, {
|
|
337236
|
+
stacks: ALL_STACKS,
|
|
337237
|
+
forceDeployment: true
|
|
337238
|
+
});
|
|
336992
337239
|
} catch (e3) {
|
|
336993
|
-
|
|
337240
|
+
const message2 = `\u274C Refactor failed: ${formatError2(e3)}`;
|
|
337241
|
+
await ioHelper.notify(IO.CDK_TOOLKIT_E8900.msg(message2, { error: e3 }));
|
|
337242
|
+
await ioHelper.defaults.debug(e3.message);
|
|
336994
337243
|
}
|
|
336995
337244
|
}
|
|
336996
337245
|
function getOverrides(environment, deployedStacks, localStacks) {
|
|
336997
337246
|
const mappingGroup = options.overrides?.find((g3) => g3.region === environment.region && g3.account === environment.account);
|
|
336998
|
-
|
|
336999
|
-
|
|
337000
|
-
|
|
337001
|
-
|
|
337002
|
-
|
|
337003
|
-
|
|
337004
|
-
|
|
337005
|
-
|
|
337006
|
-
|
|
337007
|
-
|
|
337008
|
-
);
|
|
337009
|
-
}
|
|
337010
|
-
|
|
337011
|
-
|
|
337012
|
-
|
|
337013
|
-
const result2 = stacks.find((stack) => {
|
|
337014
|
-
const [stackName, logicalId] = location.split(".");
|
|
337015
|
-
if (stackName == null || logicalId == null) {
|
|
337016
|
-
throw new ToolkitError(`Invalid location '${location}'`);
|
|
337247
|
+
return mappingGroup == null ? [] : Object.entries(mappingGroup.resources ?? {}).map(([source, destination]) => new ResourceMapping(
|
|
337248
|
+
getResourceLocation(source, deployedStacks),
|
|
337249
|
+
getResourceLocation(destination, localStacks)
|
|
337250
|
+
));
|
|
337251
|
+
}
|
|
337252
|
+
__name(getOverrides, "getOverrides");
|
|
337253
|
+
function getResourceLocation(location, stacks) {
|
|
337254
|
+
for (let stack of stacks) {
|
|
337255
|
+
const [stackName, logicalId] = location.split(".");
|
|
337256
|
+
if (stackName != null && logicalId != null && stack.stackName === stackName && stack.template.Resources?.[logicalId] != null) {
|
|
337257
|
+
return new ResourceLocation(stack, logicalId);
|
|
337258
|
+
} else {
|
|
337259
|
+
const resourceEntry = Object.entries(stack.template.Resources ?? {}).find(([_3, r3]) => r3.Metadata?.["aws:cdk:path"] === location);
|
|
337260
|
+
if (resourceEntry != null) {
|
|
337261
|
+
return new ResourceLocation(stack, resourceEntry[0]);
|
|
337017
337262
|
}
|
|
337018
|
-
return stack.stackName === stackName && stack.template.Resources?.[logicalId] != null;
|
|
337019
|
-
});
|
|
337020
|
-
if (result2 == null) {
|
|
337021
|
-
throw new ToolkitError(`Cannot find resource in location ${location}`);
|
|
337022
337263
|
}
|
|
337023
|
-
return result2;
|
|
337024
337264
|
}
|
|
337025
|
-
|
|
337265
|
+
throw new ToolkitError(`Cannot find resource in location ${location}`);
|
|
337026
337266
|
}
|
|
337027
|
-
__name(
|
|
337267
|
+
__name(getResourceLocation, "getResourceLocation");
|
|
337268
|
+
async function confirm2(force) {
|
|
337269
|
+
if (force) {
|
|
337270
|
+
return true;
|
|
337271
|
+
}
|
|
337272
|
+
const question2 = "Do you wish to refactor these resources?";
|
|
337273
|
+
const response = await ioHelper.requestResponse(IO.CDK_TOOLKIT_I8910.req(question2, {
|
|
337274
|
+
responseDescription: "[Y]es/[n]o"
|
|
337275
|
+
}, "y"));
|
|
337276
|
+
return ["y", "yes"].includes(response.toLowerCase());
|
|
337277
|
+
}
|
|
337278
|
+
__name(confirm2, "confirm");
|
|
337279
|
+
function formatError2(error4) {
|
|
337280
|
+
try {
|
|
337281
|
+
const payload2 = JSON.parse(error4.message);
|
|
337282
|
+
const messages = [];
|
|
337283
|
+
if (payload2.reason?.StatusReason) {
|
|
337284
|
+
messages.push(`Refactor creation: [${payload2.reason?.Status}] ${payload2.reason.StatusReason}`);
|
|
337285
|
+
}
|
|
337286
|
+
if (payload2.reason?.ExecutionStatusReason) {
|
|
337287
|
+
messages.push(`Refactor execution: [${payload2.reason?.Status}] ${payload2.reason.ExecutionStatusReason}`);
|
|
337288
|
+
}
|
|
337289
|
+
return messages.length > 0 ? messages.join("\n") : `Unknown error (Stack refactor ID: ${payload2.reason?.StackRefactorId ?? "unknown"})`;
|
|
337290
|
+
} catch (e3) {
|
|
337291
|
+
return formatErrorMessage(error4);
|
|
337292
|
+
}
|
|
337293
|
+
}
|
|
337294
|
+
__name(formatError2, "formatError");
|
|
337028
337295
|
}
|
|
337029
337296
|
/**
|
|
337030
337297
|
* Destroy Action
|
|
@@ -337654,12 +337921,12 @@ var init_logger = __esm({
|
|
|
337654
337921
|
});
|
|
337655
337922
|
|
|
337656
337923
|
// lib/runner/private/cloud-assembly.ts
|
|
337657
|
-
var path28,
|
|
337924
|
+
var path28, import_cdk_assets_lib6, import_cloud_assembly_schema9, fs31, AssemblyManifestReader;
|
|
337658
337925
|
var init_cloud_assembly3 = __esm({
|
|
337659
337926
|
"lib/runner/private/cloud-assembly.ts"() {
|
|
337660
337927
|
"use strict";
|
|
337661
337928
|
path28 = __toESM(require("path"));
|
|
337662
|
-
|
|
337929
|
+
import_cdk_assets_lib6 = __toESM(require_lib8());
|
|
337663
337930
|
import_cloud_assembly_schema9 = __toESM(require_lib2());
|
|
337664
337931
|
fs31 = __toESM(require_lib4());
|
|
337665
337932
|
AssemblyManifestReader = class _AssemblyManifestReader {
|
|
@@ -337783,7 +338050,7 @@ var init_cloud_assembly3 = __esm({
|
|
|
337783
338050
|
getAssetManifestsForStack(stackId) {
|
|
337784
338051
|
return Object.values(this.manifest.artifacts ?? {}).filter((artifact) => artifact.type === import_cloud_assembly_schema9.ArtifactType.ASSET_MANIFEST && artifact.properties?.file === `${stackId}.assets.json`).map((artifact) => {
|
|
337785
338052
|
const fileName = artifact.properties.file;
|
|
337786
|
-
return
|
|
338053
|
+
return import_cdk_assets_lib6.AssetManifest.fromFile(path28.join(this.directory, fileName));
|
|
337787
338054
|
});
|
|
337788
338055
|
}
|
|
337789
338056
|
/**
|
|
@@ -337809,7 +338076,7 @@ var init_cloud_assembly3 = __esm({
|
|
|
337809
338076
|
assetsFromAssetManifest(artifact) {
|
|
337810
338077
|
const assets = [];
|
|
337811
338078
|
const fileName = artifact.properties.file;
|
|
337812
|
-
const assetManifest =
|
|
338079
|
+
const assetManifest = import_cdk_assets_lib6.AssetManifest.fromFile(path28.join(this.directory, fileName));
|
|
337813
338080
|
assetManifest.entries.forEach((entry) => {
|
|
337814
338081
|
if (entry.type === "file") {
|
|
337815
338082
|
const source = entry.source;
|
|
@@ -337892,12 +338159,12 @@ var init_cloud_assembly3 = __esm({
|
|
|
337892
338159
|
function currentlyRecommendedAwsCdkLibFlags() {
|
|
337893
338160
|
return recommended_feature_flags_exports;
|
|
337894
338161
|
}
|
|
337895
|
-
var path29,
|
|
338162
|
+
var path29, import_cx_api12, fs32, DESTRUCTIVE_CHANGES, IntegRunner, DEFAULT_SYNTH_OPTIONS;
|
|
337896
338163
|
var init_runner_base = __esm({
|
|
337897
338164
|
"lib/runner/runner-base.ts"() {
|
|
337898
338165
|
"use strict";
|
|
337899
338166
|
path29 = __toESM(require("path"));
|
|
337900
|
-
|
|
338167
|
+
import_cx_api12 = __toESM(require_lib3());
|
|
337901
338168
|
fs32 = __toESM(require_lib4());
|
|
337902
338169
|
init_integ_test_suite();
|
|
337903
338170
|
init_recommended_feature_flags();
|
|
@@ -338139,7 +338406,7 @@ var init_runner_base = __esm({
|
|
|
338139
338406
|
...additionalContext,
|
|
338140
338407
|
// We originally had PLANNED to set this to ['aws', 'aws-cn'], but due to a programming mistake
|
|
338141
338408
|
// it was set to everything. In this PR, set it to everything to not mess up all the snapshots.
|
|
338142
|
-
[
|
|
338409
|
+
[import_cx_api12.TARGET_PARTITIONS]: void 0
|
|
338143
338410
|
/* ---------------- THE FUTURE LIVES BELOW----------------------------
|
|
338144
338411
|
// Restricting to these target partitions makes most service principals synthesize to
|
|
338145
338412
|
// `service.${URL_SUFFIX}`, which is technically *incorrect* (it's only `amazonaws.com`
|
|
@@ -338152,7 +338419,7 @@ var init_runner_base = __esm({
|
|
|
338152
338419
|
};
|
|
338153
338420
|
DEFAULT_SYNTH_OPTIONS = {
|
|
338154
338421
|
context: {
|
|
338155
|
-
[
|
|
338422
|
+
[import_cx_api12.AVAILABILITY_ZONE_FALLBACK_CONTEXT_KEY]: ["test-region-1a", "test-region-1b", "test-region-1c"],
|
|
338156
338423
|
"availability-zones:account=12345678:region=test-region": ["test-region-1a", "test-region-1b", "test-region-1c"],
|
|
338157
338424
|
"ssm:account=12345678:parameterName=/aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-gp2:region=test-region": "ami-1234",
|
|
338158
338425
|
"ssm:account=12345678:parameterName=/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2:region=test-region": "ami-1234",
|
package/package.json
CHANGED
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"@aws-cdk/aws-service-spec": "^0.1.94",
|
|
67
67
|
"@aws-cdk/cdk-assets-lib": "1.0.3",
|
|
68
68
|
"@aws-cdk/cdk-cli-wrapper": "0.0.0",
|
|
69
|
-
"@aws-cdk/cloud-assembly-schema": ">=48.
|
|
70
|
-
"@aws-cdk/cloudformation-diff": "2.
|
|
69
|
+
"@aws-cdk/cloud-assembly-schema": ">=48.8.0",
|
|
70
|
+
"@aws-cdk/cloudformation-diff": "2.184.0",
|
|
71
71
|
"@aws-cdk/cx-api": "^2.213.0",
|
|
72
|
-
"@aws-cdk/toolkit-lib": "1.
|
|
72
|
+
"@aws-cdk/toolkit-lib": "1.8.0",
|
|
73
73
|
"@aws-sdk/client-cloudformation": "^3",
|
|
74
|
-
"aws-cdk": "2.
|
|
74
|
+
"aws-cdk": "2.1029.0",
|
|
75
75
|
"chalk": "^4",
|
|
76
76
|
"chokidar": "^3",
|
|
77
77
|
"fs-extra": "^9",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@aws-cdk/aws-service-spec": "0.1.94",
|
|
83
|
-
"aws-cdk": "2.
|
|
83
|
+
"aws-cdk": "2.1029.0"
|
|
84
84
|
},
|
|
85
85
|
"keywords": [
|
|
86
86
|
"aws",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"publishConfig": {
|
|
96
96
|
"access": "public"
|
|
97
97
|
},
|
|
98
|
-
"version": "2.190.
|
|
98
|
+
"version": "2.190.4",
|
|
99
99
|
"types": "lib/index.d.ts",
|
|
100
100
|
"//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\".",
|
|
101
101
|
"optionalDependencies": {
|