@aws-cdk/integ-runner 2.187.0 → 2.187.2
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/index.js +3 -5
- package/lib/recommended-feature-flags.json +2 -1
- package/lib/runner/integ-test-runner.d.ts +6 -2
- package/lib/runner/integ-test-runner.js +53 -44
- package/lib/runner/integ-test-suite.d.ts +1 -1
- package/lib/runner/integ-test-suite.js +3 -3
- package/lib/runner/runner-base.d.ts +22 -17
- package/lib/runner/runner-base.js +40 -26
- package/lib/runner/snapshot-test-runner.d.ts +2 -2
- package/lib/runner/snapshot-test-runner.js +14 -12
- package/lib/utils.d.ts +12 -0
- package/lib/utils.js +15 -1
- package/lib/workers/extract/extract_worker.d.ts +2 -2
- package/lib/workers/extract/extract_worker.js +7 -7
- package/lib/workers/extract/index.js +334 -287
- package/package.json +14 -13
|
@@ -1084,20 +1084,6 @@ var init_synth = __esm({
|
|
|
1084
1084
|
}
|
|
1085
1085
|
});
|
|
1086
1086
|
|
|
1087
|
-
// ../cdk-cli-wrapper/lib/commands/common.ts
|
|
1088
|
-
var RequireApproval;
|
|
1089
|
-
var init_common = __esm({
|
|
1090
|
-
"../cdk-cli-wrapper/lib/commands/common.ts"() {
|
|
1091
|
-
"use strict";
|
|
1092
|
-
RequireApproval = /* @__PURE__ */ ((RequireApproval4) => {
|
|
1093
|
-
RequireApproval4["NEVER"] = "never";
|
|
1094
|
-
RequireApproval4["ANYCHANGE"] = "any-change";
|
|
1095
|
-
RequireApproval4["BROADENING"] = "broadening";
|
|
1096
|
-
return RequireApproval4;
|
|
1097
|
-
})(RequireApproval || {});
|
|
1098
|
-
}
|
|
1099
|
-
});
|
|
1100
|
-
|
|
1101
1087
|
// ../cdk-cli-wrapper/lib/commands/deploy.ts
|
|
1102
1088
|
var HotswapMode, StackActivityProgress;
|
|
1103
1089
|
var init_deploy = __esm({
|
|
@@ -1117,13 +1103,6 @@ var init_deploy = __esm({
|
|
|
1117
1103
|
}
|
|
1118
1104
|
});
|
|
1119
1105
|
|
|
1120
|
-
// ../cdk-cli-wrapper/lib/commands/destroy.ts
|
|
1121
|
-
var init_destroy = __esm({
|
|
1122
|
-
"../cdk-cli-wrapper/lib/commands/destroy.ts"() {
|
|
1123
|
-
"use strict";
|
|
1124
|
-
}
|
|
1125
|
-
});
|
|
1126
|
-
|
|
1127
1106
|
// ../cdk-cli-wrapper/lib/commands/list.ts
|
|
1128
1107
|
var init_list = __esm({
|
|
1129
1108
|
"../cdk-cli-wrapper/lib/commands/list.ts"() {
|
|
@@ -1135,16 +1114,13 @@ var init_list = __esm({
|
|
|
1135
1114
|
var commands_exports = {};
|
|
1136
1115
|
__export(commands_exports, {
|
|
1137
1116
|
HotswapMode: () => HotswapMode,
|
|
1138
|
-
RequireApproval: () => RequireApproval,
|
|
1139
1117
|
StackActivityProgress: () => StackActivityProgress
|
|
1140
1118
|
});
|
|
1141
1119
|
var init_commands = __esm({
|
|
1142
1120
|
"../cdk-cli-wrapper/lib/commands/index.ts"() {
|
|
1143
1121
|
"use strict";
|
|
1144
1122
|
init_synth();
|
|
1145
|
-
init_common();
|
|
1146
1123
|
init_deploy();
|
|
1147
|
-
init_destroy();
|
|
1148
1124
|
init_list();
|
|
1149
1125
|
}
|
|
1150
1126
|
});
|
|
@@ -1256,7 +1232,7 @@ var init_cdk_wrapper = __esm({
|
|
|
1256
1232
|
throw new Error('one of "app" or "stacks" must be provided');
|
|
1257
1233
|
}
|
|
1258
1234
|
}
|
|
1259
|
-
list(options) {
|
|
1235
|
+
async list(options) {
|
|
1260
1236
|
const listCommandArgs = [
|
|
1261
1237
|
...renderBooleanArg("long", options.long),
|
|
1262
1238
|
...this.createDefaultArguments(options)
|
|
@@ -1265,12 +1241,12 @@ var init_cdk_wrapper = __esm({
|
|
|
1265
1241
|
cwd: this.directory,
|
|
1266
1242
|
verbose: this.showOutput,
|
|
1267
1243
|
env: this.env
|
|
1268
|
-
});
|
|
1244
|
+
}).split("\n");
|
|
1269
1245
|
}
|
|
1270
1246
|
/**
|
|
1271
1247
|
* cdk deploy
|
|
1272
1248
|
*/
|
|
1273
|
-
deploy(options) {
|
|
1249
|
+
async deploy(options) {
|
|
1274
1250
|
const deployCommandArgs = [
|
|
1275
1251
|
...renderBooleanArg("ci", options.ci),
|
|
1276
1252
|
...renderBooleanArg("execute", options.execute),
|
|
@@ -1297,7 +1273,7 @@ var init_cdk_wrapper = __esm({
|
|
|
1297
1273
|
env: this.env
|
|
1298
1274
|
});
|
|
1299
1275
|
}
|
|
1300
|
-
watch(options) {
|
|
1276
|
+
async watch(options, events = {}) {
|
|
1301
1277
|
let hotswap;
|
|
1302
1278
|
switch (options.hotswap) {
|
|
1303
1279
|
case "fall-back" /* FALL_BACK */:
|
|
@@ -1332,16 +1308,28 @@ var init_cdk_wrapper = __esm({
|
|
|
1332
1308
|
...options.deploymentMethod ? ["--method", options.deploymentMethod] : [],
|
|
1333
1309
|
...this.createDefaultArguments(options)
|
|
1334
1310
|
];
|
|
1335
|
-
|
|
1311
|
+
const child = watch([this.cdk, "deploy", ...deployCommandArgs], {
|
|
1336
1312
|
cwd: this.directory,
|
|
1337
1313
|
verbose: this.showOutput,
|
|
1338
1314
|
env: this.env
|
|
1339
1315
|
});
|
|
1316
|
+
if (events.onStdout) {
|
|
1317
|
+
child.stdout?.on("data", events.onStdout);
|
|
1318
|
+
}
|
|
1319
|
+
if (events.onStderr) {
|
|
1320
|
+
child.stderr?.on("data", events.onStderr);
|
|
1321
|
+
}
|
|
1322
|
+
child.on("close", (code) => {
|
|
1323
|
+
child.stdin?.end();
|
|
1324
|
+
if (events.onClose) {
|
|
1325
|
+
events.onClose(code);
|
|
1326
|
+
}
|
|
1327
|
+
});
|
|
1340
1328
|
}
|
|
1341
1329
|
/**
|
|
1342
1330
|
* cdk destroy
|
|
1343
1331
|
*/
|
|
1344
|
-
destroy(options) {
|
|
1332
|
+
async destroy(options) {
|
|
1345
1333
|
const destroyCommandArgs = [
|
|
1346
1334
|
...renderBooleanArg("force", options.force),
|
|
1347
1335
|
...renderBooleanArg("exclusively", options.exclusively),
|
|
@@ -1356,7 +1344,7 @@ var init_cdk_wrapper = __esm({
|
|
|
1356
1344
|
/**
|
|
1357
1345
|
* cdk synth
|
|
1358
1346
|
*/
|
|
1359
|
-
synth(options) {
|
|
1347
|
+
async synth(options) {
|
|
1360
1348
|
const synthCommandArgs = [
|
|
1361
1349
|
...renderBooleanArg("validation", options.validation),
|
|
1362
1350
|
...renderBooleanArg("quiet", options.quiet),
|
|
@@ -1375,7 +1363,7 @@ var init_cdk_wrapper = __esm({
|
|
|
1375
1363
|
* The CLI has a pretty slow startup time because of all the modules it needs to load,
|
|
1376
1364
|
* Bypass it to be quicker!
|
|
1377
1365
|
*/
|
|
1378
|
-
synthFast(options) {
|
|
1366
|
+
async synthFast(options) {
|
|
1379
1367
|
exec(options.execCmd, {
|
|
1380
1368
|
cwd: this.directory,
|
|
1381
1369
|
verbose: this.showOutput,
|
|
@@ -1749,6 +1737,7 @@ var init_schema = __esm({
|
|
|
1749
1737
|
ArtifactType3["CDK_TREE"] = "cdk:tree";
|
|
1750
1738
|
ArtifactType3["ASSET_MANIFEST"] = "cdk:asset-manifest";
|
|
1751
1739
|
ArtifactType3["NESTED_CLOUD_ASSEMBLY"] = "cdk:cloud-assembly";
|
|
1740
|
+
ArtifactType3["FEATURE_FLAG_REPORT"] = "cdk:feature-flag-report";
|
|
1752
1741
|
return ArtifactType3;
|
|
1753
1742
|
})(ArtifactType || {});
|
|
1754
1743
|
}
|
|
@@ -5100,7 +5089,7 @@ var require_semver2 = __commonJS({
|
|
|
5100
5089
|
// ../cloud-assembly-schema/cli-version.json
|
|
5101
5090
|
var require_cli_version = __commonJS({
|
|
5102
5091
|
"../cloud-assembly-schema/cli-version.json"(exports2, module2) {
|
|
5103
|
-
module2.exports = { version: "2.
|
|
5092
|
+
module2.exports = { version: "2.1019.0" };
|
|
5104
5093
|
}
|
|
5105
5094
|
});
|
|
5106
5095
|
|
|
@@ -5465,6 +5454,9 @@ var require_cloud_assembly_schema = __commonJS({
|
|
|
5465
5454
|
},
|
|
5466
5455
|
{
|
|
5467
5456
|
$ref: "#/definitions/NestedCloudAssemblyProperties"
|
|
5457
|
+
},
|
|
5458
|
+
{
|
|
5459
|
+
$ref: "#/definitions/FeatureFlagReportProperties"
|
|
5468
5460
|
}
|
|
5469
5461
|
]
|
|
5470
5462
|
},
|
|
@@ -5490,7 +5482,8 @@ have a unique display name. (Default - no display name)`,
|
|
|
5490
5482
|
"aws:cloudformation:stack",
|
|
5491
5483
|
"cdk:tree",
|
|
5492
5484
|
"cdk:asset-manifest",
|
|
5493
|
-
"cdk:cloud-assembly"
|
|
5485
|
+
"cdk:cloud-assembly",
|
|
5486
|
+
"cdk:feature-flag-report"
|
|
5494
5487
|
]
|
|
5495
5488
|
},
|
|
5496
5489
|
MetadataEntry: {
|
|
@@ -5883,6 +5876,27 @@ have a unique display name. (Default - no display name)`,
|
|
|
5883
5876
|
"directoryName"
|
|
5884
5877
|
]
|
|
5885
5878
|
},
|
|
5879
|
+
FeatureFlagReportProperties: {
|
|
5880
|
+
description: "Artifact properties for a feature flag report\n\nA feature flag report is small enough that all the properties can be inlined\nhere, and doesn't need an additional file.",
|
|
5881
|
+
type: "object",
|
|
5882
|
+
properties: {
|
|
5883
|
+
module: {
|
|
5884
|
+
description: "The library that this feature flag report applies to.",
|
|
5885
|
+
type: "string"
|
|
5886
|
+
},
|
|
5887
|
+
flags: {
|
|
5888
|
+
$ref: "#/definitions/Record<string,FeatureFlag>",
|
|
5889
|
+
description: "Information about every feature flag supported by this library."
|
|
5890
|
+
}
|
|
5891
|
+
},
|
|
5892
|
+
required: [
|
|
5893
|
+
"flags",
|
|
5894
|
+
"module"
|
|
5895
|
+
]
|
|
5896
|
+
},
|
|
5897
|
+
"Record<string,FeatureFlag>": {
|
|
5898
|
+
type: "object"
|
|
5899
|
+
},
|
|
5886
5900
|
MissingContext: {
|
|
5887
5901
|
description: "Represents a missing piece of context.",
|
|
5888
5902
|
type: "object",
|
|
@@ -7026,7 +7040,7 @@ var require_integ_schema = __commonJS({
|
|
|
7026
7040
|
var require_version = __commonJS({
|
|
7027
7041
|
"../cloud-assembly-schema/schema/version.json"(exports2, module2) {
|
|
7028
7042
|
module2.exports = {
|
|
7029
|
-
schemaHash: "
|
|
7043
|
+
schemaHash: "4709e40bc5dd6ad7d2bb6c6bd0315c622b7f4aa07ee3af66ff07f9bc77fdf783",
|
|
7030
7044
|
revision: 44
|
|
7031
7045
|
};
|
|
7032
7046
|
}
|
|
@@ -7167,7 +7181,7 @@ var init_manifest = __esm({
|
|
|
7167
7181
|
}
|
|
7168
7182
|
const maxSupported = semver.major(parseVersion(_Manifest.version()));
|
|
7169
7183
|
const actual = parseVersion(manifest.version);
|
|
7170
|
-
if (maxSupported < semver.major(actual) && !
|
|
7184
|
+
if (maxSupported < semver.major(actual) && !options?.skipVersionCheck) {
|
|
7171
7185
|
const cliVersion = manifest.minimumCliVersion;
|
|
7172
7186
|
let cliWarning = "";
|
|
7173
7187
|
if (cliVersion) {
|
|
@@ -7185,7 +7199,7 @@ var init_manifest = __esm({
|
|
|
7185
7199
|
preValidateProperty: _Manifest.validateAssumeRoleAdditionalOptions
|
|
7186
7200
|
});
|
|
7187
7201
|
let errors = result.errors;
|
|
7188
|
-
if (options
|
|
7202
|
+
if (options?.skipEnumCheck) {
|
|
7189
7203
|
errors = stripEnumErrors(errors);
|
|
7190
7204
|
}
|
|
7191
7205
|
if (errors.length > 0) {
|
|
@@ -7252,10 +7266,10 @@ ${errors.map((e) => e.stack).join("\n")}`);
|
|
|
7252
7266
|
return;
|
|
7253
7267
|
}
|
|
7254
7268
|
const assumeRoleOptions = instance[key];
|
|
7255
|
-
if (assumeRoleOptions
|
|
7269
|
+
if (assumeRoleOptions?.RoleArn) {
|
|
7256
7270
|
throw new Error(`RoleArn is not allowed inside '${key}'`);
|
|
7257
7271
|
}
|
|
7258
|
-
if (assumeRoleOptions
|
|
7272
|
+
if (assumeRoleOptions?.ExternalId) {
|
|
7259
7273
|
throw new Error(`ExternalId is not allowed inside '${key}'`);
|
|
7260
7274
|
}
|
|
7261
7275
|
}
|
|
@@ -7317,16 +7331,16 @@ var init_schema3 = __esm({
|
|
|
7317
7331
|
});
|
|
7318
7332
|
|
|
7319
7333
|
// ../cloud-assembly-schema/lib/integ-tests/commands/common.ts
|
|
7320
|
-
var
|
|
7321
|
-
var
|
|
7334
|
+
var RequireApproval;
|
|
7335
|
+
var init_common = __esm({
|
|
7322
7336
|
"../cloud-assembly-schema/lib/integ-tests/commands/common.ts"() {
|
|
7323
7337
|
"use strict";
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
return
|
|
7329
|
-
})(
|
|
7338
|
+
RequireApproval = /* @__PURE__ */ ((RequireApproval3) => {
|
|
7339
|
+
RequireApproval3["NEVER"] = "never";
|
|
7340
|
+
RequireApproval3["ANYCHANGE"] = "any-change";
|
|
7341
|
+
RequireApproval3["BROADENING"] = "broadening";
|
|
7342
|
+
return RequireApproval3;
|
|
7343
|
+
})(RequireApproval || {});
|
|
7330
7344
|
}
|
|
7331
7345
|
});
|
|
7332
7346
|
|
|
@@ -7338,7 +7352,7 @@ var init_deploy2 = __esm({
|
|
|
7338
7352
|
});
|
|
7339
7353
|
|
|
7340
7354
|
// ../cloud-assembly-schema/lib/integ-tests/commands/destroy.ts
|
|
7341
|
-
var
|
|
7355
|
+
var init_destroy = __esm({
|
|
7342
7356
|
"../cloud-assembly-schema/lib/integ-tests/commands/destroy.ts"() {
|
|
7343
7357
|
"use strict";
|
|
7344
7358
|
}
|
|
@@ -7348,9 +7362,9 @@ var init_destroy2 = __esm({
|
|
|
7348
7362
|
var init_commands2 = __esm({
|
|
7349
7363
|
"../cloud-assembly-schema/lib/integ-tests/commands/index.ts"() {
|
|
7350
7364
|
"use strict";
|
|
7351
|
-
|
|
7365
|
+
init_common();
|
|
7352
7366
|
init_deploy2();
|
|
7353
|
-
|
|
7367
|
+
init_destroy();
|
|
7354
7368
|
}
|
|
7355
7369
|
});
|
|
7356
7370
|
|
|
@@ -7364,7 +7378,7 @@ var init_test_case = __esm({
|
|
|
7364
7378
|
// ../cloud-assembly-schema/lib/integ-tests/index.ts
|
|
7365
7379
|
var integ_tests_exports = {};
|
|
7366
7380
|
__export(integ_tests_exports, {
|
|
7367
|
-
RequireApproval: () =>
|
|
7381
|
+
RequireApproval: () => RequireApproval
|
|
7368
7382
|
});
|
|
7369
7383
|
var init_integ_tests = __esm({
|
|
7370
7384
|
"../cloud-assembly-schema/lib/integ-tests/index.ts"() {
|
|
@@ -7558,7 +7572,7 @@ var require_cloud_artifact = __commonJS({
|
|
|
7558
7572
|
};
|
|
7559
7573
|
exports2.CloudArtifact = CloudArtifact;
|
|
7560
7574
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7561
|
-
CloudArtifact[_a] = { fqn: "@aws-cdk/cx-api.CloudArtifact", version: "2.
|
|
7575
|
+
CloudArtifact[_a] = { fqn: "@aws-cdk/cx-api.CloudArtifact", version: "2.201.0" };
|
|
7562
7576
|
}
|
|
7563
7577
|
});
|
|
7564
7578
|
|
|
@@ -7628,7 +7642,7 @@ var require_asset_manifest_artifact = __commonJS({
|
|
|
7628
7642
|
};
|
|
7629
7643
|
exports2.AssetManifestArtifact = AssetManifestArtifact;
|
|
7630
7644
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7631
|
-
AssetManifestArtifact[_a] = { fqn: "@aws-cdk/cx-api.AssetManifestArtifact", version: "2.
|
|
7645
|
+
AssetManifestArtifact[_a] = { fqn: "@aws-cdk/cx-api.AssetManifestArtifact", version: "2.201.0" };
|
|
7632
7646
|
Object.defineProperty(AssetManifestArtifact.prototype, ASSET_MANIFEST_ARTIFACT_SYM, {
|
|
7633
7647
|
value: true,
|
|
7634
7648
|
enumerable: false,
|
|
@@ -7676,7 +7690,7 @@ var require_environment2 = __commonJS({
|
|
|
7676
7690
|
};
|
|
7677
7691
|
exports2.EnvironmentUtils = EnvironmentUtils;
|
|
7678
7692
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7679
|
-
EnvironmentUtils[_a] = { fqn: "@aws-cdk/cx-api.EnvironmentUtils", version: "2.
|
|
7693
|
+
EnvironmentUtils[_a] = { fqn: "@aws-cdk/cx-api.EnvironmentUtils", version: "2.201.0" };
|
|
7680
7694
|
}
|
|
7681
7695
|
});
|
|
7682
7696
|
|
|
@@ -7782,7 +7796,7 @@ var require_cloudformation_artifact = __commonJS({
|
|
|
7782
7796
|
};
|
|
7783
7797
|
exports2.CloudFormationStackArtifact = CloudFormationStackArtifact;
|
|
7784
7798
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7785
|
-
CloudFormationStackArtifact[_a] = { fqn: "@aws-cdk/cx-api.CloudFormationStackArtifact", version: "2.
|
|
7799
|
+
CloudFormationStackArtifact[_a] = { fqn: "@aws-cdk/cx-api.CloudFormationStackArtifact", version: "2.201.0" };
|
|
7786
7800
|
Object.defineProperty(CloudFormationStackArtifact.prototype, CLOUDFORMATION_STACK_ARTIFACT_SYM, {
|
|
7787
7801
|
value: true,
|
|
7788
7802
|
enumerable: false,
|
|
@@ -7847,7 +7861,7 @@ var require_nested_cloud_assembly_artifact = __commonJS({
|
|
|
7847
7861
|
};
|
|
7848
7862
|
exports2.NestedCloudAssemblyArtifact = NestedCloudAssemblyArtifact;
|
|
7849
7863
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7850
|
-
NestedCloudAssemblyArtifact[_a] = { fqn: "@aws-cdk/cx-api.NestedCloudAssemblyArtifact", version: "2.
|
|
7864
|
+
NestedCloudAssemblyArtifact[_a] = { fqn: "@aws-cdk/cx-api.NestedCloudAssemblyArtifact", version: "2.201.0" };
|
|
7851
7865
|
Object.defineProperty(NestedCloudAssemblyArtifact.prototype, NESTED_CLOUD_ASSEMBLY_SYM, {
|
|
7852
7866
|
value: true,
|
|
7853
7867
|
enumerable: false,
|
|
@@ -7908,7 +7922,7 @@ var require_tree_cloud_artifact = __commonJS({
|
|
|
7908
7922
|
};
|
|
7909
7923
|
exports2.TreeCloudArtifact = TreeCloudArtifact;
|
|
7910
7924
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7911
|
-
TreeCloudArtifact[_a] = { fqn: "@aws-cdk/cx-api.TreeCloudArtifact", version: "2.
|
|
7925
|
+
TreeCloudArtifact[_a] = { fqn: "@aws-cdk/cx-api.TreeCloudArtifact", version: "2.201.0" };
|
|
7912
7926
|
Object.defineProperty(TreeCloudArtifact.prototype, TREE_CLOUD_ARTIFACT_SYM, {
|
|
7913
7927
|
value: true,
|
|
7914
7928
|
enumerable: false,
|
|
@@ -8014,7 +8028,7 @@ var require_cloud_assembly = __commonJS({
|
|
|
8014
8028
|
this.directory = directory;
|
|
8015
8029
|
this.manifest = cxschema.Manifest.loadAssemblyManifest(path7.join(directory, MANIFEST_FILE), loadOptions);
|
|
8016
8030
|
this.version = this.manifest.version;
|
|
8017
|
-
this.artifacts = this.renderArtifacts(
|
|
8031
|
+
this.artifacts = this.renderArtifacts(loadOptions?.topoSort ?? true);
|
|
8018
8032
|
this.runtime = this.manifest.runtime || { libraries: {} };
|
|
8019
8033
|
Object.defineProperty(this, CLOUD_ASSEMBLY_SYMBOL, { value: true });
|
|
8020
8034
|
this.validateDeps();
|
|
@@ -8174,7 +8188,7 @@ var require_cloud_assembly = __commonJS({
|
|
|
8174
8188
|
};
|
|
8175
8189
|
exports2.CloudAssembly = CloudAssembly;
|
|
8176
8190
|
_a = JSII_RTTI_SYMBOL_1;
|
|
8177
|
-
CloudAssembly[_a] = { fqn: "@aws-cdk/cx-api.CloudAssembly", version: "2.
|
|
8191
|
+
CloudAssembly[_a] = { fqn: "@aws-cdk/cx-api.CloudAssembly", version: "2.201.0" };
|
|
8178
8192
|
var CloudAssemblyBuilder = class _CloudAssemblyBuilder {
|
|
8179
8193
|
/**
|
|
8180
8194
|
* Initializes a cloud assembly builder.
|
|
@@ -8209,11 +8223,10 @@ var require_cloud_assembly = __commonJS({
|
|
|
8209
8223
|
* @param missing Missing context information.
|
|
8210
8224
|
*/
|
|
8211
8225
|
addMissing(missing) {
|
|
8212
|
-
var _a2;
|
|
8213
8226
|
if (this.missing.every((m) => m.key !== missing.key)) {
|
|
8214
8227
|
this.missing.push(missing);
|
|
8215
8228
|
}
|
|
8216
|
-
|
|
8229
|
+
this.parentBuilder?.addMissing(missing);
|
|
8217
8230
|
}
|
|
8218
8231
|
/**
|
|
8219
8232
|
* Finalizes the cloud assembly into the output directory returns a
|
|
@@ -8268,7 +8281,7 @@ var require_cloud_assembly = __commonJS({
|
|
|
8268
8281
|
};
|
|
8269
8282
|
exports2.CloudAssemblyBuilder = CloudAssemblyBuilder;
|
|
8270
8283
|
_b = JSII_RTTI_SYMBOL_1;
|
|
8271
|
-
CloudAssemblyBuilder[_b] = { fqn: "@aws-cdk/cx-api.CloudAssemblyBuilder", version: "2.
|
|
8284
|
+
CloudAssemblyBuilder[_b] = { fqn: "@aws-cdk/cx-api.CloudAssemblyBuilder", version: "2.201.0" };
|
|
8272
8285
|
function filterUndefined(obj) {
|
|
8273
8286
|
if (Array.isArray(obj)) {
|
|
8274
8287
|
return obj.filter((x) => x !== void 0).map((x) => filterUndefined(x));
|
|
@@ -8397,8 +8410,8 @@ var require_features = __commonJS({
|
|
|
8397
8410
|
"use strict";
|
|
8398
8411
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8399
8412
|
exports2.LAMBDA_NODEJS_USE_LATEST_RUNTIME = exports2.ENABLE_OPENSEARCH_MULTIAZ_WITH_STANDBY = exports2.AUTOSCALING_GENERATE_LAUNCH_TEMPLATE = exports2.EFS_MOUNTTARGET_ORDERINSENSITIVE_LOGICAL_ID = exports2.EFS_DENY_ANONYMOUS_ACCESS = exports2.KMS_ALIAS_NAME_REF = exports2.INCLUDE_PREFIX_IN_UNIQUE_NAME_GENERATION = exports2.APIGATEWAY_REQUEST_VALIDATOR_UNIQUE_ID = exports2.EC2_RESTRICT_DEFAULT_SECURITY_GROUP = exports2.ENABLE_EMR_SERVICE_POLICY_V2 = exports2.REDSHIFT_COLUMN_ID = exports2.SECRETS_MANAGER_TARGET_ATTACHMENT_RESOURCE_POLICY = exports2.EC2_LAUNCH_TEMPLATE_DEFAULT_USER_DATA = exports2.APIGATEWAY_AUTHORIZER_CHANGE_DEPLOYMENT_LOGICAL_ID = exports2.CODEDEPLOY_REMOVE_ALARMS_FROM_DEPLOYMENT_GROUP = exports2.DATABASE_PROXY_UNIQUE_RESOURCE_NAME = exports2.AWS_CUSTOM_RESOURCE_LATEST_SDK_DEFAULT = exports2.ROUTE53_PATTERNS_USE_CERTIFICATE = exports2.S3_SERVER_ACCESS_LOGS_USE_BUCKET_POLICY = exports2.ECS_DISABLE_EXPLICIT_DEPLOYMENT_CONTROLLER_FOR_CIRCUIT_BREAKER = exports2.EVENTS_TARGET_QUEUE_SAME_ACCOUNT = exports2.ENABLE_PARTITION_LITERALS = exports2.APIGATEWAY_DISABLE_CLOUDWATCH_ROLE = exports2.SNS_SUBSCRIPTIONS_SQS_DECRYPTION_POLICY = exports2.S3_CREATE_DEFAULT_LOGGING_POLICY = exports2.CODEPIPELINE_CROSS_ACCOUNT_KEY_ALIAS_STACK_SAFE_RESOURCE_NAME = exports2.VALIDATE_SNAPSHOT_REMOVAL_POLICY = exports2.IAM_IMPORTED_ROLE_STACK_SAFE_DEFAULT_POLICY_NAME = exports2.IAM_MINIMIZE_POLICIES = exports2.ECS_ARN_FORMAT_INCLUDES_CLUSTER_NAME = exports2.EC2_UNIQUE_IMDSV2_LAUNCH_TEMPLATE_NAME = exports2.ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER = exports2.TARGET_PARTITIONS = exports2.CHECK_SECRET_USAGE = exports2.CLOUDFRONT_DEFAULT_SECURITY_POLICY_TLS_V1_2_2021 = exports2.LAMBDA_RECOGNIZE_LAYER_VERSION = exports2.LAMBDA_RECOGNIZE_VERSION_PROPS = exports2.EFS_DEFAULT_ENCRYPTION_AT_REST = exports2.APIGATEWAY_USAGEPLANKEY_ORDERINSENSITIVE_ID = exports2.RDS_LOWERCASE_DB_IDENTIFIER = exports2.ECS_REMOVE_DEFAULT_DESIRED_COUNT = exports2.S3_GRANT_WRITE_WITHOUT_ACL = exports2.KMS_DEFAULT_KEY_POLICIES = exports2.SECRETS_MANAGER_PARSE_OWNED_SECRET_NAME = exports2.DOCKER_IGNORE_SUPPORT = exports2.STACK_RELATIVE_EXPORTS_CONTEXT = exports2.NEW_STYLE_STACK_SYNTHESIS_CONTEXT = exports2.ENABLE_DIFF_NO_FAIL = exports2.ENABLE_DIFF_NO_FAIL_CONTEXT = exports2.ENABLE_STACK_NAME_DUPLICATES_CONTEXT = void 0;
|
|
8400
|
-
exports2.
|
|
8401
|
-
exports2.NEW_PROJECT_DEFAULT_CONTEXT = void 0;
|
|
8413
|
+
exports2.FUTURE_FLAGS_EXPIRED = exports2.CURRENT_VERSION_FLAG_DEFAULTS = exports2.CURRENTLY_RECOMMENDED_FLAGS = exports2.CURRENT_VERSION_EXPIRED_FLAGS = exports2.FLAGS = exports2.USE_CDK_MANAGED_LAMBDA_LOGGROUP = exports2.S3_PUBLIC_ACCESS_BLOCKED_BY_DEFAULT = exports2.USE_RESOURCEID_FOR_VPCV2_MIGRATION = exports2.EC2_REQUIRE_PRIVATE_SUBNETS_FOR_EGRESSONLYINTERNETGATEWAY = exports2.S3_TRUST_KEY_POLICY_FOR_SNS_SUBSCRIPTIONS = exports2.PIPELINE_REDUCE_CROSS_ACCOUNT_ACTION_ROLE_TRUST_SCOPE = exports2.LOG_USER_POOL_CLIENT_SECRET_VALUE = exports2.DYNAMODB_TABLE_RETAIN_TABLE_REPLICA = exports2.ASPECT_PRIORITIES_MUTATING = exports2.EVENTBUS_POLICY_SID_REQUIRED = exports2.PIPELINE_REDUCE_STAGE_ROLE_TRUST_SCOPE = exports2.SET_UNIQUE_REPLICATION_ROLE_NAME = exports2.LAMBDA_CREATE_NEW_POLICIES_WITH_ADDTOROLEPOLICY = exports2.ENABLE_ADDITIONAL_METADATA_COLLECTION = exports2.IAM_OIDC_REJECT_UNAUTHORIZED_CONNECTIONS = exports2.ALB_DUALSTACK_WITHOUT_PUBLIC_IPV4_SECURITY_GROUP_RULES_DEFAULT = exports2.Disable_ECS_IMDS_Blocking = exports2.Enable_IMDS_Blocking_Deprecated_Feature = exports2.USER_POOL_DOMAIN_NAME_METHOD_WITHOUT_CUSTOM_RESOURCE = exports2.ASPECT_STABILIZATION = exports2.BASTION_HOST_USE_AMAZON_LINUX_2023_BY_DEFAULT = exports2.STEPFUNCTIONS_USE_DISTRIBUTED_MAP_RESULT_WRITER_V2 = exports2.STEPFUNCTIONS_TASKS_FIX_RUN_ECS_TASK_POLICY = exports2.LAMBDA_NODEJS_SDK_V3_EXCLUDE_SMITHY_PACKAGES = exports2.CFN_INCLUDE_REJECT_COMPLEX_RESOURCE_UPDATE_CREATE_POLICY_INTRINSICS = exports2.USE_CORRECT_VALUE_FOR_INSTANCE_RESOURCE_ID_PROPERTY = exports2.APPSYNC_GRAPHQLAPI_SCOPE_LAMBDA_FUNCTION_PERMISSION = exports2.EC2_SUM_TIMEOUT_ENABLED = exports2.DYNAMODB_TABLEV2_RESOURCE_POLICY_PER_REPLICA = exports2.REDUCE_EC2_FARGATE_CLOUDWATCH_PERMISSIONS = exports2.USE_NEW_S3URI_PARAMETERS_FOR_BEDROCK_INVOKE_MODEL_TASK = exports2.S3_KEEP_NOTIFICATION_IN_IMPORTED_BUCKET = exports2.LOG_API_RESPONSE_DATA_PROPERTY_TRUE_DEFAULT = exports2.ECS_REMOVE_DEFAULT_DEPLOYMENT_ALARM = exports2.EBS_DEFAULT_GP3 = exports2.EKS_NODEGROUP_NAME = exports2.PIPELINE_REDUCE_ASSET_ROLE_TRUST_SCOPE = exports2.KMS_REDUCE_CROSS_ACCOUNT_REGION_POLICY_SCOPE = exports2.CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2 = exports2.CODEPIPELINE_CROSS_ACCOUNT_KEYS_DEFAULT_VALUE_TO_FALSE = exports2.LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION = exports2.CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME = exports2.APPSYNC_ENABLE_USE_ARN_IDENTIFIER_SOURCE_API_ASSOCIATION = exports2.AURORA_CLUSTER_CHANGE_SCOPE_OF_INSTANCE_PARAMETER_GROUP_WITH_EACH_PARAMETERS = exports2.RDS_PREVENT_RENDERING_DEPRECATED_CREDENTIALS = void 0;
|
|
8414
|
+
exports2.NEW_PROJECT_DEFAULT_CONTEXT = exports2.FUTURE_FLAGS = void 0;
|
|
8402
8415
|
exports2.futureFlagDefault = futureFlagDefault;
|
|
8403
8416
|
var flag_modeling_1 = require_flag_modeling();
|
|
8404
8417
|
exports2.ENABLE_STACK_NAME_DUPLICATES_CONTEXT = "@aws-cdk/core:enableStackNameDuplicates";
|
|
@@ -8495,6 +8508,7 @@ var require_features = __commonJS({
|
|
|
8495
8508
|
exports2.EC2_REQUIRE_PRIVATE_SUBNETS_FOR_EGRESSONLYINTERNETGATEWAY = "@aws-cdk/aws-ec2:requirePrivateSubnetsForEgressOnlyInternetGateway";
|
|
8496
8509
|
exports2.USE_RESOURCEID_FOR_VPCV2_MIGRATION = "@aws-cdk/aws-ec2-alpha:useResourceIdForVpcV2Migration";
|
|
8497
8510
|
exports2.S3_PUBLIC_ACCESS_BLOCKED_BY_DEFAULT = "@aws-cdk/aws-s3:publicAccessBlockedByDefault";
|
|
8511
|
+
exports2.USE_CDK_MANAGED_LAMBDA_LOGGROUP = "@aws-cdk/aws-lambda:useCdkManagedLogGroup";
|
|
8498
8512
|
exports2.FLAGS = {
|
|
8499
8513
|
//////////////////////////////////////////////////////////////////////
|
|
8500
8514
|
[exports2.ENABLE_STACK_NAME_DUPLICATES_CONTEXT]: {
|
|
@@ -9874,21 +9888,38 @@ var require_features = __commonJS({
|
|
|
9874
9888
|
`,
|
|
9875
9889
|
introducedIn: { v2: "2.196.0" },
|
|
9876
9890
|
recommendedValue: true
|
|
9891
|
+
},
|
|
9892
|
+
//////////////////////////////////////////////////////////////////////
|
|
9893
|
+
[exports2.USE_CDK_MANAGED_LAMBDA_LOGGROUP]: {
|
|
9894
|
+
type: flag_modeling_1.FlagType.ApiDefault,
|
|
9895
|
+
summary: "When enabled, CDK creates and manages loggroup for the lambda function",
|
|
9896
|
+
detailsMd: `
|
|
9897
|
+
When this feature flag is enabled, CDK will create a loggroup for lambda function with default properties
|
|
9898
|
+
which supports CDK features Tag propagation, Property Injectors, Aspects
|
|
9899
|
+
if the cdk app doesnt pass a 'logRetention' or 'logGroup' explicitly.
|
|
9900
|
+
LogGroups created via 'logRetention' do not support Tag propagation, Property Injectors, Aspects.
|
|
9901
|
+
LogGroups created via 'logGroup' created in CDK support Tag propagation, Property Injectors, Aspects.
|
|
9902
|
+
|
|
9903
|
+
When this feature flag is disabled, a loggroup is created by Lambda service on first invocation
|
|
9904
|
+
of the function (existing behavior).
|
|
9905
|
+
LogGroups created in this way do not support Tag propagation, Property Injectors, Aspects.
|
|
9906
|
+
|
|
9907
|
+
DO NOT ENABLE: If you have and existing app defining a lambda function and
|
|
9908
|
+
have not supplied a logGroup or logRetention prop and your lambda function has
|
|
9909
|
+
executed at least once, the logGroup has been already created with the same name
|
|
9910
|
+
so your deployment will start failing.
|
|
9911
|
+
Refer aws-lambda/README.md for more details on Customizing Log Group creation.
|
|
9912
|
+
`,
|
|
9913
|
+
introducedIn: { v2: "V2_NEXT" },
|
|
9914
|
+
defaults: { v2: false },
|
|
9915
|
+
recommendedValue: true,
|
|
9916
|
+
compatibilityWithOldBehaviorMd: "Disable the feature flag to let lambda service create logGroup or specify logGroup or logRetention"
|
|
9877
9917
|
}
|
|
9878
9918
|
};
|
|
9879
9919
|
var CURRENT_MV = "v2";
|
|
9880
9920
|
exports2.CURRENT_VERSION_EXPIRED_FLAGS = Object.entries(exports2.FLAGS).filter(([_, flag]) => flag.introducedIn[CURRENT_MV] === void 0).map(([name, _]) => name).sort();
|
|
9881
|
-
exports2.CURRENTLY_RECOMMENDED_FLAGS = Object.fromEntries(Object.entries(exports2.FLAGS).filter(([_, flag]) =>
|
|
9882
|
-
|
|
9883
|
-
return flag.recommendedValue !== ((_a = flag.defaults) == null ? void 0 : _a[CURRENT_MV]) && flag.introducedIn[CURRENT_MV];
|
|
9884
|
-
}).map(([name, flag]) => [name, flag.recommendedValue]));
|
|
9885
|
-
exports2.CURRENT_VERSION_FLAG_DEFAULTS = Object.fromEntries(Object.entries(exports2.FLAGS).filter(([_, flag]) => {
|
|
9886
|
-
var _a;
|
|
9887
|
-
return ((_a = flag.defaults) == null ? void 0 : _a[CURRENT_MV]) !== void 0;
|
|
9888
|
-
}).map(([name, flag]) => {
|
|
9889
|
-
var _a;
|
|
9890
|
-
return [name, (_a = flag.defaults) == null ? void 0 : _a[CURRENT_MV]];
|
|
9891
|
-
}));
|
|
9921
|
+
exports2.CURRENTLY_RECOMMENDED_FLAGS = Object.fromEntries(Object.entries(exports2.FLAGS).filter(([_, flag]) => flag.recommendedValue !== flag.defaults?.[CURRENT_MV] && flag.introducedIn[CURRENT_MV]).map(([name, flag]) => [name, flag.recommendedValue]));
|
|
9922
|
+
exports2.CURRENT_VERSION_FLAG_DEFAULTS = Object.fromEntries(Object.entries(exports2.FLAGS).filter(([_, flag]) => flag.defaults?.[CURRENT_MV] !== void 0).map(([name, flag]) => [name, flag.defaults?.[CURRENT_MV]]));
|
|
9892
9923
|
function futureFlagDefault(flag) {
|
|
9893
9924
|
const value = exports2.CURRENT_VERSION_FLAG_DEFAULTS[flag] ?? false;
|
|
9894
9925
|
if (typeof value !== "boolean") {
|
|
@@ -9990,7 +10021,7 @@ var require_placeholders = __commonJS({
|
|
|
9990
10021
|
};
|
|
9991
10022
|
exports2.EnvironmentPlaceholders = EnvironmentPlaceholders;
|
|
9992
10023
|
_a = JSII_RTTI_SYMBOL_1;
|
|
9993
|
-
EnvironmentPlaceholders[_a] = { fqn: "@aws-cdk/cx-api.EnvironmentPlaceholders", version: "2.
|
|
10024
|
+
EnvironmentPlaceholders[_a] = { fqn: "@aws-cdk/cx-api.EnvironmentPlaceholders", version: "2.201.0" };
|
|
9994
10025
|
EnvironmentPlaceholders.CURRENT_REGION = "${AWS::Region}";
|
|
9995
10026
|
EnvironmentPlaceholders.CURRENT_ACCOUNT = "${AWS::AccountId}";
|
|
9996
10027
|
EnvironmentPlaceholders.CURRENT_PARTITION = "${AWS::Partition}";
|
|
@@ -12580,18 +12611,21 @@ var require_lib5 = __commonJS({
|
|
|
12580
12611
|
});
|
|
12581
12612
|
|
|
12582
12613
|
// lib/runner/private/integ-manifest.ts
|
|
12583
|
-
var path, import_cloud_assembly_schema, fs2,
|
|
12614
|
+
var path, import_cloud_assembly_schema, fs2, IntegManifestReader;
|
|
12584
12615
|
var init_integ_manifest = __esm({
|
|
12585
12616
|
"lib/runner/private/integ-manifest.ts"() {
|
|
12586
12617
|
"use strict";
|
|
12587
12618
|
path = __toESM(require("path"));
|
|
12588
12619
|
import_cloud_assembly_schema = __toESM(require_lib3());
|
|
12589
12620
|
fs2 = __toESM(require_lib5());
|
|
12590
|
-
|
|
12621
|
+
IntegManifestReader = class _IntegManifestReader {
|
|
12591
12622
|
constructor(directory, manifest) {
|
|
12592
12623
|
this.manifest = manifest;
|
|
12593
12624
|
this.directory = directory;
|
|
12594
12625
|
}
|
|
12626
|
+
static {
|
|
12627
|
+
this.DEFAULT_FILENAME = "integ.json";
|
|
12628
|
+
}
|
|
12595
12629
|
/**
|
|
12596
12630
|
* Reads an integration test manifest from the specified file
|
|
12597
12631
|
*/
|
|
@@ -12631,8 +12665,6 @@ var init_integ_manifest = __esm({
|
|
|
12631
12665
|
};
|
|
12632
12666
|
}
|
|
12633
12667
|
};
|
|
12634
|
-
_IntegManifestReader.DEFAULT_FILENAME = "integ.json";
|
|
12635
|
-
IntegManifestReader = _IntegManifestReader;
|
|
12636
12668
|
}
|
|
12637
12669
|
});
|
|
12638
12670
|
|
|
@@ -12719,7 +12751,7 @@ var init_integ_test_suite = __esm({
|
|
|
12719
12751
|
* /// !cdk-integ <stack-name>
|
|
12720
12752
|
*
|
|
12721
12753
|
*/
|
|
12722
|
-
static fromLegacy(config) {
|
|
12754
|
+
static async fromLegacy(config) {
|
|
12723
12755
|
const pragmas = this.pragmas(config.integSourceFilePath);
|
|
12724
12756
|
const tests = {
|
|
12725
12757
|
stacks: [],
|
|
@@ -12734,7 +12766,7 @@ var init_integ_test_suite = __esm({
|
|
|
12734
12766
|
...config.listOptions,
|
|
12735
12767
|
notices: false
|
|
12736
12768
|
};
|
|
12737
|
-
const stacks = config.cdk.list(options)
|
|
12769
|
+
const stacks = await config.cdk.list(options);
|
|
12738
12770
|
if (stacks.length !== 1) {
|
|
12739
12771
|
throw new Error(`"cdk-integ" can only operate on apps with a single stack.
|
|
12740
12772
|
|
|
@@ -12880,6 +12912,7 @@ __export(recommended_feature_flags_exports, {
|
|
|
12880
12912
|
"@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": () => _aws_cdk_aws_lambda_nodejs_useLatestRuntimeVersion,
|
|
12881
12913
|
"@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy": () => _aws_cdk_aws_lambda_createNewPoliciesWithAddToRolePolicy,
|
|
12882
12914
|
"@aws-cdk/aws-lambda:recognizeLayerVersion": () => _aws_cdk_aws_lambda_recognizeLayerVersion,
|
|
12915
|
+
"@aws-cdk/aws-lambda:useCdkManagedLogGroup": () => _aws_cdk_aws_lambda_useCdkManagedLogGroup,
|
|
12883
12916
|
"@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": () => _aws_cdk_aws_opensearchservice_enableOpensearchMultiAzWithStandby,
|
|
12884
12917
|
"@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": () => _aws_cdk_aws_rds_auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters,
|
|
12885
12918
|
"@aws-cdk/aws-rds:databaseProxyUniqueResourceName": () => _aws_cdk_aws_rds_databaseProxyUniqueResourceName,
|
|
@@ -12911,7 +12944,7 @@ __export(recommended_feature_flags_exports, {
|
|
|
12911
12944
|
"@aws-cdk/s3-notifications:addS3TrustKeyPolicyForSnsSubscriptions": () => _aws_cdk_s3_notifications_addS3TrustKeyPolicyForSnsSubscriptions,
|
|
12912
12945
|
default: () => recommended_feature_flags_default
|
|
12913
12946
|
});
|
|
12914
|
-
var _aws_cdk_aws_lambda_recognizeLayerVersion, _aws_cdk_core_checkSecretUsage, _aws_cdk_core_target_partitions, _aws_cdk_containers_ecs_service_extensions_enableDefaultLogDriver, _aws_cdk_aws_ec2_uniqueImdsv2TemplateName, _aws_cdk_aws_ecs_arnFormatIncludesClusterName, _aws_cdk_aws_iam_minimizePolicies, _aws_cdk_core_validateSnapshotRemovalPolicy, _aws_cdk_aws_codepipeline_crossAccountKeyAliasStackSafeResourceName, _aws_cdk_aws_s3_createDefaultLoggingPolicy, _aws_cdk_aws_sns_subscriptions_restrictSqsDescryption, _aws_cdk_aws_apigateway_disableCloudWatchRole, _aws_cdk_core_enablePartitionLiterals, _aws_cdk_aws_events_eventsTargetQueueSameAccount, _aws_cdk_aws_ecs_disableExplicitDeploymentControllerForCircuitBreaker, _aws_cdk_aws_iam_importedRoleStackSafeDefaultPolicyName, _aws_cdk_aws_s3_serverAccessLogsUseBucketPolicy, _aws_cdk_aws_route53_patters_useCertificate, _aws_cdk_customresources_installLatestAwsSdkDefault, _aws_cdk_aws_rds_databaseProxyUniqueResourceName, _aws_cdk_aws_codedeploy_removeAlarmsFromDeploymentGroup, _aws_cdk_aws_apigateway_authorizerChangeDeploymentLogicalId, _aws_cdk_aws_ec2_launchTemplateDefaultUserData, _aws_cdk_aws_secretsmanager_useAttachedSecretResourcePolicyForSecretTargetAttachments, _aws_cdk_aws_redshift_columnId, _aws_cdk_aws_stepfunctions_tasks_enableEmrServicePolicyV2, _aws_cdk_aws_ec2_restrictDefaultSecurityGroup, _aws_cdk_aws_apigateway_requestValidatorUniqueId, _aws_cdk_aws_kms_aliasNameRef, _aws_cdk_aws_autoscaling_generateLaunchTemplateInsteadOfLaunchConfig, _aws_cdk_core_includePrefixInUniqueNameGeneration, _aws_cdk_aws_efs_denyAnonymousAccess, _aws_cdk_aws_opensearchservice_enableOpensearchMultiAzWithStandby, _aws_cdk_aws_lambda_nodejs_useLatestRuntimeVersion, _aws_cdk_aws_efs_mountTargetOrderInsensitiveLogicalId, _aws_cdk_aws_rds_auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters, _aws_cdk_aws_appsync_useArnForSourceApiAssociationIdentifier, _aws_cdk_aws_rds_preventRenderingDeprecatedCredentials, _aws_cdk_aws_codepipeline_actions_useNewDefaultBranchForCodeCommitSource, _aws_cdk_aws_cloudwatch_actions_changeLambdaPermissionLogicalIdForLambdaAction, _aws_cdk_aws_codepipeline_crossAccountKeysDefaultValueToFalse, _aws_cdk_aws_codepipeline_defaultPipelineTypeToV2, _aws_cdk_aws_kms_reduceCrossAccountRegionPolicyScope, _aws_cdk_aws_eks_nodegroupNameAttribute, _aws_cdk_aws_ec2_ebsDefaultGp3Volume, _aws_cdk_aws_ecs_removeDefaultDeploymentAlarm, _aws_cdk_custom_resources_logApiResponseDataPropertyTrueDefault, _aws_cdk_aws_s3_keepNotificationInImportedBucket, _aws_cdk_aws_ecs_enableImdsBlockingDeprecatedFeature, _aws_cdk_aws_ecs_disableEcsImdsBlocking, _aws_cdk_aws_ecs_reduceEc2FargateCloudWatchPermissions, _aws_cdk_aws_dynamodb_resourcePolicyPerReplica, _aws_cdk_aws_ec2_ec2SumTImeoutEnabled, _aws_cdk_aws_appsync_appSyncGraphQLAPIScopeLambdaPermission, _aws_cdk_aws_rds_setCorrectValueForDatabaseInstanceReadReplicaInstanceResourceId, _aws_cdk_core_cfnIncludeRejectComplexResourceUpdateCreatePolicyIntrinsics, _aws_cdk_aws_lambda_nodejs_sdkV3ExcludeSmithyPackages, _aws_cdk_aws_stepfunctions_tasks_fixRunEcsTaskPolicy, _aws_cdk_aws_ec2_bastionHostUseAmazonLinux2023ByDefault, _aws_cdk_aws_route53_targets_userPoolDomainNameMethodWithoutCustomResource, _aws_cdk_aws_elasticloadbalancingV2_albDualstackWithoutPublicIpv4SecurityGroupRulesDefault, _aws_cdk_aws_iam_oidcRejectUnauthorizedConnections, _aws_cdk_core_enableAdditionalMetadataCollection, _aws_cdk_aws_lambda_createNewPoliciesWithAddToRolePolicy, _aws_cdk_aws_s3_setUniqueReplicationRoleName, _aws_cdk_aws_events_requireEventBusPolicySid, _aws_cdk_core_aspectPrioritiesMutating, _aws_cdk_aws_dynamodb_retainTableReplica, _aws_cdk_aws_stepfunctions_useDistributedMapResultWriterV2, _aws_cdk_s3_notifications_addS3TrustKeyPolicyForSnsSubscriptions, _aws_cdk_aws_ec2_requirePrivateSubnetsForEgressOnlyInternetGateway, _aws_cdk_aws_s3_publicAccessBlockedByDefault, recommended_feature_flags_default;
|
|
12947
|
+
var _aws_cdk_aws_lambda_recognizeLayerVersion, _aws_cdk_core_checkSecretUsage, _aws_cdk_core_target_partitions, _aws_cdk_containers_ecs_service_extensions_enableDefaultLogDriver, _aws_cdk_aws_ec2_uniqueImdsv2TemplateName, _aws_cdk_aws_ecs_arnFormatIncludesClusterName, _aws_cdk_aws_iam_minimizePolicies, _aws_cdk_core_validateSnapshotRemovalPolicy, _aws_cdk_aws_codepipeline_crossAccountKeyAliasStackSafeResourceName, _aws_cdk_aws_s3_createDefaultLoggingPolicy, _aws_cdk_aws_sns_subscriptions_restrictSqsDescryption, _aws_cdk_aws_apigateway_disableCloudWatchRole, _aws_cdk_core_enablePartitionLiterals, _aws_cdk_aws_events_eventsTargetQueueSameAccount, _aws_cdk_aws_ecs_disableExplicitDeploymentControllerForCircuitBreaker, _aws_cdk_aws_iam_importedRoleStackSafeDefaultPolicyName, _aws_cdk_aws_s3_serverAccessLogsUseBucketPolicy, _aws_cdk_aws_route53_patters_useCertificate, _aws_cdk_customresources_installLatestAwsSdkDefault, _aws_cdk_aws_rds_databaseProxyUniqueResourceName, _aws_cdk_aws_codedeploy_removeAlarmsFromDeploymentGroup, _aws_cdk_aws_apigateway_authorizerChangeDeploymentLogicalId, _aws_cdk_aws_ec2_launchTemplateDefaultUserData, _aws_cdk_aws_secretsmanager_useAttachedSecretResourcePolicyForSecretTargetAttachments, _aws_cdk_aws_redshift_columnId, _aws_cdk_aws_stepfunctions_tasks_enableEmrServicePolicyV2, _aws_cdk_aws_ec2_restrictDefaultSecurityGroup, _aws_cdk_aws_apigateway_requestValidatorUniqueId, _aws_cdk_aws_kms_aliasNameRef, _aws_cdk_aws_autoscaling_generateLaunchTemplateInsteadOfLaunchConfig, _aws_cdk_core_includePrefixInUniqueNameGeneration, _aws_cdk_aws_efs_denyAnonymousAccess, _aws_cdk_aws_opensearchservice_enableOpensearchMultiAzWithStandby, _aws_cdk_aws_lambda_nodejs_useLatestRuntimeVersion, _aws_cdk_aws_efs_mountTargetOrderInsensitiveLogicalId, _aws_cdk_aws_rds_auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters, _aws_cdk_aws_appsync_useArnForSourceApiAssociationIdentifier, _aws_cdk_aws_rds_preventRenderingDeprecatedCredentials, _aws_cdk_aws_codepipeline_actions_useNewDefaultBranchForCodeCommitSource, _aws_cdk_aws_cloudwatch_actions_changeLambdaPermissionLogicalIdForLambdaAction, _aws_cdk_aws_codepipeline_crossAccountKeysDefaultValueToFalse, _aws_cdk_aws_codepipeline_defaultPipelineTypeToV2, _aws_cdk_aws_kms_reduceCrossAccountRegionPolicyScope, _aws_cdk_aws_eks_nodegroupNameAttribute, _aws_cdk_aws_ec2_ebsDefaultGp3Volume, _aws_cdk_aws_ecs_removeDefaultDeploymentAlarm, _aws_cdk_custom_resources_logApiResponseDataPropertyTrueDefault, _aws_cdk_aws_s3_keepNotificationInImportedBucket, _aws_cdk_aws_ecs_enableImdsBlockingDeprecatedFeature, _aws_cdk_aws_ecs_disableEcsImdsBlocking, _aws_cdk_aws_ecs_reduceEc2FargateCloudWatchPermissions, _aws_cdk_aws_dynamodb_resourcePolicyPerReplica, _aws_cdk_aws_ec2_ec2SumTImeoutEnabled, _aws_cdk_aws_appsync_appSyncGraphQLAPIScopeLambdaPermission, _aws_cdk_aws_rds_setCorrectValueForDatabaseInstanceReadReplicaInstanceResourceId, _aws_cdk_core_cfnIncludeRejectComplexResourceUpdateCreatePolicyIntrinsics, _aws_cdk_aws_lambda_nodejs_sdkV3ExcludeSmithyPackages, _aws_cdk_aws_stepfunctions_tasks_fixRunEcsTaskPolicy, _aws_cdk_aws_ec2_bastionHostUseAmazonLinux2023ByDefault, _aws_cdk_aws_route53_targets_userPoolDomainNameMethodWithoutCustomResource, _aws_cdk_aws_elasticloadbalancingV2_albDualstackWithoutPublicIpv4SecurityGroupRulesDefault, _aws_cdk_aws_iam_oidcRejectUnauthorizedConnections, _aws_cdk_core_enableAdditionalMetadataCollection, _aws_cdk_aws_lambda_createNewPoliciesWithAddToRolePolicy, _aws_cdk_aws_s3_setUniqueReplicationRoleName, _aws_cdk_aws_events_requireEventBusPolicySid, _aws_cdk_core_aspectPrioritiesMutating, _aws_cdk_aws_dynamodb_retainTableReplica, _aws_cdk_aws_stepfunctions_useDistributedMapResultWriterV2, _aws_cdk_s3_notifications_addS3TrustKeyPolicyForSnsSubscriptions, _aws_cdk_aws_ec2_requirePrivateSubnetsForEgressOnlyInternetGateway, _aws_cdk_aws_s3_publicAccessBlockedByDefault, _aws_cdk_aws_lambda_useCdkManagedLogGroup, recommended_feature_flags_default;
|
|
12915
12948
|
var init_recommended_feature_flags = __esm({
|
|
12916
12949
|
"lib/recommended-feature-flags.json"() {
|
|
12917
12950
|
_aws_cdk_aws_lambda_recognizeLayerVersion = true;
|
|
@@ -12989,6 +13022,7 @@ var init_recommended_feature_flags = __esm({
|
|
|
12989
13022
|
_aws_cdk_s3_notifications_addS3TrustKeyPolicyForSnsSubscriptions = true;
|
|
12990
13023
|
_aws_cdk_aws_ec2_requirePrivateSubnetsForEgressOnlyInternetGateway = true;
|
|
12991
13024
|
_aws_cdk_aws_s3_publicAccessBlockedByDefault = true;
|
|
13025
|
+
_aws_cdk_aws_lambda_useCdkManagedLogGroup = true;
|
|
12992
13026
|
recommended_feature_flags_default = {
|
|
12993
13027
|
"@aws-cdk/aws-lambda:recognizeLayerVersion": _aws_cdk_aws_lambda_recognizeLayerVersion,
|
|
12994
13028
|
"@aws-cdk/core:checkSecretUsage": _aws_cdk_core_checkSecretUsage,
|
|
@@ -13061,7 +13095,8 @@ var init_recommended_feature_flags = __esm({
|
|
|
13061
13095
|
"@aws-cdk/aws-stepfunctions:useDistributedMapResultWriterV2": _aws_cdk_aws_stepfunctions_useDistributedMapResultWriterV2,
|
|
13062
13096
|
"@aws-cdk/s3-notifications:addS3TrustKeyPolicyForSnsSubscriptions": _aws_cdk_s3_notifications_addS3TrustKeyPolicyForSnsSubscriptions,
|
|
13063
13097
|
"@aws-cdk/aws-ec2:requirePrivateSubnetsForEgressOnlyInternetGateway": _aws_cdk_aws_ec2_requirePrivateSubnetsForEgressOnlyInternetGateway,
|
|
13064
|
-
"@aws-cdk/aws-s3:publicAccessBlockedByDefault": _aws_cdk_aws_s3_publicAccessBlockedByDefault
|
|
13098
|
+
"@aws-cdk/aws-s3:publicAccessBlockedByDefault": _aws_cdk_aws_s3_publicAccessBlockedByDefault,
|
|
13099
|
+
"@aws-cdk/aws-lambda:useCdkManagedLogGroup": _aws_cdk_aws_lambda_useCdkManagedLogGroup
|
|
13065
13100
|
};
|
|
13066
13101
|
}
|
|
13067
13102
|
});
|
|
@@ -13096,6 +13131,14 @@ function chunks(command) {
|
|
|
13096
13131
|
const result = command.match(/(?:[^\s"]+|"[^"]*")+/g);
|
|
13097
13132
|
return result ?? [];
|
|
13098
13133
|
}
|
|
13134
|
+
function promiseWithResolvers() {
|
|
13135
|
+
let resolve3, reject;
|
|
13136
|
+
const promise = new Promise((res, rej) => {
|
|
13137
|
+
resolve3 = res;
|
|
13138
|
+
reject = rej;
|
|
13139
|
+
});
|
|
13140
|
+
return { promise, resolve: resolve3, reject };
|
|
13141
|
+
}
|
|
13099
13142
|
var import_child_process2;
|
|
13100
13143
|
var init_utils2 = __esm({
|
|
13101
13144
|
"lib/utils.ts"() {
|
|
@@ -13332,7 +13375,7 @@ var require_asset_manifest = __commonJS({
|
|
|
13332
13375
|
});
|
|
13333
13376
|
|
|
13334
13377
|
// lib/runner/private/cloud-assembly.ts
|
|
13335
|
-
var path2, import_cloud_assembly_schema3, import_asset_manifest, fs4,
|
|
13378
|
+
var path2, import_cloud_assembly_schema3, import_asset_manifest, fs4, AssemblyManifestReader;
|
|
13336
13379
|
var init_cloud_assembly2 = __esm({
|
|
13337
13380
|
"lib/runner/private/cloud-assembly.ts"() {
|
|
13338
13381
|
"use strict";
|
|
@@ -13340,12 +13383,15 @@ var init_cloud_assembly2 = __esm({
|
|
|
13340
13383
|
import_cloud_assembly_schema3 = __toESM(require_lib3());
|
|
13341
13384
|
import_asset_manifest = __toESM(require_asset_manifest());
|
|
13342
13385
|
fs4 = __toESM(require_lib5());
|
|
13343
|
-
|
|
13386
|
+
AssemblyManifestReader = class _AssemblyManifestReader {
|
|
13344
13387
|
constructor(directory, manifest, manifestFileName) {
|
|
13345
13388
|
this.manifest = manifest;
|
|
13346
13389
|
this.manifestFileName = manifestFileName;
|
|
13347
13390
|
this.directory = directory;
|
|
13348
13391
|
}
|
|
13392
|
+
static {
|
|
13393
|
+
this.DEFAULT_FILENAME = "manifest.json";
|
|
13394
|
+
}
|
|
13349
13395
|
/**
|
|
13350
13396
|
* Reads a Cloud Assembly manifest from a file
|
|
13351
13397
|
*/
|
|
@@ -13396,10 +13442,7 @@ var init_cloud_assembly2 = __esm({
|
|
|
13396
13442
|
*/
|
|
13397
13443
|
getNestedStacksForStack(stackId) {
|
|
13398
13444
|
const nestedTemplates = this.getAssetManifestsForStack(stackId).flatMap(
|
|
13399
|
-
(manifest) => manifest.files.filter((asset) =>
|
|
13400
|
-
var _a;
|
|
13401
|
-
return (_a = asset.source.path) == null ? void 0 : _a.endsWith(".nested.template.json");
|
|
13402
|
-
}).map((asset) => asset.source.path)
|
|
13445
|
+
(manifest) => manifest.files.filter((asset) => asset.source.path?.endsWith(".nested.template.json")).map((asset) => asset.source.path)
|
|
13403
13446
|
);
|
|
13404
13447
|
const nestedStacks = Object.fromEntries(nestedTemplates.map((templateFile) => [
|
|
13405
13448
|
templateFile.split(".", 1)[0],
|
|
@@ -13421,10 +13464,9 @@ var init_cloud_assembly2 = __esm({
|
|
|
13421
13464
|
* Return a list of assets for a given stack
|
|
13422
13465
|
*/
|
|
13423
13466
|
getAssetIdsForStack(stackId) {
|
|
13424
|
-
var _a;
|
|
13425
13467
|
const assets = [];
|
|
13426
13468
|
for (const artifact of Object.values(this.manifest.artifacts ?? {})) {
|
|
13427
|
-
if (artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST &&
|
|
13469
|
+
if (artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST && artifact.properties?.file === `${stackId}.assets.json`) {
|
|
13428
13470
|
assets.push(...this.assetsFromAssetManifest(artifact).map((asset) => asset.id.assetId));
|
|
13429
13471
|
} else if (artifact.type === import_cloud_assembly_schema3.ArtifactType.AWS_CLOUDFORMATION_STACK) {
|
|
13430
13472
|
assets.push(...this.assetsFromAssemblyManifest(artifact).map((asset) => asset.id));
|
|
@@ -13436,13 +13478,11 @@ var init_cloud_assembly2 = __esm({
|
|
|
13436
13478
|
* For a given stackId return a list of assets that belong to the stack
|
|
13437
13479
|
*/
|
|
13438
13480
|
getAssetLocationsForStack(stackId) {
|
|
13439
|
-
var _a;
|
|
13440
13481
|
const assets = [];
|
|
13441
13482
|
for (const artifact of Object.values(this.manifest.artifacts ?? {})) {
|
|
13442
|
-
if (artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST &&
|
|
13483
|
+
if (artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST && artifact.properties?.file === `${stackId}.assets.json`) {
|
|
13443
13484
|
assets.push(...this.assetsFromAssetManifest(artifact).flatMap((asset) => {
|
|
13444
|
-
|
|
13445
|
-
if (asset.type === "file" && !((_a2 = asset.source.path) == null ? void 0 : _a2.endsWith("nested.template.json"))) {
|
|
13485
|
+
if (asset.type === "file" && !asset.source.path?.endsWith("nested.template.json")) {
|
|
13446
13486
|
return asset.source.path;
|
|
13447
13487
|
} else if (asset.type !== "file") {
|
|
13448
13488
|
return asset.source.directory;
|
|
@@ -13459,10 +13499,7 @@ var init_cloud_assembly2 = __esm({
|
|
|
13459
13499
|
* Return a list of asset artifacts for a given stack
|
|
13460
13500
|
*/
|
|
13461
13501
|
getAssetManifestsForStack(stackId) {
|
|
13462
|
-
return Object.values(this.manifest.artifacts ?? {}).filter((artifact) => {
|
|
13463
|
-
var _a;
|
|
13464
|
-
return artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST && ((_a = artifact.properties) == null ? void 0 : _a.file) === `${stackId}.assets.json`;
|
|
13465
|
-
}).map((artifact) => {
|
|
13502
|
+
return Object.values(this.manifest.artifacts ?? {}).filter((artifact) => artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST && artifact.properties?.file === `${stackId}.assets.json`).map((artifact) => {
|
|
13466
13503
|
const fileName = artifact.properties.file;
|
|
13467
13504
|
return import_asset_manifest.AssetManifest.fromFile(path2.join(this.directory, fileName));
|
|
13468
13505
|
});
|
|
@@ -13566,8 +13603,6 @@ var init_cloud_assembly2 = __esm({
|
|
|
13566
13603
|
return newArtifacts;
|
|
13567
13604
|
}
|
|
13568
13605
|
};
|
|
13569
|
-
_AssemblyManifestReader.DEFAULT_FILENAME = "manifest.json";
|
|
13570
|
-
AssemblyManifestReader = _AssemblyManifestReader;
|
|
13571
13606
|
}
|
|
13572
13607
|
});
|
|
13573
13608
|
|
|
@@ -13614,42 +13649,36 @@ var init_runner_base = __esm({
|
|
|
13614
13649
|
const testRunCommand = this.test.appCommand;
|
|
13615
13650
|
this.cdkApp = testRunCommand.replace("{filePath}", path3.relative(this.directory, this.test.fileName));
|
|
13616
13651
|
this.profile = options.profile;
|
|
13617
|
-
if (this.hasSnapshot()) {
|
|
13618
|
-
this.expectedTestSuite = this.loadManifest();
|
|
13619
|
-
}
|
|
13620
|
-
this.actualTestSuite = this.generateActualSnapshot();
|
|
13621
13652
|
}
|
|
13622
13653
|
/**
|
|
13623
13654
|
* Return the list of expected (i.e. existing) test cases for this integration test
|
|
13624
13655
|
*/
|
|
13625
|
-
expectedTests() {
|
|
13626
|
-
|
|
13627
|
-
return (_a = this.expectedTestSuite) == null ? void 0 : _a.testSuite;
|
|
13656
|
+
async expectedTests() {
|
|
13657
|
+
return (await this.expectedTestSuite())?.testSuite;
|
|
13628
13658
|
}
|
|
13629
13659
|
/**
|
|
13630
13660
|
* Return the list of actual (i.e. new) test cases for this integration test
|
|
13631
13661
|
*/
|
|
13632
|
-
actualTests() {
|
|
13633
|
-
return this.actualTestSuite.testSuite;
|
|
13662
|
+
async actualTests() {
|
|
13663
|
+
return (await this.actualTestSuite()).testSuite;
|
|
13634
13664
|
}
|
|
13635
13665
|
/**
|
|
13636
13666
|
* Generate a new "actual" snapshot which will be compared to the
|
|
13637
13667
|
* existing "expected" snapshot
|
|
13638
13668
|
* This will synth and then load the integration test manifest
|
|
13639
13669
|
*/
|
|
13640
|
-
generateActualSnapshot() {
|
|
13641
|
-
|
|
13642
|
-
this.cdk.synthFast({
|
|
13670
|
+
async generateActualSnapshot() {
|
|
13671
|
+
await this.cdk.synthFast({
|
|
13643
13672
|
execCmd: this.cdkApp.split(" "),
|
|
13644
13673
|
env: {
|
|
13645
13674
|
...DEFAULT_SYNTH_OPTIONS.env,
|
|
13646
13675
|
// we don't know the "actual" context yet (this method is what generates it) so just
|
|
13647
13676
|
// use the "expected" context. This is only run in order to read the manifest
|
|
13648
|
-
CDK_CONTEXT_JSON: JSON.stringify(this.getContext((
|
|
13677
|
+
CDK_CONTEXT_JSON: JSON.stringify(this.getContext((await this.expectedTestSuite())?.synthContext))
|
|
13649
13678
|
},
|
|
13650
13679
|
output: path3.relative(this.directory, this.cdkOutDir)
|
|
13651
13680
|
});
|
|
13652
|
-
const manifest = this.loadManifest(this.cdkOutDir);
|
|
13681
|
+
const manifest = await this.loadManifest(this.cdkOutDir);
|
|
13653
13682
|
this.cleanup();
|
|
13654
13683
|
return manifest;
|
|
13655
13684
|
}
|
|
@@ -13659,6 +13688,24 @@ var init_runner_base = __esm({
|
|
|
13659
13688
|
hasSnapshot() {
|
|
13660
13689
|
return fs5.existsSync(this.snapshotDir);
|
|
13661
13690
|
}
|
|
13691
|
+
/**
|
|
13692
|
+
* The test suite from the existing snapshot
|
|
13693
|
+
*/
|
|
13694
|
+
async expectedTestSuite() {
|
|
13695
|
+
if (!this._expectedTestSuite && this.hasSnapshot()) {
|
|
13696
|
+
this._expectedTestSuite = await this.loadManifest();
|
|
13697
|
+
}
|
|
13698
|
+
return this._expectedTestSuite;
|
|
13699
|
+
}
|
|
13700
|
+
/**
|
|
13701
|
+
* The test suite from the new "actual" snapshot
|
|
13702
|
+
*/
|
|
13703
|
+
async actualTestSuite() {
|
|
13704
|
+
if (!this._actualTestSuite) {
|
|
13705
|
+
this._actualTestSuite = await this.generateActualSnapshot();
|
|
13706
|
+
}
|
|
13707
|
+
return this._actualTestSuite;
|
|
13708
|
+
}
|
|
13662
13709
|
/**
|
|
13663
13710
|
* Load the integ manifest which contains information
|
|
13664
13711
|
* on how to execute the tests
|
|
@@ -13666,12 +13713,12 @@ var init_runner_base = __esm({
|
|
|
13666
13713
|
* from the cloud assembly. If it doesn't exist, then we fallback to the
|
|
13667
13714
|
* "legacy mode" and create a manifest from pragma
|
|
13668
13715
|
*/
|
|
13669
|
-
loadManifest(dir) {
|
|
13716
|
+
async loadManifest(dir) {
|
|
13670
13717
|
try {
|
|
13671
13718
|
const testSuite = IntegTestSuite.fromPath(dir ?? this.snapshotDir);
|
|
13672
13719
|
return testSuite;
|
|
13673
13720
|
} catch {
|
|
13674
|
-
const testCases = LegacyIntegTestSuite.fromLegacy({
|
|
13721
|
+
const testCases = await LegacyIntegTestSuite.fromLegacy({
|
|
13675
13722
|
cdk: this.cdk,
|
|
13676
13723
|
testName: this.test.normalizedTestName,
|
|
13677
13724
|
integSourceFilePath: this.test.fileName,
|
|
@@ -13684,7 +13731,6 @@ var init_runner_base = __esm({
|
|
|
13684
13731
|
}
|
|
13685
13732
|
});
|
|
13686
13733
|
this.legacyContext = LegacyIntegTestSuite.getPragmaContext(this.test.fileName);
|
|
13687
|
-
this.isLegacyTest = true;
|
|
13688
13734
|
return testCases;
|
|
13689
13735
|
}
|
|
13690
13736
|
}
|
|
@@ -13722,8 +13768,8 @@ var init_runner_base = __esm({
|
|
|
13722
13768
|
* disabled and then delete assets that relate to that stack. It does that
|
|
13723
13769
|
* by reading the asset manifest for the stack and deleting the asset source
|
|
13724
13770
|
*/
|
|
13725
|
-
removeAssetsFromSnapshot() {
|
|
13726
|
-
const stacks = this.actualTestSuite.getStacksWithoutUpdateWorkflow() ?? [];
|
|
13771
|
+
async removeAssetsFromSnapshot() {
|
|
13772
|
+
const stacks = (await this.actualTestSuite()).getStacksWithoutUpdateWorkflow() ?? [];
|
|
13727
13773
|
const manifest = AssemblyManifestReader.fromPath(this.snapshotDir);
|
|
13728
13774
|
const assets = flatten(stacks.map((stack) => {
|
|
13729
13775
|
return manifest.getAssetLocationsForStack(stack) ?? [];
|
|
@@ -13764,12 +13810,12 @@ var init_runner_base = __esm({
|
|
|
13764
13810
|
* If lookups are disabled (which means the stack is env agnostic) then just copy
|
|
13765
13811
|
* the assembly that was output by the deployment
|
|
13766
13812
|
*/
|
|
13767
|
-
createSnapshot() {
|
|
13813
|
+
async createSnapshot() {
|
|
13768
13814
|
if (fs5.existsSync(this.snapshotDir)) {
|
|
13769
13815
|
fs5.removeSync(this.snapshotDir);
|
|
13770
13816
|
}
|
|
13771
|
-
if (this.actualTestSuite.enableLookups) {
|
|
13772
|
-
this.cdk.synthFast({
|
|
13817
|
+
if ((await this.actualTestSuite()).enableLookups) {
|
|
13818
|
+
await this.cdk.synthFast({
|
|
13773
13819
|
execCmd: this.cdkApp.split(" "),
|
|
13774
13820
|
env: {
|
|
13775
13821
|
...DEFAULT_SYNTH_OPTIONS.env,
|
|
@@ -13780,23 +13826,24 @@ var init_runner_base = __esm({
|
|
|
13780
13826
|
} else {
|
|
13781
13827
|
fs5.moveSync(this.cdkOutDir, this.snapshotDir, { overwrite: true });
|
|
13782
13828
|
}
|
|
13783
|
-
this.cleanupSnapshot();
|
|
13829
|
+
await this.cleanupSnapshot();
|
|
13784
13830
|
}
|
|
13785
13831
|
/**
|
|
13786
13832
|
* Perform some cleanup steps after the snapshot is created
|
|
13787
13833
|
* Anytime the snapshot needs to be modified after creation
|
|
13788
13834
|
* the logic should live here.
|
|
13789
13835
|
*/
|
|
13790
|
-
cleanupSnapshot() {
|
|
13836
|
+
async cleanupSnapshot() {
|
|
13791
13837
|
if (fs5.existsSync(this.snapshotDir)) {
|
|
13792
|
-
this.removeAssetsFromSnapshot();
|
|
13838
|
+
await this.removeAssetsFromSnapshot();
|
|
13793
13839
|
this.removeAssetsCacheFromSnapshot();
|
|
13794
13840
|
const assembly = AssemblyManifestReader.fromPath(this.snapshotDir);
|
|
13795
13841
|
assembly.cleanManifest();
|
|
13796
13842
|
assembly.recordTrace(this.renderTraceData());
|
|
13797
13843
|
}
|
|
13798
|
-
|
|
13799
|
-
|
|
13844
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
13845
|
+
if (actualTestSuite.type === "legacy-test-suite") {
|
|
13846
|
+
actualTestSuite.saveManifest(this.snapshotDir, this.legacyContext);
|
|
13800
13847
|
}
|
|
13801
13848
|
}
|
|
13802
13849
|
getContext(additionalContext) {
|
|
@@ -20518,7 +20565,7 @@ function formatAssertionResults(results) {
|
|
|
20518
20565
|
${result.message}`)).join("\n ");
|
|
20519
20566
|
}
|
|
20520
20567
|
var import_util, chalk2;
|
|
20521
|
-
var
|
|
20568
|
+
var init_common2 = __esm({
|
|
20522
20569
|
"lib/workers/common.ts"() {
|
|
20523
20570
|
"use strict";
|
|
20524
20571
|
import_util = require("util");
|
|
@@ -20541,17 +20588,21 @@ var init_integ_test_runner = __esm({
|
|
|
20541
20588
|
init_runner_base();
|
|
20542
20589
|
init_logger();
|
|
20543
20590
|
init_utils2();
|
|
20544
|
-
|
|
20591
|
+
init_common2();
|
|
20545
20592
|
IntegTestRunner = class extends IntegRunner {
|
|
20546
20593
|
constructor(options, destructiveChanges) {
|
|
20547
20594
|
super(options);
|
|
20548
20595
|
this._destructiveChanges = destructiveChanges;
|
|
20549
|
-
|
|
20596
|
+
}
|
|
20597
|
+
async actualTests() {
|
|
20598
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
20599
|
+
if (!this.hasSnapshot() && actualTestSuite.type === "legacy-test-suite") {
|
|
20550
20600
|
throw new Error(
|
|
20551
20601
|
`${this.testName} is a new test. Please use the IntegTest construct to configure the test
|
|
20552
20602
|
https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
20553
20603
|
);
|
|
20554
20604
|
}
|
|
20605
|
+
return actualTestSuite.testSuite;
|
|
20555
20606
|
}
|
|
20556
20607
|
createCdkContextJson() {
|
|
20557
20608
|
if (!fs6.existsSync(this.cdkContextPath)) {
|
|
@@ -20618,9 +20669,10 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20618
20669
|
* This is meant to be run on a single test and will not create a snapshot
|
|
20619
20670
|
*/
|
|
20620
20671
|
async watchIntegTest(options) {
|
|
20621
|
-
const
|
|
20672
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
20673
|
+
const actualTestCase = actualTestSuite.testSuite[options.testCaseName];
|
|
20622
20674
|
if (!actualTestCase) {
|
|
20623
|
-
throw new Error(`Did not find test case name '${options.testCaseName}' in '${Object.keys(
|
|
20675
|
+
throw new Error(`Did not find test case name '${options.testCaseName}' in '${Object.keys(actualTestSuite.testSuite)}'`);
|
|
20624
20676
|
}
|
|
20625
20677
|
const enableForVerbosityLevel = (needed = 1) => {
|
|
20626
20678
|
const verbosity = options.verbosity ?? 0;
|
|
@@ -20658,12 +20710,12 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20658
20710
|
* The update workflow exists to check for cases where a change would cause
|
|
20659
20711
|
* a failure to an existing stack, but not for a newly created stack.
|
|
20660
20712
|
*/
|
|
20661
|
-
runIntegTestCase(options) {
|
|
20662
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
20713
|
+
async runIntegTestCase(options) {
|
|
20663
20714
|
let assertionResults;
|
|
20664
|
-
const
|
|
20715
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
20716
|
+
const actualTestCase = actualTestSuite.testSuite[options.testCaseName];
|
|
20665
20717
|
if (!actualTestCase) {
|
|
20666
|
-
throw new Error(`Did not find test case name '${options.testCaseName}' in '${Object.keys(
|
|
20718
|
+
throw new Error(`Did not find test case name '${options.testCaseName}' in '${Object.keys(actualTestSuite.testSuite)}'`);
|
|
20667
20719
|
}
|
|
20668
20720
|
const clean = options.clean ?? true;
|
|
20669
20721
|
const updateWorkflowEnabled = (options.updateWorkflow ?? true) && (actualTestCase.stackUpdateWorkflow ?? true);
|
|
@@ -20672,8 +20724,8 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20672
20724
|
return verbosity >= needed ? true : void 0;
|
|
20673
20725
|
};
|
|
20674
20726
|
try {
|
|
20675
|
-
if (!options.dryRun && (
|
|
20676
|
-
assertionResults = this.deploy(
|
|
20727
|
+
if (!options.dryRun && (actualTestCase.cdkCommandOptions?.deploy?.enabled ?? true)) {
|
|
20728
|
+
assertionResults = await this.deploy(
|
|
20677
20729
|
{
|
|
20678
20730
|
...this.defaultArgs,
|
|
20679
20731
|
profile: this.profile,
|
|
@@ -20688,32 +20740,32 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20688
20740
|
const env = {
|
|
20689
20741
|
...DEFAULT_SYNTH_OPTIONS.env,
|
|
20690
20742
|
CDK_CONTEXT_JSON: JSON.stringify(this.getContext({
|
|
20691
|
-
...
|
|
20743
|
+
...actualTestSuite.enableLookups ? DEFAULT_SYNTH_OPTIONS.context : {}
|
|
20692
20744
|
}))
|
|
20693
20745
|
};
|
|
20694
|
-
this.cdk.synthFast({
|
|
20746
|
+
await this.cdk.synthFast({
|
|
20695
20747
|
execCmd: this.cdkApp.split(" "),
|
|
20696
20748
|
env,
|
|
20697
20749
|
output: path4.relative(this.directory, this.cdkOutDir)
|
|
20698
20750
|
});
|
|
20699
20751
|
}
|
|
20700
20752
|
if (!assertionResults || !Object.values(assertionResults).some((result) => result.status === "fail")) {
|
|
20701
|
-
this.createSnapshot();
|
|
20753
|
+
await this.createSnapshot();
|
|
20702
20754
|
}
|
|
20703
20755
|
} catch (e) {
|
|
20704
20756
|
throw e;
|
|
20705
20757
|
} finally {
|
|
20706
20758
|
if (!options.dryRun) {
|
|
20707
|
-
if (clean && (
|
|
20708
|
-
this.destroy(options.testCaseName, {
|
|
20759
|
+
if (clean && (actualTestCase.cdkCommandOptions?.destroy?.enabled ?? true)) {
|
|
20760
|
+
await this.destroy(options.testCaseName, {
|
|
20709
20761
|
...this.defaultArgs,
|
|
20710
20762
|
profile: this.profile,
|
|
20711
20763
|
all: true,
|
|
20712
20764
|
force: true,
|
|
20713
20765
|
app: this.cdkApp,
|
|
20714
20766
|
output: path4.relative(this.directory, this.cdkOutDir),
|
|
20715
|
-
...
|
|
20716
|
-
context: this.getContext(
|
|
20767
|
+
...actualTestCase.cdkCommandOptions?.destroy?.args,
|
|
20768
|
+
context: this.getContext(actualTestCase.cdkCommandOptions?.destroy?.args?.context),
|
|
20717
20769
|
verbose: enableForVerbosityLevel(3),
|
|
20718
20770
|
debug: enableForVerbosityLevel(4)
|
|
20719
20771
|
});
|
|
@@ -20726,21 +20778,20 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20726
20778
|
/**
|
|
20727
20779
|
* Perform a integ test case stack destruction
|
|
20728
20780
|
*/
|
|
20729
|
-
destroy(testCaseName, destroyArgs) {
|
|
20730
|
-
|
|
20731
|
-
const actualTestCase = this.actualTestSuite.testSuite[testCaseName];
|
|
20781
|
+
async destroy(testCaseName, destroyArgs) {
|
|
20782
|
+
const actualTestCase = (await this.actualTestSuite()).testSuite[testCaseName];
|
|
20732
20783
|
try {
|
|
20733
|
-
if (
|
|
20784
|
+
if (actualTestCase.hooks?.preDestroy) {
|
|
20734
20785
|
actualTestCase.hooks.preDestroy.forEach((cmd) => {
|
|
20735
20786
|
exec2(chunks(cmd), {
|
|
20736
20787
|
cwd: path4.dirname(this.snapshotDir)
|
|
20737
20788
|
});
|
|
20738
20789
|
});
|
|
20739
20790
|
}
|
|
20740
|
-
this.cdk.destroy({
|
|
20791
|
+
await this.cdk.destroy({
|
|
20741
20792
|
...destroyArgs
|
|
20742
20793
|
});
|
|
20743
|
-
if (
|
|
20794
|
+
if (actualTestCase.hooks?.postDestroy) {
|
|
20744
20795
|
actualTestCase.hooks.postDestroy.forEach((cmd) => {
|
|
20745
20796
|
exec2(chunks(cmd), {
|
|
20746
20797
|
cwd: path4.dirname(this.snapshotDir)
|
|
@@ -20750,15 +20801,15 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20750
20801
|
} catch (e) {
|
|
20751
20802
|
this.parseError(
|
|
20752
20803
|
e,
|
|
20753
|
-
|
|
20754
|
-
|
|
20804
|
+
actualTestCase.cdkCommandOptions?.destroy?.expectError ?? false,
|
|
20805
|
+
actualTestCase.cdkCommandOptions?.destroy?.expectedMessage
|
|
20755
20806
|
);
|
|
20756
20807
|
}
|
|
20757
20808
|
}
|
|
20758
20809
|
async watch(watchArgs, testCaseName, verbosity) {
|
|
20759
|
-
|
|
20760
|
-
const actualTestCase =
|
|
20761
|
-
if (
|
|
20810
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
20811
|
+
const actualTestCase = actualTestSuite.testSuite[testCaseName];
|
|
20812
|
+
if (actualTestCase.hooks?.preDeploy) {
|
|
20762
20813
|
actualTestCase.hooks.preDeploy.forEach((cmd) => {
|
|
20763
20814
|
exec2(chunks(cmd), {
|
|
20764
20815
|
cwd: path4.dirname(this.snapshotDir)
|
|
@@ -20767,16 +20818,16 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20767
20818
|
}
|
|
20768
20819
|
const deployArgs = {
|
|
20769
20820
|
...watchArgs,
|
|
20770
|
-
lookups:
|
|
20821
|
+
lookups: actualTestSuite.enableLookups,
|
|
20771
20822
|
stacks: [
|
|
20772
20823
|
...actualTestCase.stacks,
|
|
20773
20824
|
...actualTestCase.assertionStack ? [actualTestCase.assertionStack] : []
|
|
20774
20825
|
],
|
|
20775
20826
|
output: path4.relative(this.directory, this.cdkOutDir),
|
|
20776
20827
|
outputsFile: path4.relative(this.directory, path4.join(this.cdkOutDir, "assertion-results.json")),
|
|
20777
|
-
...
|
|
20828
|
+
...actualTestCase?.cdkCommandOptions?.deploy?.args,
|
|
20778
20829
|
context: {
|
|
20779
|
-
...this.getContext(
|
|
20830
|
+
...this.getContext(actualTestCase?.cdkCommandOptions?.deploy?.args?.context)
|
|
20780
20831
|
},
|
|
20781
20832
|
app: this.cdkApp
|
|
20782
20833
|
};
|
|
@@ -20815,10 +20866,9 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20815
20866
|
cwd: this.directory
|
|
20816
20867
|
});
|
|
20817
20868
|
watcher.on("all", (event, file) => {
|
|
20818
|
-
var _a2;
|
|
20819
20869
|
if (assertionResults.endsWith(file) && (event === "add" || event === "change")) {
|
|
20820
20870
|
const start = Date.now();
|
|
20821
|
-
if (
|
|
20871
|
+
if (actualTestCase.hooks?.postDeploy) {
|
|
20822
20872
|
actualTestCase.hooks.postDeploy.forEach((cmd) => {
|
|
20823
20873
|
exec2(chunks(cmd), {
|
|
20824
20874
|
cwd: path4.dirname(this.snapshotDir)
|
|
@@ -20850,88 +20900,89 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20850
20900
|
}
|
|
20851
20901
|
}
|
|
20852
20902
|
});
|
|
20853
|
-
await new Promise((
|
|
20903
|
+
await new Promise((resolve4) => {
|
|
20854
20904
|
watcher.on("ready", async () => {
|
|
20855
|
-
|
|
20905
|
+
resolve4({});
|
|
20856
20906
|
});
|
|
20857
20907
|
});
|
|
20858
|
-
const
|
|
20859
|
-
|
|
20860
|
-
if (
|
|
20861
|
-
|
|
20862
|
-
|
|
20863
|
-
|
|
20864
|
-
|
|
20865
|
-
|
|
20866
|
-
|
|
20867
|
-
|
|
20868
|
-
|
|
20869
|
-
|
|
20870
|
-
|
|
20871
|
-
|
|
20908
|
+
const { promise: waiter, resolve: resolve3 } = promiseWithResolvers();
|
|
20909
|
+
await this.cdk.watch(deployArgs, {
|
|
20910
|
+
// if `-v` (or above) is passed then stream the logs
|
|
20911
|
+
onStdout: (message) => {
|
|
20912
|
+
if (verbosity > 0) {
|
|
20913
|
+
process.stdout.write(message);
|
|
20914
|
+
}
|
|
20915
|
+
},
|
|
20916
|
+
// if `-v` (or above) is passed then stream the logs
|
|
20917
|
+
onStderr: (message) => {
|
|
20918
|
+
if (verbosity > 0) {
|
|
20919
|
+
process.stderr.write(message);
|
|
20920
|
+
}
|
|
20921
|
+
},
|
|
20922
|
+
onClose: async (code) => {
|
|
20872
20923
|
if (code !== 0) {
|
|
20873
20924
|
throw new Error("Watch exited with error");
|
|
20874
20925
|
}
|
|
20875
|
-
(_a2 = child.stdin) == null ? void 0 : _a2.end();
|
|
20876
20926
|
await watcher.close();
|
|
20877
20927
|
resolve3(code);
|
|
20878
|
-
}
|
|
20928
|
+
}
|
|
20879
20929
|
});
|
|
20930
|
+
await waiter;
|
|
20880
20931
|
}
|
|
20881
20932
|
/**
|
|
20882
20933
|
* Perform a integ test case deployment, including
|
|
20883
|
-
*
|
|
20934
|
+
* performing the update workflow
|
|
20884
20935
|
*/
|
|
20885
|
-
deploy(deployArgs, updateWorkflowEnabled, testCaseName) {
|
|
20886
|
-
|
|
20887
|
-
const actualTestCase = this.actualTestSuite.testSuite[testCaseName];
|
|
20936
|
+
async deploy(deployArgs, updateWorkflowEnabled, testCaseName) {
|
|
20937
|
+
const actualTestCase = (await this.actualTestSuite()).testSuite[testCaseName];
|
|
20888
20938
|
try {
|
|
20889
|
-
if (
|
|
20939
|
+
if (actualTestCase.hooks?.preDeploy) {
|
|
20890
20940
|
actualTestCase.hooks.preDeploy.forEach((cmd) => {
|
|
20891
20941
|
exec2(chunks(cmd), {
|
|
20892
20942
|
cwd: path4.dirname(this.snapshotDir)
|
|
20893
20943
|
});
|
|
20894
20944
|
});
|
|
20895
20945
|
}
|
|
20896
|
-
|
|
20946
|
+
const expectedTestSuite = await this.expectedTestSuite();
|
|
20947
|
+
if (updateWorkflowEnabled && this.hasSnapshot() && (expectedTestSuite && testCaseName in expectedTestSuite?.testSuite)) {
|
|
20897
20948
|
this.checkoutSnapshot();
|
|
20898
|
-
const expectedTestCase =
|
|
20899
|
-
this.cdk.deploy({
|
|
20949
|
+
const expectedTestCase = expectedTestSuite.testSuite[testCaseName];
|
|
20950
|
+
await this.cdk.deploy({
|
|
20900
20951
|
...deployArgs,
|
|
20901
20952
|
stacks: expectedTestCase.stacks,
|
|
20902
|
-
...
|
|
20903
|
-
context: this.getContext(
|
|
20953
|
+
...expectedTestCase?.cdkCommandOptions?.deploy?.args,
|
|
20954
|
+
context: this.getContext(expectedTestCase?.cdkCommandOptions?.deploy?.args?.context),
|
|
20904
20955
|
app: path4.relative(this.directory, this.snapshotDir),
|
|
20905
|
-
lookups:
|
|
20956
|
+
lookups: expectedTestSuite?.enableLookups
|
|
20906
20957
|
});
|
|
20907
20958
|
}
|
|
20908
|
-
this.cdk.deploy({
|
|
20959
|
+
await this.cdk.deploy({
|
|
20909
20960
|
...deployArgs,
|
|
20910
|
-
lookups: this.actualTestSuite.enableLookups,
|
|
20961
|
+
lookups: (await this.actualTestSuite()).enableLookups,
|
|
20911
20962
|
stacks: [
|
|
20912
20963
|
...actualTestCase.stacks
|
|
20913
20964
|
],
|
|
20914
20965
|
output: path4.relative(this.directory, this.cdkOutDir),
|
|
20915
|
-
...
|
|
20916
|
-
context: this.getContext(
|
|
20966
|
+
...actualTestCase?.cdkCommandOptions?.deploy?.args,
|
|
20967
|
+
context: this.getContext(actualTestCase?.cdkCommandOptions?.deploy?.args?.context),
|
|
20917
20968
|
app: this.cdkApp
|
|
20918
20969
|
});
|
|
20919
20970
|
if (actualTestCase.assertionStack) {
|
|
20920
|
-
this.cdk.deploy({
|
|
20971
|
+
await this.cdk.deploy({
|
|
20921
20972
|
...deployArgs,
|
|
20922
|
-
lookups: this.actualTestSuite.enableLookups,
|
|
20973
|
+
lookups: (await this.actualTestSuite()).enableLookups,
|
|
20923
20974
|
stacks: [
|
|
20924
20975
|
actualTestCase.assertionStack
|
|
20925
20976
|
],
|
|
20926
20977
|
rollback: false,
|
|
20927
20978
|
output: path4.relative(this.directory, this.cdkOutDir),
|
|
20928
|
-
...
|
|
20979
|
+
...actualTestCase?.cdkCommandOptions?.deploy?.args,
|
|
20929
20980
|
outputsFile: path4.relative(this.directory, path4.join(this.cdkOutDir, "assertion-results.json")),
|
|
20930
|
-
context: this.getContext(
|
|
20981
|
+
context: this.getContext(actualTestCase?.cdkCommandOptions?.deploy?.args?.context),
|
|
20931
20982
|
app: this.cdkApp
|
|
20932
20983
|
});
|
|
20933
20984
|
}
|
|
20934
|
-
if (
|
|
20985
|
+
if (actualTestCase.hooks?.postDeploy) {
|
|
20935
20986
|
actualTestCase.hooks.postDeploy.forEach((cmd) => {
|
|
20936
20987
|
exec2(chunks(cmd), {
|
|
20937
20988
|
cwd: path4.dirname(this.snapshotDir)
|
|
@@ -20948,8 +20999,8 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20948
20999
|
} catch (e) {
|
|
20949
21000
|
this.parseError(
|
|
20950
21001
|
e,
|
|
20951
|
-
|
|
20952
|
-
|
|
21002
|
+
actualTestCase.cdkCommandOptions?.deploy?.expectError ?? false,
|
|
21003
|
+
actualTestCase.cdkCommandOptions?.deploy?.expectedMessage
|
|
20953
21004
|
);
|
|
20954
21005
|
}
|
|
20955
21006
|
return;
|
|
@@ -21685,6 +21736,8 @@ var require_resource = __commonJS({
|
|
|
21685
21736
|
* Update the type of this property with a new type
|
|
21686
21737
|
*
|
|
21687
21738
|
* Only if it's not in the set of types already.
|
|
21739
|
+
*
|
|
21740
|
+
* Returns true if the type was updated.
|
|
21688
21741
|
*/
|
|
21689
21742
|
updateType(type) {
|
|
21690
21743
|
const richType = new RichPropertyType(type);
|
|
@@ -21694,6 +21747,10 @@ var require_resource = __commonJS({
|
|
|
21694
21747
|
if (type.type === "string" && this.types().some((t) => t.type === "date-time")) {
|
|
21695
21748
|
return false;
|
|
21696
21749
|
}
|
|
21750
|
+
if (type.type === "string" && this.field.type.type === "json") {
|
|
21751
|
+
this.field.type = type;
|
|
21752
|
+
return true;
|
|
21753
|
+
}
|
|
21697
21754
|
if (!this.field.previousTypes) {
|
|
21698
21755
|
this.field.previousTypes = [];
|
|
21699
21756
|
}
|
|
@@ -21861,7 +21918,6 @@ var require_resource = __commonJS({
|
|
|
21861
21918
|
* otherwise on identifier
|
|
21862
21919
|
*/
|
|
21863
21920
|
sortKey(db) {
|
|
21864
|
-
var _a;
|
|
21865
21921
|
switch (this.type.type) {
|
|
21866
21922
|
case "integer":
|
|
21867
21923
|
case "boolean":
|
|
@@ -21876,7 +21932,7 @@ var require_resource = __commonJS({
|
|
|
21876
21932
|
case "map":
|
|
21877
21933
|
return ["1", this.type.type, ...new _RichPropertyType(this.type.element).sortKey(db)];
|
|
21878
21934
|
case "ref":
|
|
21879
|
-
return ["2", this.type.type,
|
|
21935
|
+
return ["2", this.type.type, db?.get("typeDefinition", this.type.reference)?.name ?? this.type.reference.$ref];
|
|
21880
21936
|
case "union":
|
|
21881
21937
|
const typeKeys = this.type.types.map((t) => new _RichPropertyType(t).sortKey(db));
|
|
21882
21938
|
typeKeys.sort((0, sorting_1.sortKeyComparator)((x) => x));
|
|
@@ -22617,6 +22673,23 @@ var init_iam_changes = __esm({
|
|
|
22617
22673
|
this.ssoAssignments.calculateDiff();
|
|
22618
22674
|
this.ssoInstanceACAConfigs.calculateDiff();
|
|
22619
22675
|
}
|
|
22676
|
+
static {
|
|
22677
|
+
this.IamPropertyScrutinies = [
|
|
22678
|
+
import_service_spec_types.PropertyScrutinyType.InlineIdentityPolicies,
|
|
22679
|
+
import_service_spec_types.PropertyScrutinyType.InlineResourcePolicy,
|
|
22680
|
+
import_service_spec_types.PropertyScrutinyType.ManagedPolicies
|
|
22681
|
+
];
|
|
22682
|
+
}
|
|
22683
|
+
static {
|
|
22684
|
+
this.IamResourceScrutinies = [
|
|
22685
|
+
import_service_spec_types.ResourceScrutinyType.ResourcePolicyResource,
|
|
22686
|
+
import_service_spec_types.ResourceScrutinyType.IdentityPolicyResource,
|
|
22687
|
+
import_service_spec_types.ResourceScrutinyType.LambdaPermission,
|
|
22688
|
+
import_service_spec_types.ResourceScrutinyType.SsoAssignmentResource,
|
|
22689
|
+
import_service_spec_types.ResourceScrutinyType.SsoInstanceACAConfigResource,
|
|
22690
|
+
import_service_spec_types.ResourceScrutinyType.SsoPermissionSet
|
|
22691
|
+
];
|
|
22692
|
+
}
|
|
22620
22693
|
get hasChanges() {
|
|
22621
22694
|
return this.statements.hasChanges || this.managedPolicies.hasChanges || this.ssoPermissionSets.hasChanges || this.ssoAssignments.hasChanges || this.ssoInstanceACAConfigs.hasChanges;
|
|
22622
22695
|
}
|
|
@@ -22714,19 +22787,17 @@ var init_iam_changes = __esm({
|
|
|
22714
22787
|
return ret;
|
|
22715
22788
|
}
|
|
22716
22789
|
summarizeSsoInstanceACAConfigs() {
|
|
22717
|
-
var _a, _b;
|
|
22718
22790
|
const ret = [];
|
|
22719
22791
|
const header = ["", "Resource", "InstanceArn", "AccessControlAttributes"];
|
|
22720
22792
|
function formatAccessControlAttribute(aca) {
|
|
22721
|
-
|
|
22722
|
-
return `Key: ${aca == null ? void 0 : aca.Key}, Values: [${(_a2 = aca == null ? void 0 : aca.Value) == null ? void 0 : _a2.Source.join(", ")}]`;
|
|
22793
|
+
return `Key: ${aca?.Key}, Values: [${aca?.Value?.Source.join(", ")}]`;
|
|
22723
22794
|
}
|
|
22724
22795
|
for (const att of this.ssoInstanceACAConfigs.additions) {
|
|
22725
22796
|
ret.push([
|
|
22726
22797
|
"+",
|
|
22727
22798
|
att.cfnLogicalId || "",
|
|
22728
22799
|
att.ssoInstanceArn || "",
|
|
22729
|
-
|
|
22800
|
+
att.accessControlAttributes?.map(formatAccessControlAttribute).join("\n") || ""
|
|
22730
22801
|
].map((s) => chalk3.green(s)));
|
|
22731
22802
|
}
|
|
22732
22803
|
for (const att of this.ssoInstanceACAConfigs.removals) {
|
|
@@ -22734,7 +22805,7 @@ var init_iam_changes = __esm({
|
|
|
22734
22805
|
"-",
|
|
22735
22806
|
att.cfnLogicalId || "",
|
|
22736
22807
|
att.ssoInstanceArn || "",
|
|
22737
|
-
|
|
22808
|
+
att.accessControlAttributes?.map(formatAccessControlAttribute).join("\n") || ""
|
|
22738
22809
|
].map((s) => chalk3.red(s)));
|
|
22739
22810
|
}
|
|
22740
22811
|
ret.sort(makeComparator((row) => [row[1]]));
|
|
@@ -22742,18 +22813,17 @@ var init_iam_changes = __esm({
|
|
|
22742
22813
|
return ret;
|
|
22743
22814
|
}
|
|
22744
22815
|
summarizeSsoPermissionSets() {
|
|
22745
|
-
var _a, _b;
|
|
22746
22816
|
const ret = [];
|
|
22747
22817
|
const header = ["", "Resource", "InstanceArn", "PermissionSet name", "PermissionsBoundary", "CustomerManagedPolicyReferences"];
|
|
22748
22818
|
function formatManagedPolicyRef(s) {
|
|
22749
|
-
return `Name: ${
|
|
22819
|
+
return `Name: ${s?.Name || ""}, Path: ${s?.Path || ""}`;
|
|
22750
22820
|
}
|
|
22751
22821
|
function formatSsoPermissionsBoundary(ssoPb) {
|
|
22752
|
-
if (
|
|
22753
|
-
return `ManagedPolicyArn: ${
|
|
22754
|
-
} else if (
|
|
22822
|
+
if (ssoPb?.ManagedPolicyArn !== void 0) {
|
|
22823
|
+
return `ManagedPolicyArn: ${ssoPb?.ManagedPolicyArn || ""}`;
|
|
22824
|
+
} else if (ssoPb?.CustomerManagedPolicyReference !== void 0) {
|
|
22755
22825
|
return `CustomerManagedPolicyReference: {
|
|
22756
|
-
${formatManagedPolicyRef(ssoPb
|
|
22826
|
+
${formatManagedPolicyRef(ssoPb?.CustomerManagedPolicyReference)}
|
|
22757
22827
|
}`;
|
|
22758
22828
|
} else {
|
|
22759
22829
|
return "";
|
|
@@ -22766,7 +22836,7 @@ var init_iam_changes = __esm({
|
|
|
22766
22836
|
att.ssoInstanceArn || "",
|
|
22767
22837
|
att.name || "",
|
|
22768
22838
|
formatSsoPermissionsBoundary(att.ssoPermissionsBoundary),
|
|
22769
|
-
|
|
22839
|
+
att.ssoCustomerManagedPolicyReferences?.map(formatManagedPolicyRef).join("\n") || ""
|
|
22770
22840
|
].map((s) => chalk3.green(s)));
|
|
22771
22841
|
}
|
|
22772
22842
|
for (const att of this.ssoPermissionSets.removals) {
|
|
@@ -22776,7 +22846,7 @@ var init_iam_changes = __esm({
|
|
|
22776
22846
|
att.ssoInstanceArn || "",
|
|
22777
22847
|
att.name || "",
|
|
22778
22848
|
formatSsoPermissionsBoundary(att.ssoPermissionsBoundary),
|
|
22779
|
-
|
|
22849
|
+
att.ssoCustomerManagedPolicyReferences?.map(formatManagedPolicyRef).join("\n") || ""
|
|
22780
22850
|
].map((s) => chalk3.red(s)));
|
|
22781
22851
|
}
|
|
22782
22852
|
ret.sort(makeComparator((row) => [row[1]]));
|
|
@@ -22850,8 +22920,7 @@ var init_iam_changes = __esm({
|
|
|
22850
22920
|
}
|
|
22851
22921
|
const appliesToPrincipal = "AWS:${" + logicalId + "}";
|
|
22852
22922
|
return flatMap(policies, (policy) => {
|
|
22853
|
-
|
|
22854
|
-
const unparsedStatement = ((_a = policy.PolicyDocument) == null ? void 0 : _a.Statement) ? policy.PolicyDocument.Statement : policy;
|
|
22923
|
+
const unparsedStatement = policy.PolicyDocument?.Statement ? policy.PolicyDocument.Statement : policy;
|
|
22855
22924
|
return defaultPrincipal(appliesToPrincipal, parseStatements(renderIntrinsics(unparsedStatement)));
|
|
22856
22925
|
});
|
|
22857
22926
|
}
|
|
@@ -22947,19 +23016,6 @@ var init_iam_changes = __esm({
|
|
|
22947
23016
|
return [parseLambdaPermission(renderIntrinsics(properties))];
|
|
22948
23017
|
}
|
|
22949
23018
|
};
|
|
22950
|
-
IamChanges.IamPropertyScrutinies = [
|
|
22951
|
-
import_service_spec_types.PropertyScrutinyType.InlineIdentityPolicies,
|
|
22952
|
-
import_service_spec_types.PropertyScrutinyType.InlineResourcePolicy,
|
|
22953
|
-
import_service_spec_types.PropertyScrutinyType.ManagedPolicies
|
|
22954
|
-
];
|
|
22955
|
-
IamChanges.IamResourceScrutinies = [
|
|
22956
|
-
import_service_spec_types.ResourceScrutinyType.ResourcePolicyResource,
|
|
22957
|
-
import_service_spec_types.ResourceScrutinyType.IdentityPolicyResource,
|
|
22958
|
-
import_service_spec_types.ResourceScrutinyType.LambdaPermission,
|
|
22959
|
-
import_service_spec_types.ResourceScrutinyType.SsoAssignmentResource,
|
|
22960
|
-
import_service_spec_types.ResourceScrutinyType.SsoInstanceACAConfigResource,
|
|
22961
|
-
import_service_spec_types.ResourceScrutinyType.SsoPermissionSet
|
|
22962
|
-
];
|
|
22963
23019
|
}
|
|
22964
23020
|
});
|
|
22965
23021
|
|
|
@@ -23001,8 +23057,7 @@ var init_security_group_rule = __esm({
|
|
|
23001
23057
|
"use strict";
|
|
23002
23058
|
SecurityGroupRule = class {
|
|
23003
23059
|
constructor(ruleObject, groupRef) {
|
|
23004
|
-
|
|
23005
|
-
this.ipProtocol = ((_a = ruleObject.IpProtocol) == null ? void 0 : _a.toString()) || "*unknown*";
|
|
23060
|
+
this.ipProtocol = ruleObject.IpProtocol?.toString() || "*unknown*";
|
|
23006
23061
|
this.fromPort = ruleObject.FromPort;
|
|
23007
23062
|
this.toPort = ruleObject.ToPort;
|
|
23008
23063
|
this.groupId = ruleObject.GroupId || groupRef || "*unknown*";
|
|
@@ -23267,7 +23322,6 @@ var init_types = __esm({
|
|
|
23267
23322
|
* case there is no further detail on property values), and resource type changes.
|
|
23268
23323
|
*/
|
|
23269
23324
|
scrutinizablePropertyChanges(scrutinyTypes) {
|
|
23270
|
-
var _a, _b, _c;
|
|
23271
23325
|
const ret = new Array();
|
|
23272
23326
|
for (const [resourceLogicalId, resourceChange] of Object.entries(this.resources.changes)) {
|
|
23273
23327
|
if (resourceChange.resourceTypeChanged) {
|
|
@@ -23276,7 +23330,7 @@ var init_types = __esm({
|
|
|
23276
23330
|
if (!resourceChange.resourceType) {
|
|
23277
23331
|
continue;
|
|
23278
23332
|
}
|
|
23279
|
-
const newTypeProps =
|
|
23333
|
+
const newTypeProps = loadResourceModel(resourceChange.resourceType)?.properties || {};
|
|
23280
23334
|
for (const [propertyName, prop] of Object.entries(newTypeProps)) {
|
|
23281
23335
|
const propScrutinyType = prop.scrutinizable || import_service_spec_types2.PropertyScrutinyType.None;
|
|
23282
23336
|
if (scrutinyTypes.includes(propScrutinyType)) {
|
|
@@ -23285,8 +23339,8 @@ var init_types = __esm({
|
|
|
23285
23339
|
propertyName,
|
|
23286
23340
|
resourceType: resourceChange.resourceType,
|
|
23287
23341
|
scrutinyType: propScrutinyType,
|
|
23288
|
-
oldValue:
|
|
23289
|
-
newValue:
|
|
23342
|
+
oldValue: resourceChange.oldProperties?.[propertyName],
|
|
23343
|
+
newValue: resourceChange.newProperties?.[propertyName]
|
|
23290
23344
|
});
|
|
23291
23345
|
}
|
|
23292
23346
|
}
|
|
@@ -23649,9 +23703,8 @@ function diffResource(oldValue, newValue) {
|
|
|
23649
23703
|
otherDiffs
|
|
23650
23704
|
});
|
|
23651
23705
|
function _diffProperty(oldV, newV, key, resourceSpec) {
|
|
23652
|
-
var _a;
|
|
23653
23706
|
let changeImpact = "NO_CHANGE" /* NO_CHANGE */;
|
|
23654
|
-
const spec =
|
|
23707
|
+
const spec = resourceSpec?.properties?.[key];
|
|
23655
23708
|
if (spec && !deepEqual(oldV, newV)) {
|
|
23656
23709
|
switch (spec.causesReplacement) {
|
|
23657
23710
|
case "yes":
|
|
@@ -23691,15 +23744,14 @@ var init_diff = __esm({
|
|
|
23691
23744
|
});
|
|
23692
23745
|
|
|
23693
23746
|
// ../cloudformation-diff/lib/diff/template-and-changeset-diff-merger.ts
|
|
23694
|
-
var
|
|
23747
|
+
var TemplateAndChangeSetDiffMerger;
|
|
23695
23748
|
var init_template_and_changeset_diff_merger = __esm({
|
|
23696
23749
|
"../cloudformation-diff/lib/diff/template-and-changeset-diff-merger.ts"() {
|
|
23697
23750
|
"use strict";
|
|
23698
23751
|
init_types();
|
|
23699
|
-
|
|
23752
|
+
TemplateAndChangeSetDiffMerger = class _TemplateAndChangeSetDiffMerger {
|
|
23700
23753
|
static determineChangeSetReplacementMode(propertyChange) {
|
|
23701
|
-
|
|
23702
|
-
if (((_a = propertyChange.Target) == null ? void 0 : _a.RequiresRecreation) === void 0) {
|
|
23754
|
+
if (propertyChange.Target?.RequiresRecreation === void 0) {
|
|
23703
23755
|
return "Conditionally";
|
|
23704
23756
|
}
|
|
23705
23757
|
if (propertyChange.Target.RequiresRecreation === "Always") {
|
|
@@ -23712,6 +23764,10 @@ var init_template_and_changeset_diff_merger = __esm({
|
|
|
23712
23764
|
}
|
|
23713
23765
|
return propertyChange.Target.RequiresRecreation;
|
|
23714
23766
|
}
|
|
23767
|
+
static {
|
|
23768
|
+
// If we somehow cannot find the resourceType, then we'll mark it as UNKNOWN, so that can be seen in the diff.
|
|
23769
|
+
this.UNKNOWN_RESOURCE_TYPE = "UNKNOWN_RESOURCE_TYPE";
|
|
23770
|
+
}
|
|
23715
23771
|
constructor(props) {
|
|
23716
23772
|
this.changeSet = props.changeSet;
|
|
23717
23773
|
this.changeSetResources = props.changeSetResources ?? this.convertDescribeChangeSetOutputToChangeSetResources(this.changeSet);
|
|
@@ -23720,15 +23776,14 @@ var init_template_and_changeset_diff_merger = __esm({
|
|
|
23720
23776
|
* Read resources from the changeSet, extracting information into ChangeSetResources.
|
|
23721
23777
|
*/
|
|
23722
23778
|
convertDescribeChangeSetOutputToChangeSetResources(changeSet) {
|
|
23723
|
-
var _a, _b;
|
|
23724
23779
|
const changeSetResources = {};
|
|
23725
23780
|
for (const resourceChange of changeSet.Changes ?? []) {
|
|
23726
|
-
if (
|
|
23781
|
+
if (resourceChange.ResourceChange?.LogicalResourceId === void 0) {
|
|
23727
23782
|
continue;
|
|
23728
23783
|
}
|
|
23729
23784
|
const propertyReplacementModes = {};
|
|
23730
23785
|
for (const propertyChange of resourceChange.ResourceChange.Details ?? []) {
|
|
23731
|
-
if (
|
|
23786
|
+
if (propertyChange.Target?.Attribute === "Properties" && propertyChange.Target.Name) {
|
|
23732
23787
|
propertyReplacementModes[propertyChange.Target.Name] = {
|
|
23733
23788
|
replacementMode: _TemplateAndChangeSetDiffMerger.determineChangeSetReplacementMode(propertyChange)
|
|
23734
23789
|
};
|
|
@@ -23749,19 +23804,17 @@ var init_template_and_changeset_diff_merger = __esm({
|
|
|
23749
23804
|
* replacement (e.g., changing the name of an IAM role requires deleting and replacing the role), then ChangeImpact is "Always".
|
|
23750
23805
|
*/
|
|
23751
23806
|
overrideDiffResourceChangeImpactWithChangeSetChangeImpact(logicalId, change) {
|
|
23752
|
-
|
|
23753
|
-
if (change.resourceTypeChanged === true || ((_a = change.resourceType) == null ? void 0 : _a.includes("AWS::Serverless"))) {
|
|
23807
|
+
if (change.resourceTypeChanged === true || change.resourceType?.includes("AWS::Serverless")) {
|
|
23754
23808
|
return;
|
|
23755
23809
|
}
|
|
23756
23810
|
change.forEachDifference((type, name, value) => {
|
|
23757
|
-
var _a2;
|
|
23758
23811
|
if (type === "Property") {
|
|
23759
23812
|
if (!this.changeSetResources[logicalId]) {
|
|
23760
23813
|
value.changeImpact = "NO_CHANGE" /* NO_CHANGE */;
|
|
23761
23814
|
value.isDifferent = false;
|
|
23762
23815
|
return;
|
|
23763
23816
|
}
|
|
23764
|
-
const changingPropertyCausesResourceReplacement = (
|
|
23817
|
+
const changingPropertyCausesResourceReplacement = (this.changeSetResources[logicalId].propertyReplacementModes ?? {})[name]?.replacementMode;
|
|
23765
23818
|
switch (changingPropertyCausesResourceReplacement) {
|
|
23766
23819
|
case "Always":
|
|
23767
23820
|
value.changeImpact = "WILL_REPLACE" /* WILL_REPLACE */;
|
|
@@ -23795,19 +23848,15 @@ var init_template_and_changeset_diff_merger = __esm({
|
|
|
23795
23848
|
});
|
|
23796
23849
|
}
|
|
23797
23850
|
findResourceImports() {
|
|
23798
|
-
var _a, _b;
|
|
23799
23851
|
const importedResourceLogicalIds = [];
|
|
23800
|
-
for (const resourceChange of
|
|
23801
|
-
if (
|
|
23852
|
+
for (const resourceChange of this.changeSet?.Changes ?? []) {
|
|
23853
|
+
if (resourceChange.ResourceChange?.Action === "Import") {
|
|
23802
23854
|
importedResourceLogicalIds.push(resourceChange.ResourceChange.LogicalResourceId);
|
|
23803
23855
|
}
|
|
23804
23856
|
}
|
|
23805
23857
|
return importedResourceLogicalIds;
|
|
23806
23858
|
}
|
|
23807
23859
|
};
|
|
23808
|
-
// If we somehow cannot find the resourceType, then we'll mark it as UNKNOWN, so that can be seen in the diff.
|
|
23809
|
-
_TemplateAndChangeSetDiffMerger.UNKNOWN_RESOURCE_TYPE = "UNKNOWN_RESOURCE_TYPE";
|
|
23810
|
-
TemplateAndChangeSetDiffMerger = _TemplateAndChangeSetDiffMerger;
|
|
23811
23860
|
}
|
|
23812
23861
|
});
|
|
23813
23862
|
|
|
@@ -31657,16 +31706,15 @@ var init_format = __esm({
|
|
|
31657
31706
|
* and resource metadata, and we combine all sources into a single map.
|
|
31658
31707
|
*/
|
|
31659
31708
|
readConstructPathsFrom(templateDiff) {
|
|
31660
|
-
var _a, _b, _c, _d;
|
|
31661
31709
|
for (const [logicalId, resourceDiff] of Object.entries(templateDiff.resources)) {
|
|
31662
31710
|
if (!resourceDiff) {
|
|
31663
31711
|
continue;
|
|
31664
31712
|
}
|
|
31665
|
-
const oldPathMetadata =
|
|
31713
|
+
const oldPathMetadata = resourceDiff.oldValue?.Metadata?.[PATH_METADATA_KEY];
|
|
31666
31714
|
if (oldPathMetadata && !(logicalId in this.logicalToPathMap)) {
|
|
31667
31715
|
this.logicalToPathMap[logicalId] = oldPathMetadata;
|
|
31668
31716
|
}
|
|
31669
|
-
const newPathMetadata =
|
|
31717
|
+
const newPathMetadata = resourceDiff.newValue?.Metadata?.[PATH_METADATA_KEY];
|
|
31670
31718
|
if (newPathMetadata && !(logicalId in this.logicalToPathMap)) {
|
|
31671
31719
|
this.logicalToPathMap[logicalId] = newPathMetadata;
|
|
31672
31720
|
}
|
|
@@ -31851,7 +31899,7 @@ var init_snapshot_test_runner = __esm({
|
|
|
31851
31899
|
import_cloudformation_diff = __toESM(require_lib9());
|
|
31852
31900
|
init_cloud_assembly2();
|
|
31853
31901
|
init_runner_base();
|
|
31854
|
-
|
|
31902
|
+
init_common2();
|
|
31855
31903
|
IntegSnapshotRunner = class extends IntegRunner {
|
|
31856
31904
|
constructor(options) {
|
|
31857
31905
|
super(options);
|
|
@@ -31862,24 +31910,25 @@ var init_snapshot_test_runner = __esm({
|
|
|
31862
31910
|
*
|
|
31863
31911
|
* @returns any diagnostics and any destructive changes
|
|
31864
31912
|
*/
|
|
31865
|
-
testSnapshot(options = {}) {
|
|
31866
|
-
|
|
31913
|
+
async testSnapshot(options = {}) {
|
|
31914
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
31915
|
+
const expectedTestSuite = await this.expectedTestSuite();
|
|
31867
31916
|
let doClean = true;
|
|
31868
31917
|
try {
|
|
31869
|
-
const expectedSnapshotAssembly = this.getSnapshotAssembly(this.snapshotDir,
|
|
31918
|
+
const expectedSnapshotAssembly = this.getSnapshotAssembly(this.snapshotDir, expectedTestSuite?.stacks);
|
|
31870
31919
|
const env = {
|
|
31871
31920
|
...DEFAULT_SYNTH_OPTIONS.env,
|
|
31872
31921
|
CDK_CONTEXT_JSON: JSON.stringify(this.getContext({
|
|
31873
|
-
...
|
|
31922
|
+
...actualTestSuite.enableLookups ? DEFAULT_SYNTH_OPTIONS.context : {}
|
|
31874
31923
|
}))
|
|
31875
31924
|
};
|
|
31876
|
-
this.cdk.synthFast({
|
|
31925
|
+
await this.cdk.synthFast({
|
|
31877
31926
|
execCmd: this.cdkApp.split(" "),
|
|
31878
31927
|
env,
|
|
31879
31928
|
output: path5.relative(this.directory, this.cdkOutDir)
|
|
31880
31929
|
});
|
|
31881
|
-
const actualSnapshotAssembly = this.getSnapshotAssembly(this.cdkOutDir,
|
|
31882
|
-
const diagnostics = this.diffAssembly(expectedSnapshotAssembly, actualSnapshotAssembly);
|
|
31930
|
+
const actualSnapshotAssembly = this.getSnapshotAssembly(this.cdkOutDir, actualTestSuite.stacks);
|
|
31931
|
+
const diagnostics = await this.diffAssembly(expectedSnapshotAssembly, actualSnapshotAssembly);
|
|
31883
31932
|
if (diagnostics.diagnostics.length) {
|
|
31884
31933
|
const additionalMessages = [];
|
|
31885
31934
|
if (options.retain) {
|
|
@@ -31944,8 +31993,8 @@ var init_snapshot_test_runner = __esm({
|
|
|
31944
31993
|
* @param stackId - the stack id
|
|
31945
31994
|
* @returns a list of resource types or undefined if none are found
|
|
31946
31995
|
*/
|
|
31947
|
-
getAllowedDestroyTypesForStack(stackId) {
|
|
31948
|
-
for (const testCase of Object.values(this.actualTests() ?? {})) {
|
|
31996
|
+
async getAllowedDestroyTypesForStack(stackId) {
|
|
31997
|
+
for (const testCase of Object.values(await this.actualTests() ?? {})) {
|
|
31949
31998
|
if (testCase.stacks.includes(stackId)) {
|
|
31950
31999
|
return testCase.allowDestroy;
|
|
31951
32000
|
}
|
|
@@ -31959,13 +32008,12 @@ var init_snapshot_test_runner = __esm({
|
|
|
31959
32008
|
* @param actual - the new (actual) snapshot
|
|
31960
32009
|
* @returns any diagnostics and any destructive changes
|
|
31961
32010
|
*/
|
|
31962
|
-
diffAssembly(expected, actual) {
|
|
31963
|
-
var _a, _b, _c;
|
|
32011
|
+
async diffAssembly(expected, actual) {
|
|
31964
32012
|
const failures = [];
|
|
31965
32013
|
const destructiveChanges = [];
|
|
31966
32014
|
for (const [stackId, stack] of Object.entries(expected)) {
|
|
31967
32015
|
for (const templateId of Object.keys(stack.templates)) {
|
|
31968
|
-
if (!
|
|
32016
|
+
if (!actual[stackId]?.templates[templateId]) {
|
|
31969
32017
|
failures.push({
|
|
31970
32018
|
testName: this.testName,
|
|
31971
32019
|
stackName: templateId,
|
|
@@ -31977,7 +32025,7 @@ var init_snapshot_test_runner = __esm({
|
|
|
31977
32025
|
}
|
|
31978
32026
|
for (const [stackId, stack] of Object.entries(actual)) {
|
|
31979
32027
|
for (const templateId of Object.keys(stack.templates)) {
|
|
31980
|
-
if (!
|
|
32028
|
+
if (!expected[stackId]?.templates[templateId]) {
|
|
31981
32029
|
failures.push({
|
|
31982
32030
|
testName: this.testName,
|
|
31983
32031
|
stackName: templateId,
|
|
@@ -31987,7 +32035,7 @@ var init_snapshot_test_runner = __esm({
|
|
|
31987
32035
|
continue;
|
|
31988
32036
|
} else {
|
|
31989
32037
|
const config = {
|
|
31990
|
-
diffAssets: (
|
|
32038
|
+
diffAssets: (await this.actualTestSuite()).getOptionsForStack(stackId)?.diffAssets
|
|
31991
32039
|
};
|
|
31992
32040
|
let actualTemplate = actual[stackId].templates[templateId];
|
|
31993
32041
|
let expectedTemplate = expected[stackId].templates[templateId];
|
|
@@ -31997,10 +32045,9 @@ var init_snapshot_test_runner = __esm({
|
|
|
31997
32045
|
}
|
|
31998
32046
|
const templateDiff = (0, import_cloudformation_diff.fullDiff)(expectedTemplate, actualTemplate);
|
|
31999
32047
|
if (!templateDiff.isEmpty) {
|
|
32000
|
-
const allowedDestroyTypes = this.getAllowedDestroyTypesForStack(stackId) ?? [];
|
|
32048
|
+
const allowedDestroyTypes = await this.getAllowedDestroyTypesForStack(stackId) ?? [];
|
|
32001
32049
|
templateDiff.resources.forEachDifference((logicalId, change) => {
|
|
32002
|
-
|
|
32003
|
-
const resourceType = ((_a2 = change.oldValue) == null ? void 0 : _a2.Type) ?? ((_b2 = change.newValue) == null ? void 0 : _b2.Type);
|
|
32050
|
+
const resourceType = change.oldValue?.Type ?? change.newValue?.Type;
|
|
32004
32051
|
if (resourceType && allowedDestroyTypes.includes(resourceType)) {
|
|
32005
32052
|
return;
|
|
32006
32053
|
}
|
|
@@ -32056,7 +32103,7 @@ var init_snapshot_test_runner = __esm({
|
|
|
32056
32103
|
const assetsSeen = /* @__PURE__ */ new Set();
|
|
32057
32104
|
const stringSubstitutions = new Array();
|
|
32058
32105
|
const paramRe = /^AssetParameters([a-zA-Z0-9]{64})(S3Bucket|S3VersionKey|ArtifactHash)([a-zA-Z0-9]{8})$/;
|
|
32059
|
-
for (const paramName of Object.keys(
|
|
32106
|
+
for (const paramName of Object.keys(template?.Parameters || {})) {
|
|
32060
32107
|
const m = paramRe.exec(paramName);
|
|
32061
32108
|
if (!m) {
|
|
32062
32109
|
continue;
|
|
@@ -32198,7 +32245,7 @@ __export(extract_worker_exports, {
|
|
|
32198
32245
|
snapshotTestWorker: () => snapshotTestWorker,
|
|
32199
32246
|
watchTestWorker: () => watchTestWorker
|
|
32200
32247
|
});
|
|
32201
|
-
function integTestWorker(request) {
|
|
32248
|
+
async function integTestWorker(request) {
|
|
32202
32249
|
const failures = [];
|
|
32203
32250
|
const verbosity = request.verbosity ?? 0;
|
|
32204
32251
|
for (const testInfo of request.tests) {
|
|
@@ -32217,13 +32264,13 @@ function integTestWorker(request) {
|
|
|
32217
32264
|
},
|
|
32218
32265
|
showOutput: verbosity >= 2
|
|
32219
32266
|
}, testInfo.destructiveChanges);
|
|
32220
|
-
const tests = runner.actualTests();
|
|
32267
|
+
const tests = await runner.actualTests();
|
|
32221
32268
|
if (!tests || Object.keys(tests).length === 0) {
|
|
32222
32269
|
throw new Error(`No tests defined for ${runner.testName}`);
|
|
32223
32270
|
}
|
|
32224
32271
|
for (const testCaseName of Object.keys(tests)) {
|
|
32225
32272
|
try {
|
|
32226
|
-
const results = runner.runIntegTestCase({
|
|
32273
|
+
const results = await runner.runIntegTestCase({
|
|
32227
32274
|
testCaseName,
|
|
32228
32275
|
clean: request.clean,
|
|
32229
32276
|
dryRun: request.dryRun,
|
|
@@ -32281,7 +32328,7 @@ async function watchTestWorker(options) {
|
|
|
32281
32328
|
showOutput: verbosity >= 2
|
|
32282
32329
|
});
|
|
32283
32330
|
runner.createCdkContextJson();
|
|
32284
|
-
const tests = runner.actualTests();
|
|
32331
|
+
const tests = await runner.actualTests();
|
|
32285
32332
|
if (!tests || Object.keys(tests).length === 0) {
|
|
32286
32333
|
throw new Error(`No tests defined for ${runner.testName}`);
|
|
32287
32334
|
}
|
|
@@ -32292,7 +32339,7 @@ async function watchTestWorker(options) {
|
|
|
32292
32339
|
});
|
|
32293
32340
|
}
|
|
32294
32341
|
}
|
|
32295
|
-
function snapshotTestWorker(testInfo, options = {}) {
|
|
32342
|
+
async function snapshotTestWorker(testInfo, options = {}) {
|
|
32296
32343
|
const failedTests = new Array();
|
|
32297
32344
|
const start = Date.now();
|
|
32298
32345
|
const test = new IntegTest(testInfo);
|
|
@@ -32315,7 +32362,7 @@ function snapshotTestWorker(testInfo, options = {}) {
|
|
|
32315
32362
|
});
|
|
32316
32363
|
failedTests.push(test.info);
|
|
32317
32364
|
} else {
|
|
32318
|
-
const { diagnostics, destructiveChanges } = runner.testSnapshot(options);
|
|
32365
|
+
const { diagnostics, destructiveChanges } = await runner.testSnapshot(options);
|
|
32319
32366
|
if (diagnostics.length > 0) {
|
|
32320
32367
|
diagnostics.forEach((diagnostic) => workerpool2.workerEmit({
|
|
32321
32368
|
...diagnostic,
|
|
@@ -32354,7 +32401,7 @@ var init_extract_worker = __esm({
|
|
|
32354
32401
|
workerpool2 = __toESM(require_src());
|
|
32355
32402
|
init_runner();
|
|
32356
32403
|
init_integration_tests();
|
|
32357
|
-
|
|
32404
|
+
init_common2();
|
|
32358
32405
|
workerpool2.worker({
|
|
32359
32406
|
snapshotTestWorker,
|
|
32360
32407
|
integTestWorker,
|