@go-to-k/cdkd 0.296.0 → 0.296.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.
Files changed (24) hide show
  1. package/dist/{asg-provider-AVCcoXnQ.js → asg-provider-DedWRf1j.js} +3 -3
  2. package/dist/{asg-provider-AVCcoXnQ.js.map → asg-provider-DedWRf1j.js.map} +1 -1
  3. package/dist/cli.js +2 -2
  4. package/dist/{deploy-engine-D7204v7Z.js → deploy-engine-C_Eg-RHm.js} +390 -117
  5. package/dist/deploy-engine-C_Eg-RHm.js.map +1 -0
  6. package/dist/{iam-role-provider-CCPaZ3U4.js → iam-role-provider-COoTgydF.js} +2 -2
  7. package/dist/{iam-role-provider-CCPaZ3U4.js.map → iam-role-provider-COoTgydF.js.map} +1 -1
  8. package/dist/index.d.ts +5 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +2 -2
  11. package/dist/{neptune-provider-D1t9NgT-.js → neptune-provider-D2SmeISr.js} +2 -2
  12. package/dist/{neptune-provider-D1t9NgT-.js.map → neptune-provider-D2SmeISr.js.map} +1 -1
  13. package/dist/{program-B0sp_SHG.js → program-CiMVZi4n.js} +63 -13
  14. package/dist/program-CiMVZi4n.js.map +1 -0
  15. package/dist/{provider-classes-DMOnX5s-.js → provider-classes-CtsCylnp.js} +143 -39
  16. package/dist/provider-classes-CtsCylnp.js.map +1 -0
  17. package/dist/{rds-provider-DltlcDiQ.js → rds-provider-DQwvPJXB.js} +3 -3
  18. package/dist/{rds-provider-DltlcDiQ.js.map → rds-provider-DQwvPJXB.js.map} +1 -1
  19. package/dist/{version-DUHDmEhz.js → version-WJhcQQ3m.js} +2 -2
  20. package/dist/{version-DUHDmEhz.js.map → version-WJhcQQ3m.js.map} +1 -1
  21. package/package.json +1 -1
  22. package/dist/deploy-engine-D7204v7Z.js.map +0 -1
  23. package/dist/program-B0sp_SHG.js.map +0 -1
  24. package/dist/provider-classes-DMOnX5s-.js.map +0 -1
@@ -2,7 +2,7 @@ import { r as getAwsClients, s as __exportAll } from "./aws-clients-CnmtbrxD.js"
2
2
  import { A as displaySafe, E as UNRENDERABLE, F as safeMsg, L as truncateCodePoints, M as isPasteableIdent, O as displayAwsMessage, P as plainIdentOr, S as withoutGeneratedFallbackName, T as STACK_REF_MAX_CODE_POINTS, _ as getCurrentSkipPrefix, b as withSkipPrefix, c as getLiveRenderer, f as applyDefaultNameForFallback, g as generateResourceNameWithFallback, h as generateResourceName, j as displayStackName, k as displayIdent, m as explicitNamePropertyFor, n as getLogger, r as isStdoutReservedForPayload, s as installLogLineMaskerSource, v as getCurrentStackName, w as SECRET_REF_MAX_CODE_POINTS, x as withStackName, y as looksLikeCdkdGeneratedName } from "./logger-Dvc7ddKe.js";
3
3
  import { $n as markRedactedCause, $t as LockError, A as isTerminalDeleteFailure, At as CUSTOM_RESOURCE_RESPONSE_PREFIX, Bn as isAmbiguousCcHandlerErrorCode, Bt as clientDefaultsFor, C as refusalTypeShown, Cn as physicalIdShownBesideCommand, Ct as buildForceUnlockCommand, D as ProtectionFlipRegistry, Dn as shellQuote, Dt as formatLockOperation, En as shellBoundedDisplay, Et as formatLockExpiry, Fn as isRecreateRetryableError, Ft as producerRecordKey, Gn as retryClassificationText, H as pasteableAwsCommand, Hn as isIamPropagationError, Ht as AccountIdUnavailableError, In as isReplayedNameCollisionFrom, J as isInterruptedWaitError, Jn as safeStringify$1, Kn as describeAwsFailure, Kt as CrossAccountSecretRefusalError, Lt as withPasteableAwsProfile, M as observeThenDisableProtection, Mn as hasReplayMayCollide, Mt as injectiveKey, N as protectionFlipKey, Nn as isNameCollisionErrorFrom, O as compensateProtectionFlip, On as withheldTargetClause, Ot as formatLockOwner, Pn as isNameCooldownError, Q as canonicalizeRoute53QueryName, Qn as markNonRetryable, R as DELETION_PROTECTION_DOC_POINTER, Rn as markReplayMayCollide, Rt as ambientClientDefaults, S as quotedRemedyLogicalId, Sn as pasteableCommand, St as UNREPRODUCIBLE_LOCK_CLAUSE, T as resolveExplicitPhysicalId, Tn as quotedOrDescribed, U as protectedReplacementAdvice, Un as isRetryableTransientError, Ut as AssetError, Vn as isAmbiguousOutcomeError, Vt as credentialFingerprint, Wn as isTransientServerError, Wt as CdkdError, X as ElapsedBudgetRegistry, Xn as isMarkedNonRetryable, Xt as IntrinsicResolutionRefusalError, Y as startInterruptWatch, Yt as DynamicReferenceRegionAmbiguousError, Z as monotonicNowMs, Zn as isThrottlingError, _n as SHELL_ACTIVE_WHY, _t as hasCreatedBeforeFailure, an as ResourceTimeoutError, at as segmentAfterAnchor, b as isQuotableImportValue, bt as markAuxiliaryFailure, ct as createMaskedRetryLogger, d as prepareRemovalForUpdate, dt as maskerOrIdentity, en as MacroExpansionError, er as wrapMaskedAwsError, et as compositeIdSeparatorRefusal, f as removalWarning, ft as withDerivedNameMasks, g as assertRegionMatch, gn as SHELL_ACTIVE, gt as createdBeforeFailure, h as RESOURCE_NOT_FOUND, i as holdsSecretDerivedEntry, in as ProvisioningError, it as resourceTypeShown, jn as isUpdateUnsupportedError, jt as DEFAULT_STATE_PREFIX, k as deleteWithProtectionCompensation, kt as sanitizeRecoveryValue, l as withUnchangedSecretPrincipalLists, ln as StateError, lt as isSecretDerivedValue, m as withoutInjectedRemovals, mt as carryCreatedBeforeFailure, nt as logicalIdShown, on as ResourceUpdateNotSupportedError, ot as stateOrphanRecordRemedy, pn as normalizeAwsError, pt as RETRY_AUXILIARY_OWNER, qt as DependencyError, st as createMaskedLogSinks, tn as MalformedProducerRecordRefusalError, un as SynthesisError, ut as maskDeep, vn as UNSHOWABLE_VALUE, vt as isAuxiliaryFailure, wn as plainOrDescribed, x as normalizeAwsTagsToCfn, xn as isInertUnquoted, xt as markCreatedBeforeFailure, yn as commandHole, yt as isAuxiliaryMarkOf, zn as formatRetryClassificationSignals, zt as ambientCredentialConfig } from "./iam-policy-targets-DSDSdxXz.js";
4
4
  import { a as setAssumedRoleCredentials, i as getPreAssumeEnvCredentials, n as awsClientDefaults, o as setPreAssumeEnvCredentials, r as getAssumedRoleCredentials, s as ambientRegion, t as SECOND_ROLE_PUBLISH_REFUSAL } from "./aws-client-defaults-D0q0z4dG.js";
5
- import { t as getCdkdVersion } from "./version-DUHDmEhz.js";
5
+ import { t as getCdkdVersion } from "./version-WJhcQQ3m.js";
6
6
  import { createHash, randomUUID } from "node:crypto";
7
7
  import { AsyncLocalStorage } from "node:async_hooks";
8
8
  import { CreateBucketCommand, DeleteObjectCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetBucketReplicationCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchKey, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutObjectCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
@@ -4803,6 +4803,11 @@ function refuseMalformedOperation(shownStack, where, op) {
4803
4803
  const attempted = o["attemptedProperties"];
4804
4804
  if (attempted !== void 0 && (typeof attempted !== "object" || attempted === null || Array.isArray(attempted))) fail("attemptedProperties", attempted, "an object when present");
4805
4805
  if (o["oldResourceRetained"] !== void 0 && typeof o["oldResourceRetained"] !== "boolean") fail("oldResourceRetained", o["oldResourceRetained"], "a boolean when present");
4806
+ if (o["replacementOrphaned"] !== void 0) {
4807
+ if (!["create-first", "delete-first"].includes(o["replacementOrphaned"])) fail("replacementOrphaned", o["replacementOrphaned"], "create-first or delete-first when present");
4808
+ if (o["changeType"] !== "UPDATE") refuseMalformed(shownStack, `${where}.replacementOrphaned is only valid on an UPDATE.`);
4809
+ }
4810
+ if (o["wasReplaced"] !== void 0 && typeof o["wasReplaced"] !== "boolean") fail("wasReplaced", o["wasReplaced"], "a boolean when present");
4806
4811
  if (o["physicalIdRecoveredFromError"] !== void 0 && typeof o["physicalIdRecoveredFromError"] !== "boolean") fail("physicalIdRecoveredFromError", o["physicalIdRecoveredFromError"], "a boolean when present");
4807
4812
  if (o["physicalIdRecoveredFromError"] !== void 0 && o["changeType"] !== "CREATE") refuseMalformed(shownStack, `${where}.physicalIdRecoveredFromError is only valid on a CREATE (got changeType ${kind(o["changeType"])}).`);
4808
4813
  if (o["deletionPolicy"] !== void 0 && ![
@@ -4811,6 +4816,16 @@ function refuseMalformedOperation(shownStack, where, op) {
4811
4816
  "Snapshot",
4812
4817
  "RetainExceptOnCreate"
4813
4818
  ].includes(o["deletionPolicy"])) fail("deletionPolicy", o["deletionPolicy"], "one of Delete, Retain, Snapshot, RetainExceptOnCreate when present");
4819
+ const replacedId = o["replacedPhysicalId"];
4820
+ const replacedType = o["replacedResourceType"];
4821
+ if (o["replacedResourceDeleted"] !== void 0 && replacedId === void 0) refuseMalformed(shownStack, `${where}.replacedResourceDeleted is only valid beside replacedPhysicalId.`);
4822
+ if (replacedId !== void 0 || replacedType !== void 0) {
4823
+ if (typeof replacedId !== "string" || replacedId === "") fail("replacedPhysicalId", replacedId, "a non-empty string beside replacedResourceType");
4824
+ if (typeof replacedType !== "string" || replacedType === "") fail("replacedResourceType", replacedType, "a non-empty string beside replacedPhysicalId");
4825
+ if (typeof o["physicalIdRecoveredFromError"] !== "boolean") refuseMalformed(shownStack, `${where}.replacedPhysicalId is only valid on a CREATE carrying physicalIdRecoveredFromError.`);
4826
+ if (o["replacedResourceDeleted"] !== void 0 && o["replacedResourceDeleted"] !== true) fail("replacedResourceDeleted", o["replacedResourceDeleted"], "true when present");
4827
+ if (replacedId === o["physicalId"]) refuseMalformed(shownStack, `${where}.replacedPhysicalId must differ from the op's own physicalId.`);
4828
+ }
4814
4829
  if (o["previousResourceType"] !== void 0 && typeof o["previousResourceType"] !== "string") fail("previousResourceType", o["previousResourceType"], "a string when present");
4815
4830
  }
4816
4831
  function kind(v) {
@@ -7674,6 +7689,10 @@ const CLASSIFIER_IDENTIFIER_FIELDS = /* @__PURE__ */ new Set([
7674
7689
  function isAuxiliaryAnchor(key, descriptor) {
7675
7690
  return key === "logicalId" && descriptor.enumerable === false && descriptor.writable === false && typeof descriptor.value === "string" && descriptor.value.endsWith("/auxiliary");
7676
7691
  }
7692
+ const CREATED_BEFORE_FAILURE_MARK = Symbol.for("cdkd.createdBeforeFailure");
7693
+ function isCreatedBeforeFailureMark(key, descriptor) {
7694
+ return key === CREATED_BEFORE_FAILURE_MARK && descriptor.enumerable === false && descriptor.writable === false && typeof descriptor.value === "object" && descriptor.value !== null && Object.isFrozen(descriptor.value);
7695
+ }
7677
7696
  function isPlainContainer(value) {
7678
7697
  const proto = Object.getPrototypeOf(value);
7679
7698
  return Array.isArray(value) ? proto === Array.prototype : proto === Object.prototype || proto === null;
@@ -7761,7 +7780,7 @@ function maskSecretsInError(error, secrets, extraMask) {
7761
7780
  if (key === "message" || key === "cause" || key === "stack") continue;
7762
7781
  const descriptor = Object.getOwnPropertyDescriptor(link, key);
7763
7782
  if (!descriptor) continue;
7764
- descriptors[key] = typeof key === "string" && CLASSIFIER_IDENTIFIER_FIELDS.has(key) && typeof descriptor.value === "string" || isAuxiliaryAnchor(key, descriptor) ? descriptor : maskDescriptorValue(descriptor, maskText);
7783
+ descriptors[key] = typeof key === "string" && CLASSIFIER_IDENTIFIER_FIELDS.has(key) && typeof descriptor.value === "string" || isAuxiliaryAnchor(key, descriptor) || isCreatedBeforeFailureMark(key, descriptor) ? descriptor : maskDescriptorValue(descriptor, maskText);
7765
7784
  if (descriptors[key] !== descriptor) changed = true;
7766
7785
  }
7767
7786
  let cause = Object.getOwnPropertyDescriptor(link, "cause");
@@ -17975,6 +17994,7 @@ async function resolveGetAtt(getAtt, context) {
17975
17994
  }
17976
17995
  const resource = this.lookupResourceRecord(logicalId, "Fn::GetAtt", context);
17977
17996
  if (!resource) throw markNonRetryable(/* @__PURE__ */ new Error(`Resource ${this.displayMasked(logicalId, context)} not found for Fn::GetAtt`));
17997
+ recordSecretNamedRead(logicalId, void 0, context);
17978
17998
  if (!(resource.resourceType === "AWS::EC2::VPC" && attributeName === "Ipv6CidrBlocks") && resource.attributes !== void 0) {
17979
17999
  const storedValue = Object.hasOwn(resource.attributes, attributeName) ? resource.attributes[attributeName] : void 0;
17980
18000
  const flatValue = isImpossibleEmptyStoredAttribute(resource.resourceType, attributeName, storedValue) ? void 0 : storedValue;
@@ -18028,6 +18048,7 @@ async function resolveGetAtt(getAtt, context) {
18028
18048
  throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${loggedLogicalId}, ${this.displayMasked(attributeName, context)}]: the nested stack ${quotedRender(loggedLogicalId, "'")} declares no output named ${quotedRender(this.displayMasked(this.outputNameLogText(attributeName, context), context), "'")}. Its outputs are ${this.displayMasked(declaredText, context)}. Check the output name in the nested stack's template, and deploy the child stack again if you have just added it.`));
18029
18049
  }
18030
18050
  const value = await this.constructWithStaleRecordHeal(resource, attributeName, context, logicalId);
18051
+ recordSecretNamedRead(logicalId, value, context);
18031
18052
  this.logger.debug(`Resolved Fn::GetAtt: ${this.logRender(logicalId, context)}.${this.logRender(attributeName, context)} resolved to ${this.logRender(stringifyAttributeForLog(attributeName, this.maskValueLeaves(value, context)), context, {
18032
18053
  structured: isStructured(value),
18033
18054
  redacted: isSensitiveAttributeName(attributeName)
@@ -18057,6 +18078,7 @@ function publicNoEchoTokens(context, producer) {
18057
18078
  return tokens;
18058
18079
  }
18059
18080
  function noteAttributeSecrecy(logicalId, attributeName, value, context) {
18081
+ recordSecretNamedRead(logicalId, value, context);
18060
18082
  const declared = context.noEchoAttributeResources?.get(logicalId);
18061
18083
  if ((declared === true || declared !== void 0 && declared.has(attributeName)) && context.recordedSecretValues) recordFreshNoEchoValuesIn(value, context.recordedSecretValues, void 0, this.publicNoEchoTokens(context, logicalId));
18062
18084
  if (context.redactedAttributeReads !== void 0 && carriesSecretMask(value)) {
@@ -18070,6 +18092,17 @@ function noteAttributeSecrecy(logicalId, attributeName, value, context) {
18070
18092
  }
18071
18093
  return value;
18072
18094
  }
18095
+ function recordSecretNamedRead(logicalId, value, context) {
18096
+ const bag = context.printingSecrets ?? context.recordedSecretValues;
18097
+ if (bag === void 0 || context.secretNameNeedles === void 0) return;
18098
+ const needles = context.secretNameNeedles(logicalId);
18099
+ if (needles === void 0) return;
18100
+ for (const needle of needles) recordLogOnlyValue(bag, needle);
18101
+ for (const leaf of wholeStringLeavesOf(value)) for (const needle of needles) if (needle.length >= 4 && leaf.includes(needle)) {
18102
+ recordLogOnlyValue(bag, leaf);
18103
+ break;
18104
+ }
18105
+ }
18073
18106
  function rejectPlaceholderArnAttribute(resource, attributeName, value, logicalId, context, healOutcome) {
18074
18107
  if (!isStalePlaceholderArnAttribute(resource.resourceType, attributeName, value)) return;
18075
18108
  throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${this.displayMasked(logicalId, context)}, ${this.displayMasked(attributeName, context)}] for ${resource.resourceType}: the recorded value ${quotedRender(stringifyValue(this.maskValueLeaves(value, context)), "\"")} is a placeholder written by a cdkd version older than issue #1681 — its region and account fields are literal wildcards, so it is not a usable ARN. ` + this.staleRecordRemedy(healOutcome, context)));
@@ -20197,6 +20230,7 @@ async function resolveRef(logicalId, context, onParameter) {
20197
20230
  const resource = this.lookupResourceRecord(logicalId, "Ref", context);
20198
20231
  if (resource) {
20199
20232
  const refValue = this.resolveRefValue(logicalId, resource, context);
20233
+ recordSecretNamedRead(logicalId, refValue, context);
20200
20234
  this.logger.debug(`Resolved Ref to resource: ${this.logRender(logicalId, context)} resolved to ${this.logRender(String(refValue), context)}`);
20201
20235
  return refValue;
20202
20236
  }
@@ -21997,7 +22031,7 @@ var CloudControlProvider = class {
21997
22031
  const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
21998
22032
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
21999
22033
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
22000
- const { ASGProvider } = await import("./asg-provider-AVCcoXnQ.js");
22034
+ const { ASGProvider } = await import("./asg-provider-DedWRf1j.js");
22001
22035
  const delegateRegion = ambientRegion();
22002
22036
  let asgProvider = this.asgDeleteDelegates.get(delegateRegion);
22003
22037
  if (asgProvider === void 0) {
@@ -22103,7 +22137,7 @@ var CloudControlProvider = class {
22103
22137
  const family = SDK_DELETE_FAMILIES.get(resourceType);
22104
22138
  const cached = this.sdkDeleteDelegates.get(family);
22105
22139
  if (cached !== void 0 && cached.region === ccRegion) return cached.provider;
22106
- const provider = family === "rds" ? new (await (import("./rds-provider-DltlcDiQ.js"))).RDSProvider({ region: ccRegion }) : new (await (import("./neptune-provider-D1t9NgT-.js"))).NeptuneProvider({ region: ccRegion });
22140
+ const provider = family === "rds" ? new (await (import("./rds-provider-DQwvPJXB.js"))).RDSProvider({ region: ccRegion }) : new (await (import("./neptune-provider-D2SmeISr.js"))).NeptuneProvider({ region: ccRegion });
22107
22141
  this.sdkDeleteDelegates.set(family, {
22108
22142
  region: ccRegion,
22109
22143
  provider
@@ -22926,6 +22960,10 @@ function withCurrentResourceSecrets(secrets, fn) {
22926
22960
  const outer = boundSecretBagsStore.getStore() ?? [];
22927
22961
  return boundSecretBagsStore.run([...outer, secrets], () => currentResourceSecretsStore.run(secrets, fn));
22928
22962
  }
22963
+ function withPrintingSecrets(secrets, fn) {
22964
+ const outer = boundSecretBagsStore.getStore() ?? [];
22965
+ return boundSecretBagsStore.run([...outer, secrets], fn);
22966
+ }
22929
22967
  function getCurrentResourceSecrets() {
22930
22968
  return currentResourceSecretsStore.getStore();
22931
22969
  }
@@ -26931,6 +26969,7 @@ async function resolveOutputs(template, resources, stackName, digestSource, para
26931
26969
  ...parameterValues && { parameters: parameterValues },
26932
26970
  ...conditions && { conditions }
26933
26971
  }, stackName);
26972
+ context.printingSecrets = /* @__PURE__ */ new Map();
26934
26973
  const refuseMaskedOutputReads = (outputKey, ownReads) => {
26935
26974
  const added = ownReads.filter((read) => read.kind === "ref-state-key");
26936
26975
  if (added.length === 0) return;
@@ -28324,7 +28363,7 @@ function isTypeChangeOp(op) {
28324
28363
  return stamped !== void 0 && stamped !== op.resourceType || recorded !== void 0 && recorded !== op.resourceType;
28325
28364
  }
28326
28365
  function isReplacementOp(op) {
28327
- return op.changeType === "UPDATE" && op.previousState?.physicalId !== void 0 && (op.previousState.physicalId !== op.physicalId || isTypeChangeOp(op) || equalIdNamesDifferentResources({
28366
+ return op.changeType === "UPDATE" && op.previousState?.physicalId !== void 0 && (op.previousState.physicalId !== op.physicalId && op.wasReplaced !== false || isTypeChangeOp(op) || equalIdNamesDifferentResources({
28328
28367
  resourceType: op.resourceType,
28329
28368
  physicalId: op.physicalId,
28330
28369
  oldProperties: op.previousState.properties,
@@ -28385,14 +28424,17 @@ function classifyRollbackOp(op, stateResources, orphanLogicalIds) {
28385
28424
  if (op.previousState && deepEqual$1(current.properties, op.previousState.properties)) return "skip-already-done";
28386
28425
  return "revert";
28387
28426
  }
28388
- function classifyFailedOp(op, stateResources) {
28427
+ function classifyFailedOp(op, stateResources, siblings = []) {
28389
28428
  if (op.changeType === "DELETE") return "skip-failed-noop";
28390
28429
  const current = stateResources[op.logicalId];
28391
28430
  if (op.changeType === "CREATE") {
28392
28431
  if (!op.physicalId) return "skip-failed-unknown";
28393
28432
  if (op.physicalIdRecoveredFromError === false) return "skip-failed-superseded";
28394
28433
  if (op.physicalIdRecoveredFromError === true) {
28395
- if (current) return current.physicalId === op.physicalId ? "skip-failed-noop" : "skip-failed-mismatch";
28434
+ if (current) {
28435
+ if (current.physicalId === op.physicalId) return "skip-failed-noop";
28436
+ if (!isReplacedRecord(op, current)) return "skip-failed-mismatch";
28437
+ }
28396
28438
  if (stateHoldsPhysicalId(stateResources, op.resourceType, op.physicalId)) return "skip-failed-noop";
28397
28439
  const orphanPolicy = effectiveDeletionPolicy(op.resourceType, op.deletionPolicy, op.attemptedProperties);
28398
28440
  if (orphanPolicy === "Retain") return "orphan-failed-create-retain";
@@ -28407,9 +28449,25 @@ function classifyFailedOp(op, stateResources) {
28407
28449
  return "delete-failed-create";
28408
28450
  }
28409
28451
  if (!current || !op.previousState) return "skip-failed-absent";
28452
+ if (op.replacementOrphaned !== void 0 || replacementNeverSwapped(op, siblings)) return current.physicalId === op.physicalId && (op.replacementOrphaned === "delete-first" || replacedResourceDeleted(op, siblings)) ? "skip-failed-replaced-deleted" : "skip-failed-noop";
28410
28453
  if (isTypeChangeOp(op)) return "skip-failed-type-change";
28411
28454
  return "revert-failed-update";
28412
28455
  }
28456
+ function isReplacementOrphan(op) {
28457
+ return op.changeType === "CREATE" && op.replacedPhysicalId !== void 0;
28458
+ }
28459
+ function isReplacedRecord(op, record) {
28460
+ return isReplacementOrphan(op) && record !== void 0 && record.physicalId === op.replacedPhysicalId && record.resourceType === op.replacedResourceType;
28461
+ }
28462
+ function failedOpOwnRecord(op, stateResources) {
28463
+ return isReplacementOrphan(op) ? void 0 : stateResources[op.logicalId];
28464
+ }
28465
+ function replacementNeverSwapped(op, siblings) {
28466
+ return siblings.some((s) => s !== op && isReplacementOrphan(s) && s.logicalId === op.logicalId && s.replacedPhysicalId === op.physicalId);
28467
+ }
28468
+ function replacedResourceDeleted(op, siblings) {
28469
+ return siblings.some((s) => s !== op && isReplacementOrphan(s) && s.logicalId === op.logicalId && s.replacedPhysicalId === op.physicalId && s.replacedResourceDeleted === true);
28470
+ }
28413
28471
  function stateHoldsPhysicalId(stateResources, resourceType, physicalId) {
28414
28472
  return Object.values(stateResources).some((r) => r?.resourceType === resourceType && r.physicalId === physicalId);
28415
28473
  }
@@ -28438,8 +28496,8 @@ function isJournaledOrphan(op) {
28438
28496
  function planFailedOps(failedOps, stateResources) {
28439
28497
  return failedOps.map((op) => ({
28440
28498
  op,
28441
- action: classifyFailedOp(op, stateResources),
28442
- effectiveProvisionedBy: effectiveProvisionedBy(stateResources[op.logicalId], op.provisionedBy)
28499
+ action: classifyFailedOp(op, stateResources, failedOps),
28500
+ effectiveProvisionedBy: effectiveProvisionedBy(failedOpOwnRecord(op, stateResources), op.provisionedBy)
28443
28501
  }));
28444
28502
  }
28445
28503
  function planRollback(operations, stateResources, orphanLogicalIds = /* @__PURE__ */ new Set()) {
@@ -28913,6 +28971,17 @@ async function replayReverseReplacement(s) {
28913
28971
  });
28914
28972
  const newCopyClaimed = inlinePolicyWriters.claimedFor(op.resourceType, op.logicalId, stateResources);
28915
28973
  let deletedNewFirst = false;
28974
+ const recreateCleanup = {
28975
+ op,
28976
+ oldType,
28977
+ provider: createProvider,
28978
+ properties: prev.properties,
28979
+ deletionPolicy: effectiveDeletionPolicy(oldType, prev.deletionPolicy, prev.properties),
28980
+ stateResources,
28981
+ region: ctx.region,
28982
+ logger,
28983
+ mask
28984
+ };
28916
28985
  let createResult;
28917
28986
  try {
28918
28987
  createResult = await createWithRollbackRetry(createProvider, () => inOriginalPrefix(() => withCurrentResourceSecrets(secrets, () => createProvider.create(op.logicalId, oldType, replayCreateProps(), replayingStateCreateContext(secrets)))), op.logicalId, logger, isInterrupted, mask, {
@@ -28920,8 +28989,9 @@ async function replayReverseReplacement(s) {
28920
28989
  interruptedMessage: "Rollback interrupted while waiting out the name cooldown"
28921
28990
  });
28922
28991
  } catch (createError) {
28992
+ const deletedMade = await deleteMarkedRecreate(createError, recreateCleanup);
28923
28993
  const msg = createError instanceof Error ? createError.message : String(createError);
28924
- if (!isNameCollisionErrorFrom(createError, op.logicalId)) throw createError;
28994
+ if (!isNameCollisionErrorFrom(createError, op.logicalId) || deletedMade) throw createError;
28925
28995
  const holder = inOriginalPrefix(() => reverseReplacementNewHoldsName({
28926
28996
  oldResourceType: oldType,
28927
28997
  newResourceType: op.resourceType,
@@ -28966,6 +29036,7 @@ async function replayReverseReplacement(s) {
28966
29036
  interruptedMessage: "Rollback interrupted while waiting for the old name to release"
28967
29037
  });
28968
29038
  } catch (recreateError) {
29039
+ await deleteMarkedRecreate(recreateError, recreateCleanup);
28969
29040
  throw new Error(mask(`Failed to re-create the old ${safe(op.logicalId)} after the new resource (${mask(current.physicalId)}) was already deleted: ${displaySafe(recreateError instanceof Error ? recreateError.message : String(recreateError))}. The resource is now absent — fix forward by re-deploying the stack.`), { cause: maskSecretsInError(recreateError instanceof Error ? recreateError : void 0, secrets) });
28970
29041
  }
28971
29042
  }
@@ -29046,6 +29117,31 @@ async function replayReverseReplacement(s) {
29046
29117
  ...adoptedLiveNewResource && { reason: mask("The re-create returned the live new resource instead of re-creating the old one (its Create API is name-idempotent), so the replacement was NOT fully reversed: the old resource's original properties may not have been re-applied. Inspect it with `cdkd drift` and run `cdkd deploy` to reconcile.") }
29047
29118
  });
29048
29119
  }
29120
+ async function deleteMarkedRecreate(error, s) {
29121
+ const madeId = createdBeforeFailure(error, s.op.logicalId, s.oldType);
29122
+ if (madeId === void 0) return false;
29123
+ const shown = `${shownLogicalId(s.op.logicalId)} (${refusalResourceType(s.oldType)})`;
29124
+ const id = s.mask(madeId);
29125
+ if (Object.values(s.stateResources).some((r) => r?.resourceType === s.oldType && r.physicalId === madeId)) return false;
29126
+ if (s.deletionPolicy === "Retain" || s.deletionPolicy === "Snapshot") {
29127
+ s.logger.warn(safeMsg` Rollback: the failed re-create of ${shown} made ${id} before failing; ` + safeMsg`it is left in AWS (DeletionPolicy: ${s.deletionPolicy}) and no record holds it — delete it yourself if it is not needed`);
29128
+ return false;
29129
+ }
29130
+ s.logger.info(safeMsg` Rollback: deleting ${id}, which the failed re-create of ${shown} made before failing`);
29131
+ let failure;
29132
+ try {
29133
+ const outcome = await s.provider.delete(s.op.logicalId, madeId, s.oldType, s.properties, {
29134
+ expectedRegion: s.region,
29135
+ deletionPolicy: "Delete"
29136
+ });
29137
+ failure = deleteSkipReason(outcome);
29138
+ } catch (deleteError) {
29139
+ failure = deleteError instanceof Error ? deleteError.message : String(deleteError);
29140
+ }
29141
+ if (failure === void 0) return true;
29142
+ s.logger.warn(safeMsg` Rollback: could not delete ${id}, which the failed re-create of ${shown} made before ` + safeMsg`failing (${s.mask(failure)}); no record holds it — delete it yourself`);
29143
+ return false;
29144
+ }
29049
29145
 
29050
29146
  //#endregion
29051
29147
  //#region src/deployment/stack-records-scope.ts
@@ -29245,7 +29341,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
29245
29341
  break;
29246
29342
  }
29247
29343
  const op = failedOps[i];
29248
- const action = classifyFailedOp(op, stateResources);
29344
+ const action = classifyFailedOp(op, stateResources, failedOps);
29249
29345
  const secrets = /* @__PURE__ */ new Map();
29250
29346
  const opMasker = createOpMasker(logger, secrets);
29251
29347
  const mask = opMasker.mask;
@@ -29267,6 +29363,10 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
29267
29363
  logger.warn(safeMsg` Rollback: Skipping failed CREATE of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) — it recorded ${mask(String(op.physicalId))}, which is not the resource state tracks under this id; manual attention may be required`);
29268
29364
  recordRollbackSkip(skipScope, op, "The failed CREATE recorded a physical id other than the one state now tracks under this logical id, so the rollback left it as it is; manual attention may be required.");
29269
29365
  break;
29366
+ case "skip-failed-replaced-deleted":
29367
+ logger.warn(safeMsg` Rollback: Skipping failed UPDATE of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) — its replacement deleted the old resource ${mask(String(op.physicalId))} before the new one's create failed, so there is nothing to revert` + (options.forDestroy === true ? "; the destroy drops its record with the stack" : "; state still records it, and a deploy whose template still replaces it creates it again"));
29368
+ recordRollbackSkip(skipScope, op, "The failed UPDATE was a replacement that deleted the old resource before its create failed, so there is nothing to revert it onto; state still records the deleted resource.");
29369
+ break;
29270
29370
  case "skip-failed-superseded":
29271
29371
  logger.warn(safeMsg` Rollback: Skipping failed CREATE of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) — it created ${mask(String(op.physicalId))} before failing, and a later deploy or rollback may own a resource under that id now; if it is not in use, delete it manually`);
29272
29372
  recordRollbackSkip(skipScope, op, "The failed CREATE created its resource before failing, but a later deploy or rollback may own a resource under that id now, so the rollback left it as it is; manual attention may be required.");
@@ -29284,7 +29384,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
29284
29384
  recordRollbackSkip(skipScope, op, `The failed UPDATE was a Type change (${String(op.previousState?.resourceType)} -> ${String(op.resourceType)}), which is a replacement, and its remote state is unknown, so it cannot be reverted in place.`);
29285
29385
  break;
29286
29386
  case "orphan-failed-create-retain": {
29287
- const failedCreateRecord = stateResources[op.logicalId];
29387
+ const failedCreateRecord = failedOpOwnRecord(op, stateResources);
29288
29388
  const orphanProvisionedBy = effectiveProvisionedBy(failedCreateRecord, op.provisionedBy);
29289
29389
  createRollbackRoute = orphanProvisionedBy;
29290
29390
  if (failedCreateRecord) {
@@ -29296,7 +29396,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
29296
29396
  result.orphaned.push(orphaned);
29297
29397
  options.onOrphan?.(orphaned);
29298
29398
  }
29299
- delete stateResources[op.logicalId];
29399
+ if (!isReplacementOrphan(op)) delete stateResources[op.logicalId];
29300
29400
  await noteRetainedResource(op.resourceType, op.logicalId);
29301
29401
  logger.info(` Rollback: leaving partially-created ${safe(op.logicalId)} (${safe(op.resourceType)}) in AWS (DeletionPolicy: Retain)` + (failedCreateRecord ? " — removed from state" : " — it was never in state"));
29302
29402
  await options.afterOp?.(op.logicalId);
@@ -29312,7 +29412,8 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
29312
29412
  }
29313
29413
  case "delete-failed-create":
29314
29414
  case "delete-failed-create-with-final-snapshot": {
29315
- const deleteProvisionedBy = effectiveProvisionedBy(stateResources[op.logicalId], op.provisionedBy);
29415
+ const failedCreateRecord = failedOpOwnRecord(op, stateResources);
29416
+ const deleteProvisionedBy = effectiveProvisionedBy(failedCreateRecord, op.provisionedBy);
29316
29417
  createRollbackRoute = deleteProvisionedBy;
29317
29418
  const snapshotPolicy = action === "delete-failed-create-with-final-snapshot";
29318
29419
  const takeFinalSnapshot = snapshotPolicy && ctx.skipFinalSnapshot !== true;
@@ -29330,7 +29431,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
29330
29431
  ...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
29331
29432
  ...ctx.skipFinalSnapshot === true && { skipFinalSnapshot: true },
29332
29433
  deletionPolicy: snapshotPolicy ? "Snapshot" : "Delete",
29333
- recordedAttributes: stateResources[op.logicalId]?.attributes
29434
+ recordedAttributes: failedCreateRecord?.attributes
29334
29435
  });
29335
29436
  throwIfDeleteSkipped(failedCreateDelete, op.logicalId, op.physicalId, "while deleting the partially-created resource", {
29336
29437
  ctx,
@@ -29339,7 +29440,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
29339
29440
  provisionedBy: deleteRoutedVia,
29340
29441
  mask
29341
29442
  });
29342
- delete stateResources[op.logicalId];
29443
+ if (!isReplacementOrphan(op)) delete stateResources[op.logicalId];
29343
29444
  await options.afterOp?.(op.logicalId);
29344
29445
  ctx.recordEvent?.({
29345
29446
  eventType: "ROLLBACK_RESOURCE_SUCCEEDED",
@@ -29439,7 +29540,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
29439
29540
  error: maskedRollbackEventError(revertError, mask)
29440
29541
  });
29441
29542
  }
29442
- inlinePolicyWriters.noteOutcome(op, action === "skip-failed-noop" || action === "skip-failed-mismatch" || action === "skip-failed-superseded" || ownRecord(stateResources, op.logicalId) !== recordBefore);
29543
+ inlinePolicyWriters.noteOutcome(op, action === "skip-failed-noop" || action === "skip-failed-mismatch" || action === "skip-failed-superseded" || action === "skip-failed-replaced-deleted" || ownRecord(stateResources, op.logicalId) !== recordBefore || isReplacementOrphan(op) && !pending.has(op) && (action === "delete-failed-create" || action === "delete-failed-create-with-final-snapshot" || action === "orphan-failed-create-retain"));
29443
29544
  }
29444
29545
  if (result.interrupted) await restoreHeldInlinePolicies(inlinePolicyWriters, stateResources, stackName, ctx, result, { refuseAll: true });
29445
29546
  if (emitEnvelope) ctx.recordEvent?.({
@@ -29952,11 +30053,14 @@ async function loadJournaledOrphans(stateBackend, stackName, region, rollbackOrp
29952
30053
  for (let s = segments.length - 1; s >= 0; s--) {
29953
30054
  const segment = segments[s];
29954
30055
  if (segment.reason === "nested-pending-parent") continue;
29955
- const ops = splitImportedOps(segment.failedOperations ?? [], segment).replay.filter(isJournaledOrphan);
30056
+ const replay = splitImportedOps(segment.failedOperations ?? [], segment).replay;
30057
+ const ops = replay.filter(isJournaledOrphan);
29956
30058
  if (ops.length === 0) continue;
30059
+ const companions = replay.filter((op) => op.changeType === "UPDATE" && replacementNeverSwapped(op, ops));
29957
30060
  out.push({
29958
30061
  segment,
29959
- ops
30062
+ ops,
30063
+ ...companions.length > 0 && { companions }
29960
30064
  });
29961
30065
  count += ops.length;
29962
30066
  }
@@ -29977,14 +30081,16 @@ async function deleteJournaledOrphans(orphans, stateResources, stackName, ctx, o
29977
30081
  handled: []
29978
30082
  };
29979
30083
  const inlinePolicyWriters = new RollbackInlinePolicyWriters();
29980
- for (const { segment, ops } of orphans.segments) {
30084
+ for (const { segment, ops: orphanOps, companions } of orphans.segments) {
29981
30085
  if (options.isInterrupted?.()) {
29982
30086
  total.interrupted = true;
29983
30087
  break;
29984
30088
  }
30089
+ const ops = [...companions ?? [], ...orphanOps];
29985
30090
  const replay = () => withStackName(stackName, () => replayFailedOperations(ops, stateResources, stackName, ctx, {
29986
30091
  emitEnvelope: false,
29987
30092
  inlinePolicyWriters,
30093
+ forDestroy: true,
29988
30094
  ...options.isInterrupted && { isInterrupted: options.isInterrupted }
29989
30095
  }));
29990
30096
  const result = segment.skipPrefix === void 0 ? await replay() : await withSkipPrefix(segment.skipPrefix, replay);
@@ -30050,7 +30156,11 @@ async function settleJournaledOrphansOnSuccess(args) {
30050
30156
  }
30051
30157
  const keptOps = new Set(kept.map(({ op }) => op));
30052
30158
  const skipped = all.filter(({ op }) => !keptOps.has(op) && op.physicalIdRecoveredFromError === false).length;
30053
- const cleared = all.filter(({ op }) => !keptOps.has(op));
30159
+ const clearedOrphans = all.filter(({ op }) => !keptOps.has(op));
30160
+ const cleared = [...clearedOrphans, ...orphans.segments.flatMap(({ segment, companions }) => (companions ?? []).filter((c) => replacementNeverSwapped(c, clearedOrphans.filter((o) => o.segment === segment).map((o) => o.op))).map((op) => ({
30161
+ segment,
30162
+ op
30163
+ })))];
30054
30164
  const stripCleared = cleared.length === 0 ? void 0 : async () => {
30055
30165
  try {
30056
30166
  await stateBackend.dropRollbackJournalFailedOperations(stackName, region, (op, segment) => isHandledOrphan(cleared, segment, op));
@@ -30099,7 +30209,7 @@ async function applySuccessRule(orphans, stateResources, deployLogicalIds, forei
30099
30209
  tracked.add(op);
30100
30210
  continue;
30101
30211
  }
30102
- if (Object.prototype.hasOwnProperty.call(stateResources, op.logicalId) || deployLogicalIds.has(op.logicalId)) {
30212
+ if (Object.prototype.hasOwnProperty.call(stateResources, op.logicalId) && !isReplacedRecord(op, stateResources[op.logicalId]) || deployLogicalIds.has(op.logicalId)) {
30103
30213
  op.physicalIdRecoveredFromError = false;
30104
30214
  continue;
30105
30215
  }
@@ -30269,7 +30379,7 @@ async function performRollback(completedOperations, stateResources, stackName, p
30269
30379
  const orphanIndexes = [];
30270
30380
  const orphanOps = [];
30271
30381
  failedOperations.forEach((op, i) => {
30272
- if (!isJournaledOrphan(op)) return;
30382
+ if (!isJournaledOrphan(op) && !(op.changeType === "UPDATE" && replacementNeverSwapped(op, failedOperations))) return;
30273
30383
  orphanIndexes.push(i);
30274
30384
  orphanOps.push({ ...op });
30275
30385
  });
@@ -31062,7 +31172,88 @@ async function readReaderForFreshNoEchoCeiling(logicalId, currentResource, secre
31062
31172
  }
31063
31173
  }
31064
31174
  function maskForResource(logicalId, text) {
31065
- return maskSecretsInText(text, this.perResourceSecrets.get(logicalId) ?? EMPTY_SECRETS);
31175
+ return maskSecretsInText(text, this.printingSecretsFor(logicalId) ?? EMPTY_SECRETS);
31176
+ }
31177
+ function secretNameNeedlesOf(logicalId, record, secrets, options) {
31178
+ const physicalId = typeof record?.physicalId === "string" && record.physicalId !== "" ? record.physicalId : void 0;
31179
+ const bag = secrets !== void 0 && hasMaskableValues(secrets) ? secrets : void 0;
31180
+ const mask = (text) => bag === void 0 ? text : maskSecretsInText(text, bag);
31181
+ const unresolved = (value) => value.includes("{{resolve:") || value === "***";
31182
+ const named = {
31183
+ resourceType: record?.resourceType,
31184
+ properties: record?.properties,
31185
+ logicalId
31186
+ };
31187
+ const needles = /* @__PURE__ */ new Set();
31188
+ const add = (needle) => {
31189
+ if (typeof needle === "string" && needle !== "") needles.add(needle);
31190
+ };
31191
+ for (const [raw, derived] of secretDerivedNamePairs({
31192
+ ...named,
31193
+ physicalIds: []
31194
+ })) if (typeof raw === "string" && !unresolved(raw) && isSecretDerivedValue(raw, mask)) add(derived);
31195
+ for (const [raw, spelling] of secretDerivedNamePairs({
31196
+ ...named,
31197
+ physicalIds: [physicalId ?? "cdkd-no-physical-id-yet"]
31198
+ })) {
31199
+ if (!isSecretDerivedValue(raw, mask)) continue;
31200
+ if (unresolved(raw)) {
31201
+ if (physicalId === void 0) continue;
31202
+ add(spelling);
31203
+ } else {
31204
+ add(raw);
31205
+ if (raw.toLowerCase() !== raw && raw.length >= 4) add(raw.toLowerCase());
31206
+ }
31207
+ }
31208
+ const properties = record?.properties;
31209
+ const path = properties !== null && typeof properties === "object" && Object.hasOwn(properties, "Path") ? properties["Path"] : void 0;
31210
+ if (physicalId !== void 0 && isSecretDerivedValue(path, mask)) add(physicalId);
31211
+ const embedded = options === void 0 ? secrets : options.embedded;
31212
+ const embeddedBag = embedded !== void 0 && hasMaskableValues(embedded) ? embedded : void 0;
31213
+ if (embeddedBag !== void 0 && physicalId !== void 0) {
31214
+ for (const needle of printingCorpusOf(embeddedBag).keys()) if (needle !== "" && (needle === physicalId || needle.length >= 4 && physicalId.includes(needle))) add(needle);
31215
+ }
31216
+ return needles.size > 0 ? needles : void 0;
31217
+ }
31218
+ function secretNameBagFor(logicalId) {
31219
+ let bag = this.secretNameNeedles.get(logicalId);
31220
+ if (bag === void 0) {
31221
+ bag = /* @__PURE__ */ new Map();
31222
+ this.secretNameNeedles.set(logicalId, bag);
31223
+ }
31224
+ return bag;
31225
+ }
31226
+ function noteSecretNamedRecord(logicalId, record) {
31227
+ const needles = secretNameNeedlesOf(logicalId, record, this.namingSecretsFor(logicalId), { embedded: this.perResourceSecrets.get(logicalId) });
31228
+ if (needles === void 0) return void 0;
31229
+ const registry = this.secretNameBagFor(logicalId);
31230
+ for (const needle of needles) recordLogOnlyValue(registry, needle);
31231
+ return needles;
31232
+ }
31233
+ function namingSecretsFor(logicalId) {
31234
+ const own = this.perResourceSecrets.get(logicalId);
31235
+ const noEcho = this.fingerprintNoEchoValues;
31236
+ if (!hasMaskableValues(noEcho)) return own;
31237
+ return unionOfSecretBags([own, noEcho]);
31238
+ }
31239
+ function noteSecretNamedReads(logicalId, record, resources) {
31240
+ const leaves = [...wholeStringLeavesOf(record?.properties)].filter((leaf) => leaf !== "");
31241
+ if (leaves.length === 0) return;
31242
+ for (const [otherId, other] of Object.entries(resources)) {
31243
+ if (otherId === logicalId) continue;
31244
+ const needles = secretNameNeedlesOf(otherId, other, this.namingSecretsFor(otherId), { embedded: this.perResourceSecrets.get(otherId) });
31245
+ if (needles === void 0) continue;
31246
+ const read = [...needles].filter((needle) => leaves.some((leaf) => leaf === needle || needle.length >= 4 && leaf.includes(needle)));
31247
+ if (read.length === 0) continue;
31248
+ const registry = this.secretNameBagFor(logicalId);
31249
+ for (const needle of read) recordLogOnlyValue(registry, needle);
31250
+ }
31251
+ }
31252
+ function printingSecretsFor(logicalId) {
31253
+ const secrets = this.perResourceSecrets.get(logicalId);
31254
+ const registry = this.secretNameNeedles.get(logicalId);
31255
+ if (!hasMaskableValues(registry)) return secrets;
31256
+ return unionOfSecretBags([secrets, registry]);
31066
31257
  }
31067
31258
  function maskedRecordRemedyFor(reads, resources, causeScoped = false) {
31068
31259
  const NESTED_STACK_RESOURCE_TYPE = "AWS::CloudFormation::Stack";
@@ -31184,6 +31375,7 @@ async function replaceDeleteFirstAndRecreate(logicalId, resourceType, oldResourc
31184
31375
  const replaceSkipReason = deleteSkipReason(deleteResult);
31185
31376
  if (replaceSkipReason !== void 0) throw new Error(deleteSkippedMessage(logicalId, currentResource.physicalId, replaceSkipReason, "during the --replace delete-first fallback"));
31186
31377
  this.logger.info(` ${green("✓")} Old resource deleted`);
31378
+ this.oldDeletedBeforeCreate.add(logicalId);
31187
31379
  this.logger.info(` Re-creating ${logicalId}...`);
31188
31380
  try {
31189
31381
  return await withRetry(() => this.withRetry(() => withCurrentResourceSecrets(secrets, () => replaceProvider.create(logicalId, resourceType, replaceProps, createContext)), logicalId, void 0, void 0, replaceProvider), logicalId, {
@@ -31556,6 +31748,82 @@ function isRefusedBeforeApplying(error, logicalId) {
31556
31748
  return false;
31557
31749
  }
31558
31750
 
31751
+ //#endregion
31752
+ //#region src/deployment/deploy-engine/resolver-context.ts
31753
+ function buildResolverContext(base, stackName) {
31754
+ const recordedSecretValues = /* @__PURE__ */ new Map();
31755
+ if (this.options.inheritedSecrets && this.options.inheritedSecrets.size > 0) inheritNestedStackParameterAssociations(recordedSecretValues, this.options.inheritedSecrets);
31756
+ return {
31757
+ template: base.template,
31758
+ resources: base.resources,
31759
+ ...base.parameters && Object.keys(base.parameters).length > 0 && { parameters: base.parameters },
31760
+ ...base.conditions && Object.keys(base.conditions).length > 0 && { conditions: base.conditions },
31761
+ stateBackend: this.stateBackend,
31762
+ stackName,
31763
+ ...this.exportIndexStore && { exportIndex: this.exportIndexStore },
31764
+ recordedImports: this.recordedImports,
31765
+ recordedOutputReads: this.recordedOutputReads,
31766
+ attributeHealer: (logicalId, resource) => this.healStaleAttributes(logicalId, resource, stackName),
31767
+ ...this.options.inheritedSecrets && hasMaskableValues(this.options.inheritedSecrets) && { inheritedSecrets: this.options.inheritedSecrets },
31768
+ recordedSecretValues,
31769
+ noEchoAttributeResources: this.noEchoAttributeResources,
31770
+ secretNameNeedles: (logicalId) => this.noteSecretNamedRecord(logicalId, Object.hasOwn(base.resources, logicalId) ? base.resources[logicalId] : void 0),
31771
+ ...base.redactedAttributeReads && { redactedAttributeReads: base.redactedAttributeReads }
31772
+ };
31773
+ }
31774
+ function printNestedStackReadsOnly(context, resourceType) {
31775
+ if (resourceType === "AWS::CloudFormation::Stack") context.printingSecrets = /* @__PURE__ */ new Map();
31776
+ }
31777
+ function getAttTargetOf(node) {
31778
+ if (node === null || typeof node !== "object" || Array.isArray(node)) return void 0;
31779
+ const getAtt = node["Fn::GetAtt"];
31780
+ if (Array.isArray(getAtt) && typeof getAtt[0] === "string") return getAtt[0];
31781
+ if (typeof getAtt === "string") return getAtt.split(".")[0];
31782
+ }
31783
+ function maskedInputSources(template, resources, conditions, stackName) {
31784
+ const parameters = this.fingerprintParameters;
31785
+ if (parameters === void 0) return void 0;
31786
+ return {
31787
+ template,
31788
+ parameterInput: parameters.parameterInput,
31789
+ conditions,
31790
+ childTemplate: this.fingerprintChildTemplates,
31791
+ resolve: async (node) => {
31792
+ const { attributeHealer: _healer, ...base } = this.buildResolverContext({
31793
+ template,
31794
+ resources,
31795
+ parameters: parameters.bound,
31796
+ ...conditions && { conditions }
31797
+ }, stackName);
31798
+ const context = {
31799
+ ...base,
31800
+ recordedImports: [],
31801
+ recordedOutputReads: [],
31802
+ bestEffort: true,
31803
+ skipDynamicReferences: true,
31804
+ staleAttributeHeal: { phase: "probe" },
31805
+ printingSecrets: /* @__PURE__ */ new Map()
31806
+ };
31807
+ const value = await this.resolver.resolve(structuredClone(node), context);
31808
+ const secrets = context.recordedSecretValues;
31809
+ const target = getAttTargetOf(node);
31810
+ const targetSecrets = target === void 0 ? void 0 : this.perResourceSecrets.get(target);
31811
+ if (targetSecrets !== void 0 && hasMaskableValues(targetSecrets)) {
31812
+ const probe = { value };
31813
+ const redacted = redactSecretsForState(probe, targetSecrets);
31814
+ if (JSON.stringify(redacted) !== JSON.stringify(probe)) return {
31815
+ value,
31816
+ keepAsWritten: true
31817
+ };
31818
+ }
31819
+ return {
31820
+ value,
31821
+ ...secrets && { secrets }
31822
+ };
31823
+ }
31824
+ };
31825
+ }
31826
+
31559
31827
  //#endregion
31560
31828
  //#region src/deployment/deploy-engine/create.ts
31561
31829
  async function provisionCreate(logicalId, change, stateResources, stackName, template, parameterValues, conditions, counts, progress) {
@@ -31570,7 +31838,12 @@ async function provisionCreate(logicalId, change, stateResources, stackName, tem
31570
31838
  redactedAttributeReads: []
31571
31839
  }, stackName);
31572
31840
  if (context.recordedSecretValues) this.perResourceSecrets.set(logicalId, context.recordedSecretValues);
31841
+ printNestedStackReadsOnly(context, resourceType);
31573
31842
  const resolvedProps = await this.resolver.resolve(desiredProps, context);
31843
+ this.noteSecretNamedRecord(logicalId, {
31844
+ resourceType,
31845
+ properties: resolvedProps
31846
+ });
31574
31847
  this.refuseRedactedAttributeReads(logicalId, resourceType, context);
31575
31848
  this.perResourceTemplateProps.set(logicalId, desiredProps);
31576
31849
  const fingerprintSources = template && this.maskedInputSources(template, stateResources, conditions, stackName);
@@ -34462,7 +34735,13 @@ async function provisionUpdate(logicalId, change, stateResources, stackName, tem
34462
34735
  }, stackName);
34463
34736
  const updateSecrets = context.recordedSecretValues ?? /* @__PURE__ */ new Map();
34464
34737
  this.perResourceSecrets.set(logicalId, updateSecrets);
34738
+ printNestedStackReadsOnly(context, resourceType);
34465
34739
  const resolvedProps = await this.resolver.resolve(desiredProps, context);
34740
+ this.noteSecretNamedRecord(logicalId, {
34741
+ resourceType,
34742
+ physicalId: stateResources[logicalId]?.physicalId,
34743
+ properties: resolvedProps
34744
+ });
34466
34745
  this.perResourceTemplateProps.set(logicalId, desiredProps);
34467
34746
  this.perResourceResolvedType.set(logicalId, resourceType);
34468
34747
  recordNestedStackParameterExpressions(updateSecrets, resourceType, resolvedProps, desiredProps);
@@ -34789,6 +35068,7 @@ async function updateByReplacement({ change, counts, currentProps, currentResour
34789
35068
  const recreateSkipReason = deleteSkipReason(recreateDeleteResult);
34790
35069
  if (recreateSkipReason !== void 0) throw new Error(deleteSkippedMessage(logicalId, currentResource.physicalId, recreateSkipReason, `during ${recreateFlagName}`));
34791
35070
  this.logger.info(` ${green("✓")} Old resource deleted`);
35071
+ this.oldDeletedBeforeCreate.add(logicalId);
34792
35072
  }
34793
35073
  this.logger.info(` Creating new ${logicalId}...`);
34794
35074
  createResult = await withRetry(() => this.withRetry(() => withCurrentResourceSecrets(updateSecrets, () => replaceProvider.create(logicalId, resourceType, replaceProps, { maskSecrets: createSecretMasker(updateSecrets) })), logicalId, void 0, void 0, replaceProvider), logicalId, {
@@ -34804,7 +35084,10 @@ async function updateByReplacement({ change, counts, currentProps, currentResour
34804
35084
  } else {
34805
35085
  this.logger.info(` Creating new ${logicalId}...`);
34806
35086
  let deletedOldFirst = lostWithParent !== void 0;
34807
- if (lostWithParent !== void 0) this.logger.info(safeMsg` ${logicalId} went with ${lostWithParent}, which was destroyed and re-created under the same id: re-creating it`);
35087
+ if (lostWithParent !== void 0) {
35088
+ this.oldDeletedBeforeCreate.add(logicalId);
35089
+ this.logger.info(safeMsg` ${logicalId} went with ${lostWithParent}, which was destroyed and re-created under the same id: re-creating it`);
35090
+ }
34808
35091
  try {
34809
35092
  createResult = await this.withRetry(() => withCurrentResourceSecrets(updateSecrets, () => replaceProvider.create(logicalId, resourceType, replaceProps, { maskSecrets: createSecretMasker(updateSecrets) })), logicalId, void 0, void 0, replaceProvider);
34810
35093
  } catch (createError) {
@@ -35009,6 +35292,7 @@ async function updateInPlace({ conditions, counts, currentProps, currentPropsAsW
35009
35292
  });
35010
35293
  const fallbackSkipReason = deleteSkipReason(fallbackDeleteResult);
35011
35294
  if (fallbackSkipReason !== void 0) throw new Error(deleteSkippedMessage(logicalId, currentResource.physicalId, fallbackSkipReason, "during the UPDATE-not-supported replacement"));
35295
+ this.oldDeletedBeforeCreate.add(logicalId);
35012
35296
  }
35013
35297
  let retainedSurvivorReason;
35014
35298
  let createResult;
@@ -35088,7 +35372,15 @@ async function updateInPlace({ conditions, counts, currentProps, currentPropsAsW
35088
35372
  captureProvider = replProvider;
35089
35373
  } else throw updateError;
35090
35374
  }
35091
- if (result.wasReplaced) this.logger.info(`Resource ${logicalId} was replaced: ${currentResource.physicalId} -> ${result.physicalId}`);
35375
+ this.updateWasReplaced.set(logicalId, result.wasReplaced === true);
35376
+ if (result.wasReplaced) {
35377
+ this.noteSecretNamedRecord(logicalId, {
35378
+ resourceType,
35379
+ physicalId: result.physicalId,
35380
+ properties: resolvedProps
35381
+ });
35382
+ this.logger.info(`Resource ${logicalId} was replaced: ${currentResource.physicalId} -> ${result.physicalId}`);
35383
+ }
35092
35384
  const dischargedByReplacement = result.wasReplaced === true && result.physicalId !== currentResource.physicalId;
35093
35385
  const keepsParameterRefusal = !dischargedByReplacement && hasUnverifiableParameterRefusal(currentResource);
35094
35386
  const carriedAttributes = result.attributes ?? (result.wasReplaced ? void 0 : currentResource.attributes);
@@ -35184,21 +35476,32 @@ async function provisionDelete(logicalId, change, stateResources, stackName, tem
35184
35476
  const skipPrefix = progress ? `[${progress.current}/${progress.total}] ` : " ";
35185
35477
  renderer.removeTask(logicalId);
35186
35478
  this.logger.info(`${skipPrefix}${formatResourceLine("skipped", logicalId, resourceType, `skipped (${deleteSkipped})`)}`);
35187
- this.logger.warn(deleteSkippedMessage(logicalId, currentResource.physicalId, deleteSkipped, "while removing it from the template") + `. Its cdkd state record was KEPT, so the next 'cdkd deploy' re-attempts the delete. Repair the record first (for a nested stack it is the CHILD's own state, whose other resources may already be gone), or delete the resource by hand and drop the record.\nInspect it with: ${pasteableCommand("cdkd state show", [{
35188
- value: stackName,
35189
- hole: "stack"
35190
- }, {
35191
- flag: "--stack-region",
35192
- value: this.stackRegion,
35193
- hole: "region"
35194
- }]).command}\nDrop the record with: ${pasteableCommand("cdkd state orphan", [{
35195
- value: stackName,
35196
- hole: "stack"
35197
- }, {
35479
+ const nested = resourceType === "AWS::CloudFormation::Stack";
35480
+ const recordStack = nested ? nestedChildStackName(stackName, logicalId) : stackName;
35481
+ const interrupted = nested && deleteSkipped.endsWith(" was interrupted");
35482
+ const stackArg = {
35483
+ value: recordStack,
35484
+ hole: nested ? "child-stack" : "stack",
35485
+ opts: { plainIdent: true }
35486
+ };
35487
+ this.logger.warn(deleteSkippedMessage(logicalId, currentResource.physicalId, deleteSkipped, "while removing it from the template") + ". Its cdkd state record was KEPT, so the next 'cdkd deploy' re-attempts the delete. Repair the record first (for a nested stack it is the CHILD's own state, whose other resources may already be gone), or delete the resource by hand and drop the record." + (interrupted ? " The commands name the child stack record. Its destroy was interrupted: re-run 'cdkd deploy' to resume it, and drop the child record only if that cannot finish, after deleting by hand what the child still holds (the inspect command with --show-nested lists every level; a child with nested stacks of its own has records under '<child>~<logicalId>' too, each needing the same drop)." : nested ? " The commands name the child stack record. Dropping it drops every record the child still has and nothing reaches those resources again, so first delete by hand what the child still holds (the inspect command with --show-nested lists every level; a child with nested stacks of its own has records under '<child>~<logicalId>' too, each needing the same drop). The next 'cdkd deploy' then removes this row." : " Keep '--resource' on the drop: without it the command drops the record of every resource in this still-deployed stack.") + `\nInspect it with: ${pasteableCommand("cdkd state show", [stackArg, {
35198
35488
  flag: "--stack-region",
35199
35489
  value: this.stackRegion,
35200
35490
  hole: "region"
35201
- }]).command}`);
35491
+ }]).command}\nDrop the record with: ${pasteableCommand("cdkd state orphan", [
35492
+ stackArg,
35493
+ {
35494
+ flag: "--stack-region",
35495
+ value: this.stackRegion,
35496
+ hole: "region"
35497
+ },
35498
+ ...nested ? [] : [{
35499
+ flag: "--resource",
35500
+ value: logicalId,
35501
+ hole: "logicalId",
35502
+ opts: { plainIdent: true }
35503
+ }]
35504
+ ]).command}`);
35202
35505
  if (counts) counts.deleteSkipped++;
35203
35506
  return { deleteSkipped };
35204
35507
  }
@@ -35343,10 +35646,13 @@ async function provisionResource(logicalId, change, stateResources, stackName, t
35343
35646
  let updatePartial;
35344
35647
  const physicalIdBeforeUpdate = stateResources[logicalId]?.physicalId;
35345
35648
  const provisionedByBeforeUpdate = stateResources[logicalId]?.provisionedBy;
35649
+ this.noteSecretNamedRecord(logicalId, stateResources[logicalId]);
35650
+ if (change.changeType === "DELETE") this.noteSecretNamedReads(logicalId, stateResources[logicalId], stateResources);
35651
+ const printingRegistry = this.secretNameBagFor(logicalId);
35346
35652
  let nestedChildUnaddressed;
35347
35653
  const deleteGuards = [];
35348
35654
  try {
35349
- await withResourceDeadline(async () => {
35655
+ await withPrintingSecrets(printingRegistry, () => withResourceDeadline(async () => {
35350
35656
  try {
35351
35657
  const { value: bodyResult, unaddressed } = await collectDeleteGuards(deleteGuards, () => collectNestedChildUnaddressed(() => this.provisionResourceBody(logicalId, change, stateResources, stackName, template, parameterValues, conditions, counts, progress)));
35352
35658
  deleteSkipped = bodyResult?.deleteSkipped;
@@ -35360,7 +35666,7 @@ async function provisionResource(logicalId, change, stateResources, stackName, t
35360
35666
  logicalId,
35361
35667
  resourceType: guard.resourceType,
35362
35668
  ...guard.provisionedBy && { provisionedBy: guard.provisionedBy },
35363
- ...guard.physicalId && { physicalId: this.maskForResource(logicalId, guard.physicalId) },
35669
+ ...guard.physicalId && { physicalId: maskSecretsInText(guard.physicalId, this.perResourceSecrets.get(logicalId) ?? EMPTY_SECRETS) },
35364
35670
  guard: guard.guard,
35365
35671
  reason: guard.reason
35366
35672
  });
@@ -35379,7 +35685,7 @@ async function provisionResource(logicalId, change, stateResources, stackName, t
35379
35685
  });
35380
35686
  },
35381
35687
  onTimeout: (elapsedMs) => new ResourceTimeoutError(logicalId, resourceType, this.stackRegion, elapsedMs, operationKind, timeoutMs)
35382
- });
35688
+ }));
35383
35689
  if (counts && nestedChildUnaddressed) {
35384
35690
  counts.deleteSkipped += nestedChildUnaddressed.deleteSkipped;
35385
35691
  counts.updatePartial += nestedChildUnaddressed.updatePartial;
@@ -35436,7 +35742,7 @@ async function provisionResource(logicalId, change, stateResources, stackName, t
35436
35742
  durationMs: Date.now() - resourceStartedAt,
35437
35743
  error: extractDeploymentEventError(error)
35438
35744
  });
35439
- throw new ProvisioningError(`Failed to ${change.changeType.toLowerCase()} resource ${logicalId}`, resourceType, logicalId, stateResources[logicalId]?.physicalId, error instanceof Error ? maskSecretsInError(error, this.perResourceSecrets.get(logicalId) ?? EMPTY_SECRETS) : void 0);
35745
+ throw new ProvisioningError(`Failed to ${change.changeType.toLowerCase()} resource ${logicalId}`, resourceType, logicalId, stateResources[logicalId]?.physicalId, error instanceof Error ? maskSecretsInError(error, this.printingSecretsFor(logicalId) ?? EMPTY_SECRETS) : void 0);
35440
35746
  } finally {
35441
35747
  renderer.removeTask(logicalId);
35442
35748
  }
@@ -35570,6 +35876,11 @@ var DagExecutor = class {
35570
35876
 
35571
35877
  //#endregion
35572
35878
  //#region src/deployment/deploy-engine/execute.ts
35879
+ const NO_REPLACEMENT_ORPHAN_TYPES = /* @__PURE__ */ new Set([
35880
+ "AWS::CloudFormation::Stack",
35881
+ "AWS::SQS::QueuePolicy",
35882
+ "AWS::SNS::TopicPolicy"
35883
+ ]);
35573
35884
  async function executeDeployment(template, currentState, changes, dag, executionLevels, stackName, outputsDigestSource, parameterValues, conditions, currentEtag, progress, migrationPending = false) {
35574
35885
  const concurrency = this.options.concurrency;
35575
35886
  this.deployChanges = changes;
@@ -35704,6 +36015,13 @@ async function executeDeployment(template, currentState, changes, dag, execution
35704
36015
  const statePhysicalId = newResources[logicalId]?.physicalId ?? previousState?.physicalId;
35705
36016
  if (refused && change.changeType === "CREATE" && statePhysicalId === void 0) throw provisionError;
35706
36017
  const createdId = change.changeType === "CREATE" && statePhysicalId === void 0 ? createdBeforeFailure(provisionError, logicalId, change.resourceType) : void 0;
36018
+ const heldRecord = newResources[logicalId] ?? previousState;
36019
+ const replaced = change.changeType === "UPDATE" && !NO_REPLACEMENT_ORPHAN_TYPES.has(change.resourceType) && statePhysicalId !== void 0 && statePhysicalId !== "" && heldRecord?.physicalId === statePhysicalId ? heldRecord : void 0;
36020
+ const replacementCreatedId = replaced ? createdBeforeFailure(provisionError, logicalId, change.resourceType) : void 0;
36021
+ const orphanedBy = replaced !== void 0 && replacementCreatedId !== void 0 && replacementCreatedId !== replaced.physicalId ? {
36022
+ record: replaced,
36023
+ createdId: replacementCreatedId
36024
+ } : void 0;
35707
36025
  failedOperations.push({
35708
36026
  logicalId,
35709
36027
  changeType: change.changeType,
@@ -35715,6 +36033,20 @@ async function executeDeployment(template, currentState, changes, dag, execution
35715
36033
  physicalIdRecoveredFromError: true,
35716
36034
  deletionPolicy: journaledOrphanPolicy(this.extractTemplateAttributes(template, logicalId).deletionPolicy)
35717
36035
  },
36036
+ ...orphanedBy !== void 0 && { replacementOrphaned: this.oldDeletedBeforeCreate.has(logicalId) ? "delete-first" : "create-first" },
36037
+ ...!refused && { attemptedProperties: this.attemptedResolvedProps.get(logicalId) }
36038
+ });
36039
+ if (orphanedBy !== void 0) failedOperations.push({
36040
+ logicalId,
36041
+ changeType: "CREATE",
36042
+ resourceType: change.resourceType,
36043
+ provisionedBy: "sdk",
36044
+ physicalId: orphanedBy.createdId,
36045
+ physicalIdRecoveredFromError: true,
36046
+ deletionPolicy: journaledOrphanPolicy(this.extractTemplateAttributes(template, logicalId).deletionPolicy),
36047
+ replacedPhysicalId: orphanedBy.record.physicalId,
36048
+ replacedResourceType: orphanedBy.record.resourceType,
36049
+ ...this.oldDeletedBeforeCreate.has(logicalId) && { replacedResourceDeleted: true },
35718
36050
  ...!refused && { attemptedProperties: this.attemptedResolvedProps.get(logicalId) }
35719
36051
  });
35720
36052
  throw provisionError;
@@ -35728,6 +36060,7 @@ async function executeDeployment(template, currentState, changes, dag, execution
35728
36060
  physicalId: newResources[logicalId]?.physicalId,
35729
36061
  properties: newResources[logicalId]?.properties,
35730
36062
  ...change.changeType === "UPDATE" && { oldResourceRetained: this.retainedOldOnReplacement.has(logicalId) },
36063
+ ...change.changeType === "UPDATE" && this.updateWasReplaced.has(logicalId) && { wasReplaced: this.updateWasReplaced.get(logicalId) },
35731
36064
  ...change.changeType === "UPDATE" && previousState !== void 0 && { previousResourceType: previousState.resourceType }
35732
36065
  });
35733
36066
  saveStateAfterResource(logicalId);
@@ -35884,7 +36217,7 @@ async function executeDeployment(template, currentState, changes, dag, execution
35884
36217
  autoRollbackClean = autoRollbackJournaled && rollbackResult.failures === 0 && rollbackResult.skipped === 0;
35885
36218
  if (rollbackResult.failures === 0 && rollbackResult.skipped > 0) {
35886
36219
  this.logger.warn(safeMsg`The automatic rollback could not revert ${rollbackResult.skipped} operation(s) ` + `(see the warnings above; each is recorded as a ROLLBACK_RESOURCE_SKIPPED event).` + (autoRollbackJournaled ? ` The rollback journal keeps them.` : ""));
35887
- if (autoRollbackJournaled && this.options.parentStackInfo === void 0 && failedOperations.some((op) => op.changeType !== "DELETE")) this.logger.warn(safeMsg`The record of the operation that failed is kept too. Revert it with: ${pasteableCommand("cdkd rollback", [{
36220
+ if (autoRollbackJournaled && this.options.parentStackInfo === void 0 && rollbackResult.remainingFailedOps.some((op) => op.changeType !== "DELETE")) this.logger.warn(safeMsg`The record of the operation that failed is kept too. Revert it with: ${pasteableCommand("cdkd rollback", [{
35888
36221
  value: stackName,
35889
36222
  hole: "stack"
35890
36223
  }, { literal: "--revert-failed" }]).command}`);
@@ -36899,77 +37232,6 @@ async function doDeployWithPrefetch(stackName, template, createOnlyPrefetch) {
36899
37232
  }
36900
37233
  }
36901
37234
 
36902
- //#endregion
36903
- //#region src/deployment/deploy-engine/resolver-context.ts
36904
- function buildResolverContext(base, stackName) {
36905
- const recordedSecretValues = /* @__PURE__ */ new Map();
36906
- if (this.options.inheritedSecrets && this.options.inheritedSecrets.size > 0) inheritNestedStackParameterAssociations(recordedSecretValues, this.options.inheritedSecrets);
36907
- return {
36908
- template: base.template,
36909
- resources: base.resources,
36910
- ...base.parameters && Object.keys(base.parameters).length > 0 && { parameters: base.parameters },
36911
- ...base.conditions && Object.keys(base.conditions).length > 0 && { conditions: base.conditions },
36912
- stateBackend: this.stateBackend,
36913
- stackName,
36914
- ...this.exportIndexStore && { exportIndex: this.exportIndexStore },
36915
- recordedImports: this.recordedImports,
36916
- recordedOutputReads: this.recordedOutputReads,
36917
- attributeHealer: (logicalId, resource) => this.healStaleAttributes(logicalId, resource, stackName),
36918
- ...this.options.inheritedSecrets && hasMaskableValues(this.options.inheritedSecrets) && { inheritedSecrets: this.options.inheritedSecrets },
36919
- recordedSecretValues,
36920
- noEchoAttributeResources: this.noEchoAttributeResources,
36921
- ...base.redactedAttributeReads && { redactedAttributeReads: base.redactedAttributeReads }
36922
- };
36923
- }
36924
- function getAttTargetOf(node) {
36925
- if (node === null || typeof node !== "object" || Array.isArray(node)) return void 0;
36926
- const getAtt = node["Fn::GetAtt"];
36927
- if (Array.isArray(getAtt) && typeof getAtt[0] === "string") return getAtt[0];
36928
- if (typeof getAtt === "string") return getAtt.split(".")[0];
36929
- }
36930
- function maskedInputSources(template, resources, conditions, stackName) {
36931
- const parameters = this.fingerprintParameters;
36932
- if (parameters === void 0) return void 0;
36933
- return {
36934
- template,
36935
- parameterInput: parameters.parameterInput,
36936
- conditions,
36937
- childTemplate: this.fingerprintChildTemplates,
36938
- resolve: async (node) => {
36939
- const { attributeHealer: _healer, ...base } = this.buildResolverContext({
36940
- template,
36941
- resources,
36942
- parameters: parameters.bound,
36943
- ...conditions && { conditions }
36944
- }, stackName);
36945
- const context = {
36946
- ...base,
36947
- recordedImports: [],
36948
- recordedOutputReads: [],
36949
- bestEffort: true,
36950
- skipDynamicReferences: true,
36951
- staleAttributeHeal: { phase: "probe" }
36952
- };
36953
- const value = await this.resolver.resolve(structuredClone(node), context);
36954
- const secrets = context.recordedSecretValues;
36955
- const target = getAttTargetOf(node);
36956
- const targetSecrets = target === void 0 ? void 0 : this.perResourceSecrets.get(target);
36957
- if (targetSecrets !== void 0 && hasMaskableValues(targetSecrets)) {
36958
- const probe = { value };
36959
- const redacted = redactSecretsForState(probe, targetSecrets);
36960
- if (JSON.stringify(redacted) !== JSON.stringify(probe)) return {
36961
- value,
36962
- keepAsWritten: true
36963
- };
36964
- }
36965
- return {
36966
- value,
36967
- ...secrets && { secrets }
36968
- };
36969
- }
36970
- };
36971
- }
36972
-
36973
37235
  //#endregion
36974
37236
  //#region src/deployment/label-routing.ts
36975
37237
  function deriveLabelRouting(change, existingState, registry, forceCcApi = false) {
@@ -37190,6 +37452,7 @@ var DeployEngine = class {
37190
37452
  recordedOutputReads = [];
37191
37453
  perResourceSecrets = /* @__PURE__ */ new Map();
37192
37454
  noEchoAttributeResources = /* @__PURE__ */ new Map();
37455
+ secretNameNeedles = /* @__PURE__ */ new Map();
37193
37456
  perResourceTemplateProps = /* @__PURE__ */ new Map();
37194
37457
  perResourceResolvedType = /* @__PURE__ */ new Map();
37195
37458
  fingerprintNoEchoValues = void 0;
@@ -37209,6 +37472,8 @@ var DeployEngine = class {
37209
37472
  recreatedUnderSameId = /* @__PURE__ */ new Set();
37210
37473
  restoredLostChildren = /* @__PURE__ */ new Set();
37211
37474
  updatesThatSentNothing = /* @__PURE__ */ new Set();
37475
+ updateWasReplaced = /* @__PURE__ */ new Map();
37476
+ oldDeletedBeforeCreate = /* @__PURE__ */ new Set();
37212
37477
  healBaseline = {};
37213
37478
  deployChanges = /* @__PURE__ */ new Map();
37214
37479
  stackRecordsView = void 0;
@@ -37242,6 +37507,7 @@ var DeployEngine = class {
37242
37507
  this.recordedOutputReads = [];
37243
37508
  this.perResourceSecrets = /* @__PURE__ */ new Map();
37244
37509
  this.noEchoAttributeResources = /* @__PURE__ */ new Map();
37510
+ this.secretNameNeedles = /* @__PURE__ */ new Map();
37245
37511
  this.perResourceTemplateProps = /* @__PURE__ */ new Map();
37246
37512
  this.constructPathTemplate = void 0;
37247
37513
  this.perResourceResolvedType = /* @__PURE__ */ new Map();
@@ -37260,6 +37526,8 @@ var DeployEngine = class {
37260
37526
  this.recreatedUnderSameId = /* @__PURE__ */ new Set();
37261
37527
  this.restoredLostChildren = /* @__PURE__ */ new Set();
37262
37528
  this.updatesThatSentNothing = /* @__PURE__ */ new Set();
37529
+ this.updateWasReplaced = /* @__PURE__ */ new Map();
37530
+ this.oldDeletedBeforeCreate = /* @__PURE__ */ new Set();
37263
37531
  this.healBaseline = {};
37264
37532
  this.deployChanges = /* @__PURE__ */ new Map();
37265
37533
  this.inlinePolicyWriters = /* @__PURE__ */ new Map();
@@ -37357,7 +37625,7 @@ var DeployEngine = class {
37357
37625
  } catch {}
37358
37626
  }
37359
37627
  maskSecretsInEvent(event) {
37360
- const secrets = event.logicalId ? this.perResourceSecrets.get(event.logicalId) : void 0;
37628
+ const secrets = event.logicalId ? this.printingSecretsFor(event.logicalId) : void 0;
37361
37629
  if (!secrets || !hasMaskableValues(secrets)) return event;
37362
37630
  const next = { ...event };
37363
37631
  if (next.error?.message) next.error = {
@@ -37433,6 +37701,11 @@ DeployEngine.prototype.refuseRedactedAttributeReads = refuseRedactedAttributeRea
37433
37701
  DeployEngine.prototype.allRecordedSecrets = allRecordedSecrets;
37434
37702
  DeployEngine.prototype.readReaderForFreshNoEchoCeiling = readReaderForFreshNoEchoCeiling;
37435
37703
  DeployEngine.prototype.maskForResource = maskForResource;
37704
+ DeployEngine.prototype.secretNameBagFor = secretNameBagFor;
37705
+ DeployEngine.prototype.noteSecretNamedRecord = noteSecretNamedRecord;
37706
+ DeployEngine.prototype.printingSecretsFor = printingSecretsFor;
37707
+ DeployEngine.prototype.namingSecretsFor = namingSecretsFor;
37708
+ DeployEngine.prototype.noteSecretNamedReads = noteSecretNamedReads;
37436
37709
  DeployEngine.prototype.kickOffObservedCapture = kickOffObservedCapture;
37437
37710
  DeployEngine.prototype.drainObservedCaptures = drainObservedCaptures;
37438
37711
  DeployEngine.prototype.buildObservedCaptureSiblings = buildObservedCaptureSiblings;
@@ -37457,5 +37730,5 @@ DeployEngine.prototype.replacementNameOrigin = replacementNameOrigin;
37457
37730
  DeployEngine.prototype.orphanedNameCollisionAdvice = orphanedNameCollisionAdvice;
37458
37731
 
37459
37732
  //#endregion
37460
- export { resourcesNamingDeclaredParameter as $, dynamicReferenceTokens as $a, withoutSilentDropProperties as $i, reEnableInstanceApiTermination as $n, resolveDockerContextDirectory as $o, malformedExportSourceWarning as $r, absoluteAssemblyPathEscape as $s, displayTextOrWithheld as $t, resolveDynamoDbDeleteBudgetClock as A, DagBuilder as Aa, refuseMalformedResourceEntriesForImport as Ai, definedAttributes as An, orphansAfterRollback as Ao, keepsSecretReferenceToken as Ar, resolveUseCdkBootstrapAssets as As, resolveReplacementOldType as At, getPriorAttempts as B, printingCorpusOf as Ba, refuseMalformedState as Bi, ccProtectionRegistryTypes as Bn, rewriteTemplateAssetReferences as Bo, STATE_REGION_DIVERGED as Br, decodeListingKey as Bs, isFinalSnapshotError as Bt, perType as C, prefetchCreateOnlyPropertyPaths as Ca, refuseMalformedOrphansForOrphan as Ci, DBPROXY_TAGS_WHAT as Cn, exportNamesCarriedFrom as Co, isUnboundTemplateParameter as Cr, loadCdkJson as Cs, getStackRecords as Ct, beginDeleteWait as D, canonicalLambdaFunctionName as Da, refuseMalformedResourceEntries as Di, refuseMalformedDesiredTags as Dn, importableOutputKeys as Do, carriesDynamicReference as Dr, resolveSkipPrefix as Ds, isJournaledOrphan as Dt, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as E, withRetry as Ea, refuseMalformedResourceAttributesForOrphan as Ei, readTagList as En, hasUnverifiableParameterRefusal as Eo, isImpossibleEmptyStoredAttribute as Er, resolveCaptureObservedState as Es, demoteSupersededOrphans as Et, waitForIndexesSettled as F, carryLogOnlyValues as Fa, refuseMalformedResourcePropertiesForExport as Fi, wouldReturnToSdkProvider as Fn, stringifyValue as Fo, parseWebACLArn as Fr, CFN_TEMPLATE_URL_LIMIT as Fs, PRE_DELETE_SNAPSHOT_TYPES as Ft, cyan as G, errorCauseChain as Ga, repairMalformedResourcePropertiesForReadOnly as Gi, withIndeterminateGuard as Gn, getBootstrapMarkerKey as Go, displayLogicalId as Gr, AssemblyReader as Gs, redactedDeleteAddressFields as Gt, formatResourceLine as H, recordLogOnlyValue as Ha, repairMalformedOrphansForReadOnly as Hi, UNSPECIFIED_SKIP_REASON as Hn, BOOTSTRAP_MARKER_PREFIX as Ho, UNREADABLE_ORPHANS_CONTAINER_ROW as Hr, PARTITION_TABLE as Hs, unsupportedFinalSnapshotError as Ht, ECR_AUTO_DELETE_IMAGES_TAG as I, createUnionSecretMasker as Ia, refuseMalformedResourcePropertiesForOrphan as Ii, isCustomResourceType as In, WorkGraph as Io, withSharedDrainBudget as Ir, MIGRATE_TMP_PREFIX as Is, buildFinalSnapshotIdentifier as It, red as J, markSameGenerationBag as Ja, unreadableOrphanRecords as Ji, disableInstanceApiTermination as Jn, readBootstrapMarkerBody as Jo, hasReadableResources as Jr, defineOwnKey as Js, updatePartialReason as Jt, gray as K, maskSecretsInError as Ka, repairMalformedResourcesForReadOnly as Ki, isWaitAbandonedError as Kn, isCrossRegionRedirect as Ko, hasReadableOrphans as Kr, StageLoadError as Ks, redactedDeleteAddressSkip as Kt, S3_AUTO_DELETE_OBJECTS_TAG as L, hasMaskableValues as La, refuseMalformedResourcesForDeploy as Li, getCurrentResourceSecrets as Ln, buildAssetRedirectMap as Lo, parameterInputsFor as Lr, findLargeInlineResources as Ls, ccRoutedFinalSnapshotError as Lt, DELETE_INDEX_WAIT_PROCEED_NOTE as M, liveMatchesUnresolvedTokenFrame as Ma, refuseMalformedResourceEntriesForOrphan as Mi, CC_BROKEN_REASON as Mn, shouldRetainResource as Mo, cfnRefValueFromPhysicalId as Mr, warnDeprecatedNoPrefixCliFlag as Ms, getCurrentProducerRegions as Mt, INDEX_SETTLE_POLL_INTERVAL_MS as N, inheritNestedStackParameterAssociations as Na, refuseMalformedResourcePropertiesForDestroy as Ni, ProviderRegistry as Nn, AssetPublisher as No, isStalePlaceholderArnAttribute as Nr, ssmResolvedValueType as Ns, inheritProducerRegions as Nt, compensateRemovedDeletionProtection as O, lambdaFunctionNameForMask as Oa, refuseMalformedResourceEntriesForDeploy as Oi, tagMapAsList as On, importableOutputs as Oo, carriesFetchableDynamicReference as Or, resolveStateBucketWithDefault as Os, planFailedOps as Ot, deleteTableWithIndexBusyRetry as P, recordNestedStackParameterExpressions as Pa, refuseMalformedResourcePropertiesForDrift as Pi, ccBrokenReason as Pn, isSensitiveAttributeName as Po, refStateLookupFromResource as Pr, CFN_TEMPLATE_BODY_LIMIT as Ps, ATOMIC_FINAL_SNAPSHOT_TYPES as Pt, reachableDivergentParameters as Q, DYNAMIC_REFERENCE_TOKEN_SCAN as Qa, unwrittenCreateOnlyReplacement as Qi, reDisableInstanceApiTermination as Qn, buildDockerImage as Qo, malformedExportNamesWarning as Qr, ownValue as Qs, WITHHELD_NAME_DISPLAY as Qt, hasCdkAutoDeleteTag as R, literalSplitDelimitersOf as Ra, refuseMalformedResourcesForDestroy as Ri, CloudControlProvider as Rn, createAssetRedirectResolver as Ro, passedParameterClassesOf as Rr, uploadCfnTemplate as Rs, createPreDeleteFinalSnapshot as Rt, isProtectionValueActive as S, requireConfigString as Sa, refuseMalformedOrphansForDestroy as Si, acquireIdempotencyToken as Sn, describeRegionValueKind as So, coerceParameterTypedValue as Sr, getLegacyStateBucketName as Ss, destroyStackRecordsView as St, DynamoDBGlobalTableProvider as T, describeTypeWithThrottleRetry as Ta, refuseMalformedOutputsForDestroy as Ti, planTagDiff as Tn, hasReasonlessBaselineRefusal as To, getAccountInfo as Tr, resolveAutoAssetStorage as Ts, recordAfterRollbackUpdate as Tt, createReadOnlyAttributeHealerFactory as U, shareLogOnlyValues as Ua, repairMalformedOutputsForReadOnly as Ui, deleteIndeterminateGuards as Un, assertAssetBucketRegion as Uo, UNREADABLE_RESOURCES_MAP_ROW as Ur, canonicalizeRegion as Us, REDACTED_DELETE_ADDRESS_SKIP_REASON as Ut, markRefusedBeforeApplying as V, recordLogOnlyParameterValue as Va, repairMalformedOrphanRecordsForReadOnly as Vi, unchangedBehindSecretReference as Vn, AssetModeResolver as Vo, STATE_RESOURCES_MALFORMED as Vr, expectedOwnerParam as Vs, refusesFinalSnapshot as Vt, bold as W, createSecretMasker as Wa, repairMalformedResourceEntriesForReadOnly as Wi, deleteSkipReason as Wn, ensureAssetStorage as Wo, deployRefusesOrphanRowsReason as Wr, derivePartitionAndUrlSuffix as Ws, isRedactedRecordedValue as Wt, computeParameterTaint as X, scrubResourceRecord as Xa, findActionableSilentDrops as Xi, isTerminationProtectionPropagationError as Xn, validateContainerRepoName as Xo, isReadableResourceEntry as Xr, hasPlainPrototype$1 as Xs, DeploymentEventsStore as Xt, yellow as Y, redactSecretsForState as Ya, unreadableResourceEntries as Yi, ec2InstanceProtectionSite as Yn, validateAssetBucketName as Yo, isReadableOrphanRecord as Yr, hasOwnKey as Ys, DeploymentEventsReader as Yt, namesAnyDeclaredParameter as Z, recoverMaskedOutput as Za, findSilentDropProperties as Zi, observeThenDisableInstanceApiTermination as Zn, buildDenyExternalAccessPolicy as Zo, malformedDriftResourcePropertiesWarning as Zr, nullPrototypeRecord as Zs, extractDeploymentEventError as Zt, makeCanonicalizePropertiesFn as _, configStringRefusal as _a, refuseDivergentRecordRegionForDestroy as _i, RollbackInlinePolicyWriters as _n, isLockInfoExpired as _o, s3BucketArn as _r, AssetManifestLoader as _s, getCurrentNestedStackContext as _t, findNestedTemplateTreeDefect as a, isStatefulRecreateTargetForReplace as aa, resolveBucketRegion as ac, malformedOrphanRowsKeptWarning as ai, isWholeDynamicReferenceValue as an, recordMaskOnlyValue as ao, regionLessSecretName as ar, formatDockerLoginError as as, makeSiblingClaimReader as at, recordedProtectionNote as b, requireConfigArray as ba, refuseMalformedOrphanRecordsForDestroy as bi, reserveStackCreateToken as bn, splitImportedOps as bo, s3BucketRegionalDomainName as br, synthesisStatusMessage as bs, replayRollback as bt, renderNestedTemplateTreeDefect as c, WARM_THROUGHPUT_MEMBERS as ca, malformedOutputsRefusalMessage as ci, collectPublishedOutputNames as cn, recordProvenPublicExpression as co, assertSendableRoleArn as cr, isMalformedEnvKey as cs, displacedOpClause as ct, conditionInputsFrom as d, toCfnInteger as da, malformedResourceEntriesWarning as di, DEFAULT_RESOURCE_TIMEOUT_MS as dn, STATE_SOURCED_CROSS_GENERATION_RULES as do, sendableAssumeRoleCommand as dr, redactedDockerCause as ds, getNestedRevertRun as dt, NO_CC_HANDLERS_REASON as ea, describeFileReadFailure as ec, malformedLocalOutputsWarning as ei, exportAliasCollisionScrubWarning as en, isUncertifiedBaselineMaskPosition as eo, DiffCalculator as er, describeDockerCapturedOutput as es, deleteJournaledOrphans as et, parentSuppliedValues as f, toFiniteNumber as fa, malformedResourcePropertiesWarning as fi, DEFAULT_RESOURCE_WARN_AFTER_MS as fn, STATE_SOURCED_READBACK_RULES as fo, AWS_CREDENTIAL_ENV_KEYS as fr, runDockerForeground as fs, nestedChildStackName as ft, mergeNoChangeOutputs as g, configIntegerRefusal as ga, previewableOrphanRecords as gi, formatDestructiveChange as gn, LockManager as go, isSettledInstanceState as gr, stripControlChars as gs, withNestedRevertRun as gt, keptWholeReasonText as h, configBooleanRefusal as ha, malformedStateRefusalMessage as hi, findDestructiveChanges as hn, isSingleDynamicReferenceToken as ho, envCredentialsAreAssumedRole as hr, escapeRegExp$3 as hs, revertedNestedRowIds as ht, childTemplateLoader as i, MULTI_REGION_RECREATE_BLOCKED_TYPES as ia, clearBucketRegionCache as ic, malformedOrphanRecordsWarning as ii, exportNameSecretExposure as in, provenPublicValue as io, producerRegionsFromState as ir, finchSecretArgvRefusal as is, sameJournaledOrphans as it, resolveDynamoDbDeleteBudgetMs as j, TemplateParser as ja, refuseMalformedResourceEntriesForImportSave as ji, stringifyIfAssigned as jn, orphansCarriedFrom as jo, AWS_NO_VALUE as jr, stateBucketExistenceConfirmed as js, findNestedStackTypeChanges as jt, deleteBudgetKey as k, sameLambdaFunctionAddress as ka, refuseMalformedResourceEntriesForDestroy as ki, tagPlanWarning as kn, isReadableBag as ko, isNamelessDynamicReferenceError as kr, resolveStateBucketWithDefaultAndSource as ks, planRollback as kt, templateIdentity as l, coerceWarmThroughput as la, malformedOutputsWarning as li, isExportAliasCollision as ln, wholeStringLeavesOf as lo, explicitRoleArnOrThrow as lr, partitionSensitiveEnv as ls, displacedPhysicalIdShown as lt, isSecretBearingReferenceString as m, coerceCfnInteger as ma, malformedScrubResourceEntriesRefusalMessage as mi, constructPathOf as mn, WHOLE_DYNAMIC_REFERENCE_PATTERN as mo, callerEnvCredentials as mr, warnFinchArgvExposure as ms, revertNestedChildFromJournal as mt, IMPLICIT_DELETE_DEPENDENCIES as n, findReplacedReadersOfRecreateTargets as na, renderAssemblyPathEscape as nc, malformedLocalResourcesWarning as ni, secretBearingStateKeyWarning as nn, identityKeyFor as no, IntrinsicFunctionResolver as nr, describeDockerFailure as ns, journaledOrphanLines as nt, isAbsoluteAssetPath as o, isStatefulRecreateTargetSync as oa, malformedOrphansRefusalMessage as oi, noEchoParameterValueSeed as on, recordMaskOnlyValuesIn as oo, applyRoleArnIfSet as or, getDockerCmd as os, planOrphanAdoption as ot, readRecordedConditionVerdicts as p, coerceCfnBoolean as pa, malformedResourcesWarning as pi, maskingRetryLogger as pn, TEMPLATE_SOURCED_RULES as po, applyCallerIdentityCredentials as pr, runDockerStreaming as ps, recordDisplacedSkips as pt, green as q, maskSecretsInText as qa, unpreviewableOrphanRecords as qi, markWaitAbandoned as qn, parseBootstrapMarker as qo, hasReadableOutputs as qr, processStackMessages as qs, updatePartialMessage as qt, computeImplicitDeleteEdges as r, shownType as ra, resolveAssemblyPath as rc, malformedOrphanRecordsRefusalMessage as ri, secretSafeKeyDisplay as rn, carriesSecretMask as ro, classifyReplaySecretRegion as rr, dockerSpawnEnvWithSensitive as rs, loadJournaledOrphans as rt, listNestedTemplateRows as s, renderStatefulReason as sa, malformedOrphansWarning as si, collectDeclaredOutputNames as sn, recordNoEchoAttributeValues as so, assertFlagRoleArn as sr, isDockerClientEnvKey as ss, NESTED_PENDING_PARENT_REASON as st, DeployEngine as t, hasNoCloudControlHandlers as ta, displayAssemblyPath as tc, malformedLocalResourceEntriesWarning as ti, secretBearing as tn, pathCrossesDottedKey as to, INTRINSIC_KEYS as tr, describeDockerExecFailure as ts, isHandledOrphan as tt, conditionFingerprint as u, isWarmThroughputDecrease as ua, malformedRenderedContainersWarning as ui, bindingSkippedOutputs as un, STATE_SOURCED_BASELINE_RULES as uo, isIamRoleArn as ur, redactDockerArgvValues as us, dropSettledNestedJournals as ut, withResourceDeadline as v, readConfigString as va, refuseMalformedNestedChildOutputs as vi, earliestDefined as vn, S3StateBackend as vo, s3BucketDomainName as vr, getDockerImageBySourceHash as vs, withNestedStackContext as vt, readProtection as w, templateResourceTypes as wa, refuseMalformedOutputs as wi, DBPROXY_TAG_OPTIONS as wn, hasReadableExportSet as wo, parameterTypeMayLoseSecretIdentity as wr, resolveApp as ws, withStackRecords as wt, PROTECTION_PROPERTY_BY_TYPE as x, requireConfigObject as xa, refuseMalformedOrphans as xi, withCreateTokenLedger as xn, acceptedCreateOnlyDropsOf as xo, s3BucketWebsiteUrl as xr, getDefaultStateBucketName as xs, awaitInFlightSibling as xt, recordedProtectionEvidence as y, replayWarn as ya, refuseMalformedOrphanRecords as yi, ledgerForStack as yn, rebuildClientForBucketRegion as yo, s3BucketDualStackDomainName as yr, Synthesizer as ys, replayFailedOperations as yt, isTruthyCfnBoolean as z, logOnlyValueCount as za, refuseMalformedResourcesForExport as zi, slowCcOperationTimeoutMs as zn, loadPublishableAssetManifest as zo, JSON_LISTING_HOLE_VALUE as zr, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as zs, effectiveDeletionPolicy as zt };
37461
- //# sourceMappingURL=deploy-engine-D7204v7Z.js.map
37733
+ export { resourcesNamingDeclaredParameter as $, recoverMaskedOutput as $a, findSilentDropProperties as $i, observeThenDisableInstanceApiTermination as $n, buildDenyExternalAccessPolicy as $o, malformedDriftResourcePropertiesWarning as $r, nullPrototypeRecord as $s, extractDeploymentEventError as $t, resolveDynamoDbDeleteBudgetClock as A, lambdaFunctionNameForMask as Aa, refuseMalformedResourceEntriesForDeploy as Ai, tagMapAsList as An, importableOutputs as Ao, carriesFetchableDynamicReference as Ar, resolveStateBucketWithDefault as As, planRollback as At, getPriorAttempts as B, literalSplitDelimitersOf as Ba, refuseMalformedResourcesForDestroy as Bi, CloudControlProvider as Bn, createAssetRedirectResolver as Bo, passedParameterClassesOf as Br, uploadCfnTemplate as Bs, createPreDeleteFinalSnapshot as Bt, perType as C, requireConfigObject as Ca, refuseMalformedOrphans as Ci, withCreateTokenLedger as Cn, acceptedCreateOnlyDropsOf as Co, s3BucketWebsiteUrl as Cr, getDefaultStateBucketName as Cs, getStackRecords as Ct, beginDeleteWait as D, describeTypeWithThrottleRetry as Da, refuseMalformedOutputsForDestroy as Di, planTagDiff as Dn, hasReasonlessBaselineRefusal as Do, getAccountInfo as Dr, resolveAutoAssetStorage as Ds, isJournaledOrphan as Dt, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as E, templateResourceTypes as Ea, refuseMalformedOutputs as Ei, DBPROXY_TAG_OPTIONS as En, hasReadableExportSet as Eo, parameterTypeMayLoseSecretIdentity as Er, resolveApp as Es, demoteSupersededOrphans as Et, waitForIndexesSettled as F, inheritNestedStackParameterAssociations as Fa, refuseMalformedResourcePropertiesForDestroy as Fi, ProviderRegistry as Fn, AssetPublisher as Fo, isStalePlaceholderArnAttribute as Fr, ssmResolvedValueType as Fs, inheritProducerRegions as Ft, cyan as G, shareLogOnlyValues as Ga, repairMalformedOutputsForReadOnly as Gi, deleteIndeterminateGuards as Gn, assertAssetBucketRegion as Go, UNREADABLE_RESOURCES_MAP_ROW as Gr, canonicalizeRegion as Gs, REDACTED_DELETE_ADDRESS_SKIP_REASON as Gt, formatResourceLine as H, printingCorpusOf as Ha, refuseMalformedState as Hi, ccProtectionRegistryTypes as Hn, rewriteTemplateAssetReferences as Ho, STATE_REGION_DIVERGED as Hr, decodeListingKey as Hs, isFinalSnapshotError as Ht, ECR_AUTO_DELETE_IMAGES_TAG as I, recordNestedStackParameterExpressions as Ia, refuseMalformedResourcePropertiesForDrift as Ii, ccBrokenReason as In, isSensitiveAttributeName as Io, refStateLookupFromResource as Ir, CFN_TEMPLATE_BODY_LIMIT as Is, ATOMIC_FINAL_SNAPSHOT_TYPES as It, red as J, maskSecretsInError as Ja, repairMalformedResourcesForReadOnly as Ji, isWaitAbandonedError as Jn, isCrossRegionRedirect as Jo, hasReadableOrphans as Jr, StageLoadError as Js, redactedDeleteAddressSkip as Jt, gray as K, createSecretMasker as Ka, repairMalformedResourceEntriesForReadOnly as Ki, deleteSkipReason as Kn, ensureAssetStorage as Ko, deployRefusesOrphanRowsReason as Kr, derivePartitionAndUrlSuffix as Ks, isRedactedRecordedValue as Kt, S3_AUTO_DELETE_OBJECTS_TAG as L, carryLogOnlyValues as La, refuseMalformedResourcePropertiesForExport as Li, wouldReturnToSdkProvider as Ln, stringifyValue as Lo, parseWebACLArn as Lr, CFN_TEMPLATE_URL_LIMIT as Ls, PRE_DELETE_SNAPSHOT_TYPES as Lt, DELETE_INDEX_WAIT_PROCEED_NOTE as M, DagBuilder as Ma, refuseMalformedResourceEntriesForImport as Mi, definedAttributes as Mn, orphansAfterRollback as Mo, keepsSecretReferenceToken as Mr, resolveUseCdkBootstrapAssets as Ms, resolveReplacementOldType as Mt, INDEX_SETTLE_POLL_INTERVAL_MS as N, TemplateParser as Na, refuseMalformedResourceEntriesForImportSave as Ni, stringifyIfAssigned as Nn, orphansCarriedFrom as No, AWS_NO_VALUE as Nr, stateBucketExistenceConfirmed as Ns, findNestedStackTypeChanges as Nt, compensateRemovedDeletionProtection as O, withRetry as Oa, refuseMalformedResourceAttributesForOrphan as Oi, readTagList as On, hasUnverifiableParameterRefusal as Oo, isImpossibleEmptyStoredAttribute as Or, resolveCaptureObservedState as Os, isReplacementOrphan as Ot, deleteTableWithIndexBusyRetry as P, liveMatchesUnresolvedTokenFrame as Pa, refuseMalformedResourceEntriesForOrphan as Pi, CC_BROKEN_REASON as Pn, shouldRetainResource as Po, cfnRefValueFromPhysicalId as Pr, warnDeprecatedNoPrefixCliFlag as Ps, getCurrentProducerRegions as Pt, reachableDivergentParameters as Q, scrubResourceRecord as Qa, findActionableSilentDrops as Qi, isTerminationProtectionPropagationError as Qn, validateContainerRepoName as Qo, isReadableResourceEntry as Qr, hasPlainPrototype$1 as Qs, DeploymentEventsStore as Qt, hasCdkAutoDeleteTag as R, createUnionSecretMasker as Ra, refuseMalformedResourcePropertiesForOrphan as Ri, isCustomResourceType as Rn, WorkGraph as Ro, withSharedDrainBudget as Rr, MIGRATE_TMP_PREFIX as Rs, buildFinalSnapshotIdentifier as Rt, isProtectionValueActive as S, requireConfigArray as Sa, refuseMalformedOrphanRecordsForDestroy as Si, reserveStackCreateToken as Sn, splitImportedOps as So, s3BucketRegionalDomainName as Sr, synthesisStatusMessage as Ss, destroyStackRecordsView as St, DynamoDBGlobalTableProvider as T, prefetchCreateOnlyPropertyPaths as Ta, refuseMalformedOrphansForOrphan as Ti, DBPROXY_TAGS_WHAT as Tn, exportNamesCarriedFrom as To, isUnboundTemplateParameter as Tr, loadCdkJson as Ts, recordAfterRollbackUpdate as Tt, createReadOnlyAttributeHealerFactory as U, recordLogOnlyParameterValue as Ua, repairMalformedOrphanRecordsForReadOnly as Ui, unchangedBehindSecretReference as Un, AssetModeResolver as Uo, STATE_RESOURCES_MALFORMED as Ur, expectedOwnerParam as Us, refusesFinalSnapshot as Ut, markRefusedBeforeApplying as V, logOnlyValueCount as Va, refuseMalformedResourcesForExport as Vi, slowCcOperationTimeoutMs as Vn, loadPublishableAssetManifest as Vo, JSON_LISTING_HOLE_VALUE as Vr, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as Vs, effectiveDeletionPolicy as Vt, bold as W, recordLogOnlyValue as Wa, repairMalformedOrphansForReadOnly as Wi, UNSPECIFIED_SKIP_REASON as Wn, BOOTSTRAP_MARKER_PREFIX as Wo, UNREADABLE_ORPHANS_CONTAINER_ROW as Wr, PARTITION_TABLE as Ws, unsupportedFinalSnapshotError as Wt, computeParameterTaint as X, markSameGenerationBag as Xa, unreadableOrphanRecords as Xi, disableInstanceApiTermination as Xn, readBootstrapMarkerBody as Xo, hasReadableResources as Xr, defineOwnKey as Xs, updatePartialReason as Xt, yellow as Y, maskSecretsInText as Ya, unpreviewableOrphanRecords as Yi, markWaitAbandoned as Yn, parseBootstrapMarker as Yo, hasReadableOutputs as Yr, processStackMessages as Ys, updatePartialMessage as Yt, namesAnyDeclaredParameter as Z, redactSecretsForState as Za, unreadableResourceEntries as Zi, ec2InstanceProtectionSite as Zn, validateAssetBucketName as Zo, isReadableOrphanRecord as Zr, hasOwnKey as Zs, DeploymentEventsReader as Zt, makeCanonicalizePropertiesFn as _, configBooleanRefusal as _a, malformedStateRefusalMessage as _i, findDestructiveChanges as _n, isSingleDynamicReferenceToken as _o, envCredentialsAreAssumedRole as _r, escapeRegExp$3 as _s, getCurrentNestedStackContext as _t, findNestedTemplateTreeDefect as a, shownType as aa, resolveAssemblyPath as ac, malformedOrphanRecordsRefusalMessage as ai, secretSafeKeyDisplay as an, carriesSecretMask as ao, classifyReplaySecretRegion as ar, dockerSpawnEnvWithSensitive as as, makeSiblingClaimReader as at, recordedProtectionNote as b, readConfigString as ba, refuseMalformedNestedChildOutputs as bi, earliestDefined as bn, S3StateBackend as bo, s3BucketDomainName as br, getDockerImageBySourceHash as bs, replayRollback as bt, renderNestedTemplateTreeDefect as c, isStatefulRecreateTargetSync as ca, malformedOrphansRefusalMessage as ci, noEchoParameterValueSeed as cn, recordMaskOnlyValuesIn as co, applyRoleArnIfSet as cr, getDockerCmd as cs, displacedOpClause as ct, conditionInputsFrom as d, coerceWarmThroughput as da, malformedOutputsWarning as di, isExportAliasCollision as dn, wholeStringLeavesOf as do, explicitRoleArnOrThrow as dr, partitionSensitiveEnv as ds, getNestedRevertRun as dt, unwrittenCreateOnlyReplacement as ea, ownValue as ec, malformedExportNamesWarning as ei, WITHHELD_NAME_DISPLAY as en, DYNAMIC_REFERENCE_TOKEN_SCAN as eo, reDisableInstanceApiTermination as er, buildDockerImage as es, deleteJournaledOrphans as et, parentSuppliedValues as f, isWarmThroughputDecrease as fa, malformedRenderedContainersWarning as fi, bindingSkippedOutputs as fn, STATE_SOURCED_BASELINE_RULES as fo, isIamRoleArn as fr, redactDockerArgvValues as fs, nestedChildStackName as ft, mergeNoChangeOutputs as g, coerceCfnInteger as ga, malformedScrubResourceEntriesRefusalMessage as gi, constructPathOf as gn, WHOLE_DYNAMIC_REFERENCE_PATTERN as go, callerEnvCredentials as gr, warnFinchArgvExposure as gs, withNestedRevertRun as gt, keptWholeReasonText as h, coerceCfnBoolean as ha, malformedResourcesWarning as hi, maskingRetryLogger as hn, TEMPLATE_SOURCED_RULES as ho, applyCallerIdentityCredentials as hr, runDockerStreaming as hs, revertedNestedRowIds as ht, childTemplateLoader as i, findReplacedReadersOfRecreateTargets as ia, renderAssemblyPathEscape as ic, malformedLocalResourcesWarning as ii, secretBearingStateKeyWarning as in, identityKeyFor as io, IntrinsicFunctionResolver as ir, describeDockerFailure as is, sameJournaledOrphans as it, resolveDynamoDbDeleteBudgetMs as j, sameLambdaFunctionAddress as ja, refuseMalformedResourceEntriesForDestroy as ji, tagPlanWarning as jn, isReadableBag as jo, isNamelessDynamicReferenceError as jr, resolveStateBucketWithDefaultAndSource as js, replacementNeverSwapped as jt, deleteBudgetKey as k, canonicalLambdaFunctionName as ka, refuseMalformedResourceEntries as ki, refuseMalformedDesiredTags as kn, importableOutputKeys as ko, carriesDynamicReference as kr, resolveSkipPrefix as ks, planFailedOps as kt, templateIdentity as l, renderStatefulReason as la, malformedOrphansWarning as li, collectDeclaredOutputNames as ln, recordNoEchoAttributeValues as lo, assertFlagRoleArn as lr, isDockerClientEnvKey as ls, displacedPhysicalIdShown as lt, isSecretBearingReferenceString as m, toFiniteNumber as ma, malformedResourcePropertiesWarning as mi, DEFAULT_RESOURCE_WARN_AFTER_MS as mn, STATE_SOURCED_READBACK_RULES as mo, AWS_CREDENTIAL_ENV_KEYS as mr, runDockerForeground as ms, revertNestedChildFromJournal as mt, IMPLICIT_DELETE_DEPENDENCIES as n, NO_CC_HANDLERS_REASON as na, describeFileReadFailure as nc, malformedLocalOutputsWarning as ni, exportAliasCollisionScrubWarning as nn, isUncertifiedBaselineMaskPosition as no, DiffCalculator as nr, describeDockerCapturedOutput as ns, journaledOrphanLines as nt, isAbsoluteAssetPath as o, MULTI_REGION_RECREATE_BLOCKED_TYPES as oa, clearBucketRegionCache as oc, malformedOrphanRecordsWarning as oi, exportNameSecretExposure as on, provenPublicValue as oo, producerRegionsFromState as or, finchSecretArgvRefusal as os, planOrphanAdoption as ot, readRecordedConditionVerdicts as p, toCfnInteger as pa, malformedResourceEntriesWarning as pi, DEFAULT_RESOURCE_TIMEOUT_MS as pn, STATE_SOURCED_CROSS_GENERATION_RULES as po, sendableAssumeRoleCommand as pr, redactedDockerCause as ps, recordDisplacedSkips as pt, green as q, errorCauseChain as qa, repairMalformedResourcePropertiesForReadOnly as qi, withIndeterminateGuard as qn, getBootstrapMarkerKey as qo, displayLogicalId as qr, AssemblyReader as qs, redactedDeleteAddressFields as qt, computeImplicitDeleteEdges as r, hasNoCloudControlHandlers as ra, displayAssemblyPath as rc, malformedLocalResourceEntriesWarning as ri, secretBearing as rn, pathCrossesDottedKey as ro, INTRINSIC_KEYS as rr, describeDockerExecFailure as rs, loadJournaledOrphans as rt, listNestedTemplateRows as s, isStatefulRecreateTargetForReplace as sa, resolveBucketRegion as sc, malformedOrphanRowsKeptWarning as si, isWholeDynamicReferenceValue as sn, recordMaskOnlyValue as so, regionLessSecretName as sr, formatDockerLoginError as ss, NESTED_PENDING_PARENT_REASON as st, DeployEngine as t, withoutSilentDropProperties as ta, absoluteAssemblyPathEscape as tc, malformedExportSourceWarning as ti, displayTextOrWithheld as tn, dynamicReferenceTokens as to, reEnableInstanceApiTermination as tr, resolveDockerContextDirectory as ts, isHandledOrphan as tt, conditionFingerprint as u, WARM_THROUGHPUT_MEMBERS as ua, malformedOutputsRefusalMessage as ui, collectPublishedOutputNames as un, recordProvenPublicExpression as uo, assertSendableRoleArn as ur, isMalformedEnvKey as us, dropSettledNestedJournals as ut, withResourceDeadline as v, configIntegerRefusal as va, previewableOrphanRecords as vi, formatDestructiveChange as vn, LockManager as vo, isSettledInstanceState as vr, stripControlChars as vs, withNestedStackContext as vt, readProtection as w, requireConfigString as wa, refuseMalformedOrphansForDestroy as wi, acquireIdempotencyToken as wn, describeRegionValueKind as wo, coerceParameterTypedValue as wr, getLegacyStateBucketName as ws, withStackRecords as wt, PROTECTION_PROPERTY_BY_TYPE as x, replayWarn as xa, refuseMalformedOrphanRecords as xi, ledgerForStack as xn, rebuildClientForBucketRegion as xo, s3BucketDualStackDomainName as xr, Synthesizer as xs, awaitInFlightSibling as xt, recordedProtectionEvidence as y, configStringRefusal as ya, refuseDivergentRecordRegionForDestroy as yi, RollbackInlinePolicyWriters as yn, isLockInfoExpired as yo, s3BucketArn as yr, AssetManifestLoader as ys, replayFailedOperations as yt, isTruthyCfnBoolean as z, hasMaskableValues as za, refuseMalformedResourcesForDeploy as zi, getCurrentResourceSecrets as zn, buildAssetRedirectMap as zo, parameterInputsFor as zr, findLargeInlineResources as zs, ccRoutedFinalSnapshotError as zt };
37734
+ //# sourceMappingURL=deploy-engine-C_Eg-RHm.js.map