@go-to-k/cdkd 0.97.0 → 0.98.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/dist/cli.js +414 -8
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-Cl7v7Ml5.js → deploy-engine-D44ADMVs.js} +164 -41
- package/dist/deploy-engine-D44ADMVs.js.map +1 -0
- package/dist/go-to-k-cdkd-0.98.1.tgz +0 -0
- package/dist/index.d.ts +54 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-Cl7v7Ml5.js.map +0 -1
- package/dist/go-to-k-cdkd-0.97.0.tgz +0 -0
|
@@ -1074,6 +1074,44 @@ var StackTerminationProtectionError = class StackTerminationProtectionError exte
|
|
|
1074
1074
|
}
|
|
1075
1075
|
};
|
|
1076
1076
|
/**
|
|
1077
|
+
* `cdkd destroy <producer>` refused because at least one consumer stack
|
|
1078
|
+
* still records an `Fn::ImportValue` reference to one of the producer's
|
|
1079
|
+
* outputs. This matches CloudFormation's strong-reference semantics —
|
|
1080
|
+
* CFn rejects `DeleteStack` for an exporter while an importer exists.
|
|
1081
|
+
*
|
|
1082
|
+
* cdkd has no `--force` escape hatch for this (intentionally, mirroring
|
|
1083
|
+
* CFn). The error message lists every offending consumer and points the
|
|
1084
|
+
* user at the two valid resolution paths:
|
|
1085
|
+
*
|
|
1086
|
+
* 1. Destroy the consumer first: `cdkd destroy <consumer>`
|
|
1087
|
+
* 2. Remove the `Fn::ImportValue` from the consumer's template and
|
|
1088
|
+
* redeploy, then retry the producer destroy.
|
|
1089
|
+
*
|
|
1090
|
+
* Weak-reference consumers (`Fn::GetStackOutput`, cdkd-specific) never
|
|
1091
|
+
* trigger this error by design — the producer stays deletable
|
|
1092
|
+
* independently of consumers when the user intentionally chose a weak
|
|
1093
|
+
* reference at template-authoring time.
|
|
1094
|
+
*
|
|
1095
|
+
* Exit code 2 (same as `PartialFailureError`) so multi-stack `cdkd
|
|
1096
|
+
* destroy --all` runs that partially succeed still surface as
|
|
1097
|
+
* non-zero without being indistinguishable from a fatal cdkd error.
|
|
1098
|
+
*/
|
|
1099
|
+
var StackHasActiveImportsError = class StackHasActiveImportsError extends CdkdError {
|
|
1100
|
+
exitCode = 2;
|
|
1101
|
+
producerStack;
|
|
1102
|
+
producerRegion;
|
|
1103
|
+
consumers;
|
|
1104
|
+
constructor(producerStack, producerRegion, consumers, cause) {
|
|
1105
|
+
const lines = consumers.map((c) => ` - ${c.consumerStack} (${c.consumerRegion}): imports export '${c.exportName}'`);
|
|
1106
|
+
super(`Cannot destroy stack '${producerStack}' (${producerRegion}): the following stacks still import its outputs via Fn::ImportValue:\n${lines.join("\n")}\n\nThis matches CloudFormation's strong-reference semantics — exports are\nprotected as long as a consumer references them.\n\nTo proceed:\n 1. Destroy the consumer first: cdkd destroy <consumer-stack>\n 2. Or remove the Fn::ImportValue from the consumer's template\n (e.g. inline the value, or refactor) and re-deploy the consumer,\n then retry this destroy.\n\nNote: cdkd's Fn::GetStackOutput intrinsic is a weak alternative that\ndoes NOT protect the producer — use it when you intentionally want\nthe producer to be deletable independently of consumers.`, "STACK_HAS_ACTIVE_IMPORTS", cause);
|
|
1107
|
+
this.producerStack = producerStack;
|
|
1108
|
+
this.producerRegion = producerRegion;
|
|
1109
|
+
this.consumers = consumers;
|
|
1110
|
+
this.name = "StackHasActiveImportsError";
|
|
1111
|
+
Object.setPrototypeOf(this, StackHasActiveImportsError.prototype);
|
|
1112
|
+
}
|
|
1113
|
+
};
|
|
1114
|
+
/**
|
|
1077
1115
|
* Signals that `cdkd local start-api`'s route discovery hit an unsupported
|
|
1078
1116
|
* shape — non-AWS_PROXY integration, ApiGwV2 service integration
|
|
1079
1117
|
* (`IntegrationSubtype` set), WebSocket protocol, Lambda::Url with
|
|
@@ -3272,7 +3310,8 @@ var AssetPublisher = class {
|
|
|
3272
3310
|
const STATE_SCHEMA_VERSIONS_READABLE = [
|
|
3273
3311
|
1,
|
|
3274
3312
|
2,
|
|
3275
|
-
3
|
|
3313
|
+
3,
|
|
3314
|
+
4
|
|
3276
3315
|
];
|
|
3277
3316
|
|
|
3278
3317
|
//#endregion
|
|
@@ -3489,7 +3528,7 @@ var S3StateBackend = class {
|
|
|
3489
3528
|
const { expectedEtag, migrateLegacy } = options;
|
|
3490
3529
|
const body = {
|
|
3491
3530
|
...state,
|
|
3492
|
-
version:
|
|
3531
|
+
version: 4,
|
|
3493
3532
|
stackName,
|
|
3494
3533
|
region
|
|
3495
3534
|
};
|
|
@@ -5607,6 +5646,16 @@ var IntrinsicFunctionResolver = class {
|
|
|
5607
5646
|
if (typeof exportName !== "string") throw new Error(`Fn::ImportValue: export name must resolve to a string, got ${typeof exportName}`);
|
|
5608
5647
|
if (!context.stateBackend) throw new Error("Fn::ImportValue: state backend is required for cross-stack references");
|
|
5609
5648
|
this.logger.debug(`Resolving Fn::ImportValue: ${exportName}`);
|
|
5649
|
+
if (context.exportIndex) try {
|
|
5650
|
+
const entry = await context.exportIndex.lookup(exportName);
|
|
5651
|
+
if (entry && (!context.stackName || entry.producerStack !== context.stackName)) {
|
|
5652
|
+
this.recordImport(context, exportName, entry.producerStack, entry.producerRegion);
|
|
5653
|
+
this.logger.info(`Resolved Fn::ImportValue: ${exportName} = ${JSON.stringify(entry.value)} (from index: ${entry.producerStack} / ${entry.producerRegion})`);
|
|
5654
|
+
return entry.value;
|
|
5655
|
+
}
|
|
5656
|
+
} catch (err) {
|
|
5657
|
+
this.logger.warn(`Exports index lookup failed for '${exportName}': ${err instanceof Error ? err.message : String(err)}; falling back to state.json scan`);
|
|
5658
|
+
}
|
|
5610
5659
|
const allStacks = await context.stateBackend.listStacks();
|
|
5611
5660
|
this.logger.debug(`Found ${allStacks.length} state record(s) to search for export: ${exportName}`);
|
|
5612
5661
|
for (const ref of allStacks) {
|
|
@@ -5630,6 +5679,14 @@ var IntrinsicFunctionResolver = class {
|
|
|
5630
5679
|
if (state.outputs && exportName in state.outputs) {
|
|
5631
5680
|
const value = state.outputs[exportName];
|
|
5632
5681
|
this.logger.info(`Resolved Fn::ImportValue: ${exportName} = ${JSON.stringify(value)} (from stack: ${refStack} / ${lookupRegion})`);
|
|
5682
|
+
if (context.exportIndex) context.exportIndex.patchEntry(exportName, {
|
|
5683
|
+
value,
|
|
5684
|
+
producerStack: refStack,
|
|
5685
|
+
producerRegion: lookupRegion
|
|
5686
|
+
}).catch((err) => {
|
|
5687
|
+
this.logger.debug(`Failed to patch exports index for '${exportName}': ${err instanceof Error ? err.message : String(err)}`);
|
|
5688
|
+
});
|
|
5689
|
+
this.recordImport(context, exportName, refStack, lookupRegion);
|
|
5633
5690
|
return value;
|
|
5634
5691
|
}
|
|
5635
5692
|
} catch (error) {
|
|
@@ -5640,6 +5697,39 @@ var IntrinsicFunctionResolver = class {
|
|
|
5640
5697
|
throw new Error(`Fn::ImportValue: export '${exportName}' not found in any stack. Searched ${allStacks.length} state record(s). Make sure the exporting stack has been deployed and the Output has an Export.Name property.`);
|
|
5641
5698
|
}
|
|
5642
5699
|
/**
|
|
5700
|
+
* Push a resolved `Fn::ImportValue` into the consumer's recorded-imports
|
|
5701
|
+
* bag (when supplied by the caller). Skips duplicates within the
|
|
5702
|
+
* SAME bag — multiple references to the same `(exportName,
|
|
5703
|
+
* sourceStack, sourceRegion)` triple emit one entry.
|
|
5704
|
+
*
|
|
5705
|
+
* Concurrency: the check + push pair is purely synchronous (no
|
|
5706
|
+
* `await` between `some()` and `push()`), so the JS event loop
|
|
5707
|
+
* cannot interleave a competing `recordImport` call between the
|
|
5708
|
+
* dedup check and the append. The bag's lifetime is per-deploy
|
|
5709
|
+
* (DeployEngine resets `this.recordedImports = []` at the top of
|
|
5710
|
+
* each `deploy()` call), so the bag identity already serves as
|
|
5711
|
+
* the dedup scope.
|
|
5712
|
+
*
|
|
5713
|
+
* Cross-context dedup: when callers share the same bag instance
|
|
5714
|
+
* across multiple ResolverContext objects (the typical pattern —
|
|
5715
|
+
* DeployEngine passes `this.recordedImports` into every resolver
|
|
5716
|
+
* context it constructs), the dedup naturally extends across
|
|
5717
|
+
* contexts because the `some()` reads the shared bag. Stashing
|
|
5718
|
+
* the dedup Set on `context.recordedImports` directly via a
|
|
5719
|
+
* property would break under `verbatimModuleSyntax`-style strict
|
|
5720
|
+
* typing; the array scan stays O(N) where N is the per-deploy
|
|
5721
|
+
* import count (typically < 20), which is fine.
|
|
5722
|
+
*/
|
|
5723
|
+
recordImport(context, exportName, producerStack, producerRegion) {
|
|
5724
|
+
if (!context.recordedImports) return;
|
|
5725
|
+
if (context.recordedImports.some((e) => e.exportName === exportName && e.sourceStack === producerStack && e.sourceRegion === producerRegion)) return;
|
|
5726
|
+
context.recordedImports.push({
|
|
5727
|
+
exportName,
|
|
5728
|
+
sourceStack: producerStack,
|
|
5729
|
+
sourceRegion: producerRegion
|
|
5730
|
+
});
|
|
5731
|
+
}
|
|
5732
|
+
/**
|
|
5643
5733
|
* Resolve Fn::GetStackOutput (cross-stack / cross-region output reference)
|
|
5644
5734
|
*
|
|
5645
5735
|
* Shape: { "Fn::GetStackOutput": { "StackName": "...", "OutputName": "...",
|
|
@@ -8276,12 +8366,28 @@ var DeployEngine = class {
|
|
|
8276
8366
|
providerRegistry;
|
|
8277
8367
|
options;
|
|
8278
8368
|
/**
|
|
8369
|
+
* Optional persistent exports index store. When supplied, all
|
|
8370
|
+
* `Fn::ImportValue` resolutions in this deploy session prefer the
|
|
8371
|
+
* O(1) index lookup over the per-stack state.json scan, and the
|
|
8372
|
+
* consumer's `state.imports` field is populated for destroy-time
|
|
8373
|
+
* strong-reference checks. Shared across DeployEngine instances in
|
|
8374
|
+
* a single `cdkd deploy --all` invocation so the in-memory cache
|
|
8375
|
+
* survives across stacks.
|
|
8376
|
+
*/
|
|
8377
|
+
exportIndexStore;
|
|
8378
|
+
/**
|
|
8379
|
+
* Per-deploy-session bag the resolver pushes resolved
|
|
8380
|
+
* `Fn::ImportValue` entries into. Reset at the start of each
|
|
8381
|
+
* `deploy()` call and persisted to `newState.imports` at the end.
|
|
8382
|
+
*/
|
|
8383
|
+
recordedImports = [];
|
|
8384
|
+
/**
|
|
8279
8385
|
* Target region for this stack. Required — load-bearing for the
|
|
8280
8386
|
* region-prefixed S3 state key and recorded in state.json for
|
|
8281
8387
|
* cross-region destroy.
|
|
8282
8388
|
*/
|
|
8283
8389
|
stackRegion;
|
|
8284
|
-
constructor(stateBackend, lockManager, dagBuilder, diffCalculator, providerRegistry, options = {}, stackRegion) {
|
|
8390
|
+
constructor(stateBackend, lockManager, dagBuilder, diffCalculator, providerRegistry, options = {}, stackRegion, exportIndexStore) {
|
|
8285
8391
|
this.stateBackend = stateBackend;
|
|
8286
8392
|
this.lockManager = lockManager;
|
|
8287
8393
|
this.dagBuilder = dagBuilder;
|
|
@@ -8289,6 +8395,7 @@ var DeployEngine = class {
|
|
|
8289
8395
|
this.providerRegistry = providerRegistry;
|
|
8290
8396
|
this.options = options;
|
|
8291
8397
|
this.stackRegion = stackRegion;
|
|
8398
|
+
this.exportIndexStore = exportIndexStore;
|
|
8292
8399
|
this.resolver = new IntrinsicFunctionResolver(stackRegion);
|
|
8293
8400
|
this.options.concurrency = options.concurrency ?? 10;
|
|
8294
8401
|
this.options.dryRun = options.dryRun ?? false;
|
|
@@ -8302,9 +8409,28 @@ var DeployEngine = class {
|
|
|
8302
8409
|
* Deploy a CloudFormation template
|
|
8303
8410
|
*/
|
|
8304
8411
|
async deploy(stackName, template) {
|
|
8412
|
+
this.recordedImports = [];
|
|
8305
8413
|
return withStackName(stackName, () => this.doDeploy(stackName, template));
|
|
8306
8414
|
}
|
|
8307
8415
|
/**
|
|
8416
|
+
* Resolver context with the imports-recording and exports-index
|
|
8417
|
+
* fields wired in. Keeps the four+ inline context construction
|
|
8418
|
+
* sites consistent — pass through callable as
|
|
8419
|
+
* `this.buildResolverContext({...}, stackName)`.
|
|
8420
|
+
*/
|
|
8421
|
+
buildResolverContext(base, stackName) {
|
|
8422
|
+
return {
|
|
8423
|
+
template: base.template,
|
|
8424
|
+
resources: base.resources,
|
|
8425
|
+
...base.parameters && Object.keys(base.parameters).length > 0 && { parameters: base.parameters },
|
|
8426
|
+
...base.conditions && Object.keys(base.conditions).length > 0 && { conditions: base.conditions },
|
|
8427
|
+
stateBackend: this.stateBackend,
|
|
8428
|
+
stackName,
|
|
8429
|
+
...this.exportIndexStore && { exportIndex: this.exportIndexStore },
|
|
8430
|
+
recordedImports: this.recordedImports
|
|
8431
|
+
};
|
|
8432
|
+
}
|
|
8433
|
+
/**
|
|
8308
8434
|
* Kick off `provider.readCurrentState` for a freshly-created/updated
|
|
8309
8435
|
* resource without blocking the deploy critical path. The promise
|
|
8310
8436
|
* lands in `observedCaptureTasks` keyed by `logicalId`; the deploy's
|
|
@@ -8422,7 +8548,7 @@ var DeployEngine = class {
|
|
|
8422
8548
|
try {
|
|
8423
8549
|
const currentStateData = await this.stateBackend.getState(stackName, this.stackRegion);
|
|
8424
8550
|
const currentState = currentStateData?.state ?? {
|
|
8425
|
-
version:
|
|
8551
|
+
version: 4,
|
|
8426
8552
|
region: this.stackRegion,
|
|
8427
8553
|
stackName,
|
|
8428
8554
|
resources: {},
|
|
@@ -8436,13 +8562,11 @@ var DeployEngine = class {
|
|
|
8436
8562
|
this.logger.debug(`Template has ${Object.keys(template.Resources || {}).length} resources`);
|
|
8437
8563
|
const parameterValues = await this.resolver.resolveParameters(template, this.options.parameters);
|
|
8438
8564
|
this.logger.debug(`Resolved ${Object.keys(parameterValues).length} parameters: ${Object.keys(parameterValues).join(", ")}`);
|
|
8439
|
-
const context = {
|
|
8565
|
+
const context = this.buildResolverContext({
|
|
8440
8566
|
template,
|
|
8441
8567
|
resources: currentState.resources,
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
stackName
|
|
8445
|
-
};
|
|
8568
|
+
parameters: parameterValues
|
|
8569
|
+
}, stackName);
|
|
8446
8570
|
const conditions = await this.resolver.evaluateConditions(context);
|
|
8447
8571
|
this.logger.debug(`Evaluated ${Object.keys(conditions).length} conditions: ${Object.keys(conditions).join(", ")}`);
|
|
8448
8572
|
const resourceTypes = new Set(Object.values(template.Resources || {}).map((r) => r.Type).filter((type) => type !== "AWS::CDK::Metadata"));
|
|
@@ -8451,14 +8575,12 @@ var DeployEngine = class {
|
|
|
8451
8575
|
const dag = this.dagBuilder.buildGraph(template);
|
|
8452
8576
|
const executionLevels = this.dagBuilder.getExecutionLevels(dag);
|
|
8453
8577
|
this.logger.debug(`Dependency graph: ${executionLevels.length} execution levels`);
|
|
8454
|
-
const diffResolverContext = {
|
|
8578
|
+
const diffResolverContext = this.buildResolverContext({
|
|
8455
8579
|
template,
|
|
8456
8580
|
resources: currentState.resources,
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
stackName
|
|
8461
|
-
};
|
|
8581
|
+
parameters: parameterValues,
|
|
8582
|
+
conditions
|
|
8583
|
+
}, stackName);
|
|
8462
8584
|
const diffResolveFn = (value) => this.resolver.resolve(value, diffResolverContext);
|
|
8463
8585
|
const changes = await this.diffCalculator.calculateDiff(currentState, template, diffResolveFn);
|
|
8464
8586
|
if (!this.diffCalculator.hasChanges(changes)) {
|
|
@@ -8467,11 +8589,12 @@ var DeployEngine = class {
|
|
|
8467
8589
|
await this.drainObservedCaptures(currentState.resources);
|
|
8468
8590
|
try {
|
|
8469
8591
|
const refreshedState = {
|
|
8470
|
-
version:
|
|
8592
|
+
version: 4,
|
|
8471
8593
|
region: this.stackRegion,
|
|
8472
8594
|
stackName: currentState.stackName,
|
|
8473
8595
|
resources: currentState.resources,
|
|
8474
8596
|
outputs: currentState.outputs,
|
|
8597
|
+
...currentState.imports && currentState.imports.length > 0 && { imports: currentState.imports },
|
|
8475
8598
|
lastModified: Date.now()
|
|
8476
8599
|
};
|
|
8477
8600
|
const saveOptions = {};
|
|
@@ -8515,6 +8638,7 @@ var DeployEngine = class {
|
|
|
8515
8638
|
await this.drainObservedCaptures(newState.resources);
|
|
8516
8639
|
const newEtag = await this.stateBackend.saveState(stackName, this.stackRegion, newState);
|
|
8517
8640
|
this.logger.debug(`State saved (ETag: ${newEtag})`);
|
|
8641
|
+
if (this.exportIndexStore) await this.exportIndexStore.updateForStack(stackName, this.stackRegion, newState.outputs ?? {});
|
|
8518
8642
|
const durationMs = Date.now() - startTime;
|
|
8519
8643
|
const unchangedCount = this.diffCalculator.filterByType(changes, "NO_CHANGE").length + actualCounts.skipped;
|
|
8520
8644
|
return {
|
|
@@ -8563,11 +8687,12 @@ var DeployEngine = class {
|
|
|
8563
8687
|
saveChain = saveChain.then(async () => {
|
|
8564
8688
|
try {
|
|
8565
8689
|
const partialState = {
|
|
8566
|
-
version:
|
|
8690
|
+
version: 4,
|
|
8567
8691
|
region: this.stackRegion,
|
|
8568
8692
|
stackName: currentState.stackName,
|
|
8569
8693
|
resources: newResources,
|
|
8570
8694
|
outputs: currentState.outputs,
|
|
8695
|
+
...currentState.imports && currentState.imports.length > 0 && { imports: currentState.imports },
|
|
8571
8696
|
lastModified: Date.now()
|
|
8572
8697
|
};
|
|
8573
8698
|
const migrate = pendingMigration;
|
|
@@ -8668,11 +8793,12 @@ var DeployEngine = class {
|
|
|
8668
8793
|
} catch (error) {
|
|
8669
8794
|
try {
|
|
8670
8795
|
const preRollbackState = {
|
|
8671
|
-
version:
|
|
8796
|
+
version: 4,
|
|
8672
8797
|
region: this.stackRegion,
|
|
8673
8798
|
stackName: currentState.stackName,
|
|
8674
8799
|
resources: newResources,
|
|
8675
8800
|
outputs: currentState.outputs,
|
|
8801
|
+
...currentState.imports && currentState.imports.length > 0 && { imports: currentState.imports },
|
|
8676
8802
|
lastModified: Date.now()
|
|
8677
8803
|
};
|
|
8678
8804
|
const migrate = pendingMigration;
|
|
@@ -8696,11 +8822,12 @@ var DeployEngine = class {
|
|
|
8696
8822
|
} else await this.performRollback(completedOperations, newResources, stackName);
|
|
8697
8823
|
try {
|
|
8698
8824
|
const postRollbackState = {
|
|
8699
|
-
version:
|
|
8825
|
+
version: 4,
|
|
8700
8826
|
region: this.stackRegion,
|
|
8701
8827
|
stackName: currentState.stackName,
|
|
8702
8828
|
resources: newResources,
|
|
8703
8829
|
outputs: currentState.outputs,
|
|
8830
|
+
...currentState.imports && currentState.imports.length > 0 && { imports: currentState.imports },
|
|
8704
8831
|
lastModified: Date.now()
|
|
8705
8832
|
};
|
|
8706
8833
|
await this.stateBackend.saveState(stackName, this.stackRegion, postRollbackState, { ...currentEtag !== void 0 && { expectedEtag: currentEtag } });
|
|
@@ -8710,11 +8837,12 @@ var DeployEngine = class {
|
|
|
8710
8837
|
try {
|
|
8711
8838
|
const freshEtag = (await this.stateBackend.getState(stackName, this.stackRegion))?.etag;
|
|
8712
8839
|
const postRollbackState = {
|
|
8713
|
-
version:
|
|
8840
|
+
version: 4,
|
|
8714
8841
|
region: this.stackRegion,
|
|
8715
8842
|
stackName: currentState.stackName,
|
|
8716
8843
|
resources: newResources,
|
|
8717
8844
|
outputs: currentState.outputs,
|
|
8845
|
+
...currentState.imports && currentState.imports.length > 0 && { imports: currentState.imports },
|
|
8718
8846
|
lastModified: Date.now()
|
|
8719
8847
|
};
|
|
8720
8848
|
await this.stateBackend.saveState(stackName, this.stackRegion, postRollbackState, { ...freshEtag !== void 0 && { expectedEtag: freshEtag } });
|
|
@@ -8728,11 +8856,12 @@ var DeployEngine = class {
|
|
|
8728
8856
|
const outputs = await this.resolveOutputs(template, newResources, stackName, parameterValues, conditions);
|
|
8729
8857
|
return {
|
|
8730
8858
|
state: {
|
|
8731
|
-
version:
|
|
8859
|
+
version: 4,
|
|
8732
8860
|
region: this.stackRegion,
|
|
8733
8861
|
stackName: currentState.stackName,
|
|
8734
8862
|
resources: newResources,
|
|
8735
8863
|
outputs,
|
|
8864
|
+
...this.recordedImports.length > 0 && { imports: [...this.recordedImports] },
|
|
8736
8865
|
lastModified: Date.now()
|
|
8737
8866
|
},
|
|
8738
8867
|
actualCounts
|
|
@@ -8915,14 +9044,12 @@ var DeployEngine = class {
|
|
|
8915
9044
|
switch (change.changeType) {
|
|
8916
9045
|
case "CREATE": {
|
|
8917
9046
|
const desiredProps = change.desiredProperties || {};
|
|
8918
|
-
const context = {
|
|
9047
|
+
const context = this.buildResolverContext({
|
|
8919
9048
|
template,
|
|
8920
9049
|
resources: stateResources,
|
|
8921
|
-
...parameterValues &&
|
|
8922
|
-
...conditions &&
|
|
8923
|
-
|
|
8924
|
-
stackName
|
|
8925
|
-
};
|
|
9050
|
+
...parameterValues && { parameters: parameterValues },
|
|
9051
|
+
...conditions && { conditions }
|
|
9052
|
+
}, stackName);
|
|
8926
9053
|
const resolvedProps = await this.resolver.resolve(desiredProps, context);
|
|
8927
9054
|
const { provider: createProvider, properties: createProps } = this.selectProviderWithSafetyNet(provider, resourceType, resolvedProps, logicalId);
|
|
8928
9055
|
const result = await this.withRetry(() => createProvider.create(logicalId, resourceType, createProps), logicalId, void 0, void 0, provider);
|
|
@@ -8947,14 +9074,12 @@ var DeployEngine = class {
|
|
|
8947
9074
|
if (!currentResource) throw new Error(`Cannot update ${logicalId}: resource not found in state`);
|
|
8948
9075
|
const desiredProps = change.desiredProperties || {};
|
|
8949
9076
|
const currentProps = change.currentProperties || {};
|
|
8950
|
-
const context = {
|
|
9077
|
+
const context = this.buildResolverContext({
|
|
8951
9078
|
template,
|
|
8952
9079
|
resources: stateResources,
|
|
8953
|
-
...parameterValues &&
|
|
8954
|
-
...conditions &&
|
|
8955
|
-
|
|
8956
|
-
stackName
|
|
8957
|
-
};
|
|
9080
|
+
...parameterValues && { parameters: parameterValues },
|
|
9081
|
+
...conditions && { conditions }
|
|
9082
|
+
}, stackName);
|
|
8958
9083
|
const resolvedProps = await this.resolver.resolve(desiredProps, context);
|
|
8959
9084
|
if (JSON.stringify(resolvedProps) === JSON.stringify(currentProps)) {
|
|
8960
9085
|
this.logger.debug(`Skipping ${logicalId}: no actual changes after intrinsic function resolution`);
|
|
@@ -9215,14 +9340,12 @@ var DeployEngine = class {
|
|
|
9215
9340
|
async resolveOutputs(template, resources, stackName, parameterValues, conditions) {
|
|
9216
9341
|
if (!template.Outputs) return {};
|
|
9217
9342
|
const outputs = {};
|
|
9218
|
-
const context = {
|
|
9343
|
+
const context = this.buildResolverContext({
|
|
9219
9344
|
template,
|
|
9220
9345
|
resources,
|
|
9221
|
-
...parameterValues &&
|
|
9222
|
-
...conditions &&
|
|
9223
|
-
|
|
9224
|
-
stackName
|
|
9225
|
-
};
|
|
9346
|
+
...parameterValues && { parameters: parameterValues },
|
|
9347
|
+
...conditions && { conditions }
|
|
9348
|
+
}, stackName);
|
|
9226
9349
|
for (const [outputKey, output] of Object.entries(template.Outputs)) try {
|
|
9227
9350
|
const value = await this.resolver.resolve(output.Value, context);
|
|
9228
9351
|
outputs[outputKey] = value;
|
|
@@ -9239,5 +9362,5 @@ var DeployEngine = class {
|
|
|
9239
9362
|
};
|
|
9240
9363
|
|
|
9241
9364
|
//#endregion
|
|
9242
|
-
export {
|
|
9243
|
-
//# sourceMappingURL=deploy-engine-
|
|
9365
|
+
export { formatError as $, resolveCaptureObservedState as A, ConfigError as B, stringifyValue as C, getDefaultStateBucketName as D, Synthesizer as E, AssemblyReader as F, ProvisioningError as G, LocalInvokeBuildError as H, clearBucketRegionCache as I, RouteDiscoveryError as J, ResourceTimeoutError as K, resolveBucketRegion as L, resolveStateBucketWithDefault as M, resolveStateBucketWithDefaultAndSource as N, getLegacyStateBucketName as O, warnDeprecatedNoPrefixCliFlag as P, SynthesisError as Q, AssetError as R, AssetPublisher as S, buildDockerImage as T, LockError as U, DependencyError as V, PartialFailureError as W, StackTerminationProtectionError as X, StackHasActiveImportsError as Y, StateError as Z, DiffCalculator as _, withRetry as a, setLogger as at, LockManager as b, collectInlinePolicyNamesManagedBySiblings as c, PATTERN_B_NAME_PROPERTIES as ct, normalizeAwsTagsToCfn as d, generateResourceNameWithFallback as dt, isCdkdError as et, resolveExplicitPhysicalId as f, withSkipPrefix as ft, IntrinsicFunctionResolver as g, assertRegionMatch as h, withResourceDeadline as i, getLogger as it, resolveSkipPrefix as j, resolveApp as k, CDK_PATH_TAG as l, PATTERN_B_RESOURCE_TYPES as lt, CloudControlProvider as m, DEFAULT_RESOURCE_WARN_AFTER_MS as n, withErrorHandling as nt, IMPLICIT_DELETE_DEPENDENCIES as o, runStackBuffered as ot, ProviderRegistry as p, withStackName as pt, ResourceUpdateNotSupportedError as q, DeployEngine as r, ConsoleLogger as rt, IAMRoleProvider as s, getLiveRenderer as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, normalizeAwsError as tt, matchesCdkPath as u, generateResourceName as ut, DagBuilder as v, WorkGraph as w, S3StateBackend as x, TemplateParser as y, CdkdError as z };
|
|
9366
|
+
//# sourceMappingURL=deploy-engine-D44ADMVs.js.map
|