@go-to-k/cdkd 0.296.12 → 0.296.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{asg-provider-DoaukzYL.js → asg-provider-eXsnCQh2.js} +4 -4
- package/dist/{asg-provider-DoaukzYL.js.map → asg-provider-eXsnCQh2.js.map} +1 -1
- package/dist/{logger-DAaB7GFO.js → aws-failure-text-BaWeCWRz.js} +45 -2
- package/dist/aws-failure-text-BaWeCWRz.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-CrYi7ta5.js → deploy-engine-Z_zHC0jz.js} +546 -483
- package/dist/deploy-engine-Z_zHC0jz.js.map +1 -0
- package/dist/{iam-policy-targets-elNafvpb.js → iam-policy-targets-BoZuWtxK.js} +43 -49
- package/dist/iam-policy-targets-BoZuWtxK.js.map +1 -0
- package/dist/{iam-role-provider-ClAgHnkh.js → iam-role-provider-BTYPRrDe.js} +4 -4
- package/dist/{iam-role-provider-ClAgHnkh.js.map → iam-role-provider-BTYPRrDe.js.map} +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/{neptune-provider-ppi8nIX-.js → neptune-provider-ZYVwKq6K.js} +4 -4
- package/dist/{neptune-provider-ppi8nIX-.js.map → neptune-provider-ZYVwKq6K.js.map} +1 -1
- package/dist/{program-epAinsMQ.js → program-CKV6Kn8Q.js} +150 -112
- package/dist/program-CKV6Kn8Q.js.map +1 -0
- package/dist/{provider-classes-D76dAHvV.js → provider-classes-Dz2gVtOZ.js} +131 -70
- package/dist/provider-classes-Dz2gVtOZ.js.map +1 -0
- package/dist/{rds-provider-V_uJHUSX.js → rds-provider-6YeZRRfW.js} +4 -4
- package/dist/{rds-provider-V_uJHUSX.js.map → rds-provider-6YeZRRfW.js.map} +1 -1
- package/dist/{version-B8WzrPJT.js → version-1NhJbqzi.js} +2 -2
- package/dist/{version-B8WzrPJT.js.map → version-1NhJbqzi.js.map} +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-CrYi7ta5.js.map +0 -1
- package/dist/iam-policy-targets-elNafvpb.js.map +0 -1
- package/dist/logger-DAaB7GFO.js.map +0 -1
- package/dist/program-epAinsMQ.js.map +0 -1
- package/dist/provider-classes-D76dAHvV.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as getAwsClients, s as __exportAll } from "./aws-clients-CnmtbrxD.js";
|
|
2
|
-
import { A as
|
|
3
|
-
import { $
|
|
2
|
+
import { A as UNRENDERABLE, C as looksLikeCdkdGeneratedName, E as withoutGeneratedFallbackName, F as displayStackName, I as isPasteableIdent, M as displayAwsMessage, N as displayIdent, O as SECRET_REF_MAX_CODE_POINTS, P as displaySafe, R as plainIdentOr, S as getCurrentStackName, T as withStackName, V as truncateCodePoints, a as getLogger, b as generateResourceNameWithFallback, d as installLogLineMaskerSource, f as getLiveRenderer, g as applyDefaultNameForFallback, k as STACK_REF_MAX_CODE_POINTS, o as isStdoutReservedForPayload, r as safeStringify$1, t as describeAwsFailure, u as currentLogLineMasker, v as explicitNamePropertyFor, w as withSkipPrefix, x as getCurrentSkipPrefix, y as generateResourceName, z as safeMsg } from "./aws-failure-text-BaWeCWRz.js";
|
|
3
|
+
import { $ as protectedReplacementAdvice, $n as isIamPropagationError, $t as AccountIdUnavailableError, A as isQuotableImportValue, An as commandHole, At as isAuxiliaryMarkOf, B as isTerminalDeleteFailure, Bt as sanitizeRecoveryValue, Ct as RETRY_AUXILIARY_OWNER, Dn as SHELL_ACTIVE, Dt as createdResourceIdentityBeforeFailure, E as assertRegionMatch, Et as createdBeforeFailure, F as resolveExplicitPhysicalId, Fn as plainOrDescribed, G as runDeleteAttempt, Gn as isNameCooldownError, H as observeThenDisableProtection, Hn as isUpdateUnsupportedError, Ht as DEFAULT_STATE_PREFIX, In as quotedOrDescribed, J as DELETION_PROTECTION_DOC_POINTER, Jt as withPasteableAwsProfile, Kn as isRecreateRetryableError, Kt as producerRecordKey, L as ProtectionFlipRegistry, Ln as shellBoundedDisplay, Lt as formatLockExpiry, M as quotedRemedyLogicalId, Mn as isInertUnquoted, Mt as markCreatedBeforeFailure, N as refusalTypeShown, Nn as pasteableCommand, Nt as UNREPRODUCIBLE_LOCK_CLAUSE, On as SHELL_ACTIVE_WHY, Ot as hasCreatedBeforeFailure, Pn as physicalIdShownBesideCommand, Pt as buildForceUnlockCommand, Q as pasteableAwsCommand, Qn as isAmbiguousOutcomeError, Qt as credentialFingerprint, R as compensateProtectionFlip, Rn as shellQuote, Rt as formatLockOperation, St as withDerivedNameMasks, T as RESOURCE_NOT_FOUND, U as protectionFlipKey, Un as hasReplayMayCollide, Ut as injectiveKey, Vt as CUSTOM_RESOURCE_RESPONSE_PREFIX, Wn as isNameCollisionErrorFrom, Xn as formatRetryClassificationSignals, Xt as ambientCredentialConfig, Yn as markReplayMayCollide, Yt as ambientClientDefaults, Zn as isAmbiguousCcHandlerErrorCode, Zt as clientDefaultsFor, _n as ResourceUpdateNotSupportedError, _t as createMaskedLogSinks, ar as isThrottlingError, at as startInterruptWatch, bn as StateError, bt as maskDeep, cr as wrapMaskedAwsError, ct as canonicalizeRoute53QueryName, d as prepareRemovalForUpdate, dn as MacroExpansionError, en as AssetError, er as isRetryableTransientError, f as removalWarning, fn as MalformedProducerRecordRefusalError, ft as logicalIdShown, gn as ResourceTimeoutError, gt as stateOrphanRecordRemedy, hn as ProvisioningError, ht as segmentAfterAnchor, i as holdsSecretDerivedEntry, in as DependencyError, ir as isMarkedNonRetryable, it as isInterruptedWaitError, j as normalizeAwsTagsToCfn, jt as markAuxiliaryFailure, kn as UNSHOWABLE_VALUE, kt as isAuxiliaryFailure, l as withUnchangedSecretPrincipalLists, m as withoutInjectedRemovals, mt as resourceTypeShown, nr as retryClassificationText, on as DynamicReferenceRegionAmbiguousError, or as markNonRetryable, ot as ElapsedBudgetRegistry, qn as isReplayedNameCollisionFrom, rn as CrossAccountSecretRefusalError, sn as IntrinsicResolutionRefusalError, sr as markRedactedCause, st as monotonicNowMs, tn as CdkdError, tr as isTransientServerError, un as LockError, ut as compositeIdSeparatorRefusal, vt as createMaskedRetryLogger, w as withoutServerErrorRetries, wn as normalizeAwsError, wt as carryCreatedBeforeFailure, xn as SynthesisError, xt as maskerOrIdentity, yt as isSecretDerivedValue, z as deleteWithProtectionCompensation, zn as withheldTargetClause, zt as formatLockOwner } from "./iam-policy-targets-BoZuWtxK.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-
|
|
5
|
+
import { t as getCdkdVersion } from "./version-1NhJbqzi.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";
|
|
@@ -1279,7 +1279,7 @@ var ContextProviderRegistry = class {
|
|
|
1279
1279
|
results[entry.key] = value;
|
|
1280
1280
|
this.logger.debug(`Resolved context: ${shownKey}`);
|
|
1281
1281
|
} catch (error) {
|
|
1282
|
-
const message = displayAwsMessage(
|
|
1282
|
+
const message = displayAwsMessage(describeAwsFailure(error).detail);
|
|
1283
1283
|
this.logger.error(`Context provider '${shownProvider}' failed: ${message}`);
|
|
1284
1284
|
results[entry.key] = {
|
|
1285
1285
|
[PROVIDER_ERROR_KEY]: message,
|
|
@@ -1493,7 +1493,7 @@ function resolveExpectedBucketOwner(client) {
|
|
|
1493
1493
|
secretAccessKey: credentials.secretAccessKey
|
|
1494
1494
|
});
|
|
1495
1495
|
} catch (error) {
|
|
1496
|
-
getLogger().debug(`ExpectedBucketOwner resolution skipped (header omitted): ${
|
|
1496
|
+
getLogger().debug(`ExpectedBucketOwner resolution skipped (header omitted): ${safeStringify$1(error)}`);
|
|
1497
1497
|
clientCache.delete(client);
|
|
1498
1498
|
return;
|
|
1499
1499
|
}
|
|
@@ -1510,7 +1510,7 @@ async function recordResolvedAccountId(client, accountId) {
|
|
|
1510
1510
|
if (credentialsCache.has(accessKeyId)) return;
|
|
1511
1511
|
credentialsCache.set(accessKeyId, Promise.resolve(accountId));
|
|
1512
1512
|
} catch (error) {
|
|
1513
|
-
getLogger().debug(`ExpectedBucketOwner seed skipped: ${
|
|
1513
|
+
getLogger().debug(`ExpectedBucketOwner seed skipped: ${safeStringify$1(error)}`);
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
|
1516
1516
|
async function expectedOwnerParam(client) {
|
|
@@ -1674,7 +1674,7 @@ function recordFailure(failed, key, reason) {
|
|
|
1674
1674
|
if (existing) existing.push(reason);
|
|
1675
1675
|
else failed.set(key, [reason]);
|
|
1676
1676
|
}
|
|
1677
|
-
const describe$1 = (error) =>
|
|
1677
|
+
const describe$1 = (error) => describeAwsFailure(error).detail;
|
|
1678
1678
|
const PREFIX_HANDLE_SUFFIX = "* (every key under this prefix)";
|
|
1679
1679
|
async function purgeNoncurrentVersionsUnderPrefix(s3Client, bucket, prefix, options = {}) {
|
|
1680
1680
|
const logger = options.logger ?? getLogger().child("s3-version-purge");
|
|
@@ -2159,7 +2159,7 @@ function parseTemplateBody(body) {
|
|
|
2159
2159
|
return parsed;
|
|
2160
2160
|
}
|
|
2161
2161
|
function formatErr(err) {
|
|
2162
|
-
return displayAwsMessage(
|
|
2162
|
+
return displayAwsMessage(describeAwsFailure(err).detail);
|
|
2163
2163
|
}
|
|
2164
2164
|
|
|
2165
2165
|
//#endregion
|
|
@@ -4113,7 +4113,7 @@ var AssetModeResolver = class {
|
|
|
4113
4113
|
marker
|
|
4114
4114
|
};
|
|
4115
4115
|
} catch (error) {
|
|
4116
|
-
const message =
|
|
4116
|
+
const message = describeAwsFailure(error).detail;
|
|
4117
4117
|
this.logger.warn(`Failed to auto-create cdkd asset storage for region ${quotedIfPlain(region, "that is not a plain identifier")}: ${message} Falling back to the CDK bootstrap destinations for this run — opt the region in with S3/ECR create permissions.\nBootstrap with: ${pasteableCommand("cdkd bootstrap", [{
|
|
4118
4118
|
flag: "--region",
|
|
4119
4119
|
value: region,
|
|
@@ -4445,7 +4445,7 @@ var WorkGraph = class {
|
|
|
4445
4445
|
nodeId: node.id,
|
|
4446
4446
|
error
|
|
4447
4447
|
});
|
|
4448
|
-
this.logger.error(`Failed: ${node.id}: ${
|
|
4448
|
+
this.logger.error(`Failed: ${node.id}: ${describeAwsFailure(error).detail}`);
|
|
4449
4449
|
}).finally(() => {
|
|
4450
4450
|
active[node.type]--;
|
|
4451
4451
|
dispatch();
|
|
@@ -4459,7 +4459,7 @@ var WorkGraph = class {
|
|
|
4459
4459
|
}
|
|
4460
4460
|
if (errors.length > 0) {
|
|
4461
4461
|
const skippedCount = [...this.nodes.values()].filter((n) => n.state === "skipped").length;
|
|
4462
|
-
const msg = errors.map((e) => ` - ${e.nodeId}: ${
|
|
4462
|
+
const msg = errors.map((e) => ` - ${e.nodeId}: ${describeAwsFailure(e.error).detail}`).join("\n");
|
|
4463
4463
|
reject(/* @__PURE__ */ new Error(`${errors.length} node(s) failed${skippedCount > 0 ? `, ${skippedCount} skipped` : ""}:\n${msg}`));
|
|
4464
4464
|
return;
|
|
4465
4465
|
}
|
|
@@ -9744,6 +9744,7 @@ var ReplacementRulesRegistry = class {
|
|
|
9744
9744
|
"TaskRoleArn",
|
|
9745
9745
|
"Volumes"
|
|
9746
9746
|
]) });
|
|
9747
|
+
this.rules.set("AWS::ElasticLoadBalancingV2::ListenerRule", { replacementProperties: /* @__PURE__ */ new Set(["ListenerArn"]) });
|
|
9747
9748
|
this.logger.debug(`Initialized replacement rules for ${this.rules.size} resource types`);
|
|
9748
9749
|
}
|
|
9749
9750
|
};
|
|
@@ -10909,6 +10910,14 @@ const CASE_INSENSITIVE_NAME_TYPES = /* @__PURE__ */ new Set([
|
|
|
10909
10910
|
"AWS::RDS::DBSubnetGroup"
|
|
10910
10911
|
]);
|
|
10911
10912
|
const ASCII_CASE_INSENSITIVE_NAME_TYPES = /* @__PURE__ */ new Set(["AWS::Glue::Table"]);
|
|
10913
|
+
function physicalIdKey(resourceType, physicalId) {
|
|
10914
|
+
if (CASE_INSENSITIVE_NAME_TYPES.has(resourceType)) return physicalId.toLowerCase();
|
|
10915
|
+
if (ASCII_CASE_INSENSITIVE_NAME_TYPES.has(resourceType)) return physicalId.replace(/[A-Z]/g, (c) => c.toLowerCase());
|
|
10916
|
+
return physicalId;
|
|
10917
|
+
}
|
|
10918
|
+
function samePhysicalId(resourceType, a, b) {
|
|
10919
|
+
return physicalIdKey(resourceType, a) === physicalIdKey(resourceType, b);
|
|
10920
|
+
}
|
|
10912
10921
|
const NO_PHYSICAL_ID_NAME_PROOF = /* @__PURE__ */ new Set(["AWS::Glue::Table"]);
|
|
10913
10922
|
const GENERATED_NAME_VERBATIM = /* @__PURE__ */ new Set([
|
|
10914
10923
|
"AWS::CloudWatch::Alarm",
|
|
@@ -11921,20 +11930,30 @@ async function findReplacedReadersOfRecreateTargets(input) {
|
|
|
11921
11930
|
let pending = schemaCreateOnly.get(type);
|
|
11922
11931
|
if (!pending) {
|
|
11923
11932
|
pending = (async () => {
|
|
11924
|
-
const whole = (await getCreateOnlyPropertyPaths(type)).filter((path) => path.length === 1).map((path) => path[0]);
|
|
11925
|
-
if (whole.
|
|
11933
|
+
const whole = new Set((await getCreateOnlyPropertyPaths(type)).filter((path) => path.length === 1).map((path) => path[0]));
|
|
11934
|
+
if (whole.size === 0) return {
|
|
11935
|
+
whole,
|
|
11936
|
+
confirmable: whole
|
|
11937
|
+
};
|
|
11926
11938
|
const writeOnly = await tryGetTopLevelWriteOnlyProperties(type);
|
|
11927
|
-
if (writeOnly === void 0) return
|
|
11928
|
-
|
|
11939
|
+
if (writeOnly === void 0) return {
|
|
11940
|
+
whole,
|
|
11941
|
+
confirmable: /* @__PURE__ */ new Set()
|
|
11942
|
+
};
|
|
11943
|
+
return {
|
|
11944
|
+
whole,
|
|
11945
|
+
confirmable: new Set([...whole].filter((key) => !writeOnly.has(key)))
|
|
11946
|
+
};
|
|
11929
11947
|
})();
|
|
11930
11948
|
schemaCreateOnly.set(type, pending);
|
|
11931
11949
|
}
|
|
11932
11950
|
return pending;
|
|
11933
11951
|
};
|
|
11934
|
-
const isCreateOnly = async (type, key) => {
|
|
11952
|
+
const isCreateOnly = async (type, key, plainReference) => {
|
|
11935
11953
|
if (rules.requiresReplacement(type, key, void 0, void 0)) return true;
|
|
11936
11954
|
if (rules.isClassified(type, key)) return false;
|
|
11937
|
-
|
|
11955
|
+
const keys = await wholeCreateOnlyKeys(type);
|
|
11956
|
+
return plainReference ? keys.whole.has(key) : keys.confirmable.has(key);
|
|
11938
11957
|
};
|
|
11939
11958
|
const found = [];
|
|
11940
11959
|
const replaced = new Set(targets);
|
|
@@ -11949,7 +11968,8 @@ async function findReplacedReadersOfRecreateTargets(input) {
|
|
|
11949
11968
|
const properties = [];
|
|
11950
11969
|
for (const key of keys) {
|
|
11951
11970
|
if (stableTargets.has(replacedId) && idOnly.get(replacedId)?.get(readerId)?.has(key)) continue;
|
|
11952
|
-
|
|
11971
|
+
const plain = isPlainReferenceTo(resource.Properties?.[key], replacedId, resources[replacedId]?.Type);
|
|
11972
|
+
if (await isCreateOnly(resource.Type, key, plain)) properties.push(key);
|
|
11953
11973
|
}
|
|
11954
11974
|
if (properties.length === 0) continue;
|
|
11955
11975
|
replaced.add(readerId);
|
|
@@ -12006,6 +12026,18 @@ function recreateKeepsPhysicalId(resource, record) {
|
|
|
12006
12026
|
const name = properties[property];
|
|
12007
12027
|
return typeof name === "string" && name !== "" && record.physicalId === name;
|
|
12008
12028
|
}
|
|
12029
|
+
function isPlainReferenceTo(value, id, type) {
|
|
12030
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
12031
|
+
const keys = Object.keys(value);
|
|
12032
|
+
if (keys.length !== 1) return false;
|
|
12033
|
+
const obj = value;
|
|
12034
|
+
if (keys[0] === "Ref") return obj["Ref"] === id;
|
|
12035
|
+
if (keys[0] !== "Fn::GetAtt") return false;
|
|
12036
|
+
if (type === void 0 || type === "AWS::CloudFormation::CustomResource" || type === "AWS::CloudFormation::Stack" || type.startsWith("Custom::")) return false;
|
|
12037
|
+
const target = obj["Fn::GetAtt"];
|
|
12038
|
+
if (Array.isArray(target)) return target.length === 2 && target[0] === id && typeof target[1] === "string";
|
|
12039
|
+
return typeof target === "string" && target.startsWith(`${id}.`) && target.length > id.length + 1;
|
|
12040
|
+
}
|
|
12009
12041
|
function readsOnlyId(value, id) {
|
|
12010
12042
|
let other = false;
|
|
12011
12043
|
let ids = 0;
|
|
@@ -12138,6 +12170,10 @@ const CHILD_STORED_IN_PARENT = {
|
|
|
12138
12170
|
properties: ["GroupName"],
|
|
12139
12171
|
parentTypes: [IAM_GROUP]
|
|
12140
12172
|
},
|
|
12173
|
+
"AWS::ApplicationAutoScaling::ScalingPolicy": {
|
|
12174
|
+
properties: ["ScalingTargetId"],
|
|
12175
|
+
parentTypes: ["AWS::ApplicationAutoScaling::ScalableTarget"]
|
|
12176
|
+
},
|
|
12141
12177
|
"AWS::IAM::Policy": {
|
|
12142
12178
|
properties: [
|
|
12143
12179
|
"Roles",
|
|
@@ -21405,26 +21441,37 @@ var DiffCalculator = class DiffCalculator {
|
|
|
21405
21441
|
}
|
|
21406
21442
|
const types = candidateKeys.keys();
|
|
21407
21443
|
await Promise.all([...types].map(async (type) => {
|
|
21408
|
-
const
|
|
21409
|
-
|
|
21410
|
-
|
|
21411
|
-
|
|
21444
|
+
const whole = new Set((await getCreateOnlyPropertyPaths(type)).filter((path) => path.length === 1).map((path) => path[0]));
|
|
21445
|
+
if (![...candidateKeys.get(type)].some((key) => whole.has(key))) {
|
|
21446
|
+
loaded.set(type, {
|
|
21447
|
+
whole,
|
|
21448
|
+
unconfirmable: /* @__PURE__ */ new Set()
|
|
21449
|
+
});
|
|
21412
21450
|
return;
|
|
21413
21451
|
}
|
|
21414
21452
|
const writeOnly = await tryGetTopLevelWriteOnlyProperties(type);
|
|
21415
21453
|
if (writeOnly === void 0) {
|
|
21416
|
-
this.logger.debug(safeMsg`Write-only properties of ${type} unknown: no create-only replacement ceiling for its promoted readers`);
|
|
21417
|
-
loaded.set(type,
|
|
21454
|
+
this.logger.debug(safeMsg`Write-only properties of ${type} unknown: no create-only replacement ceiling for its promoted readers but a plain reference to a replaced resource`);
|
|
21455
|
+
loaded.set(type, {
|
|
21456
|
+
whole,
|
|
21457
|
+
unconfirmable: "all"
|
|
21458
|
+
});
|
|
21418
21459
|
return;
|
|
21419
21460
|
}
|
|
21420
|
-
loaded.set(type,
|
|
21461
|
+
loaded.set(type, {
|
|
21462
|
+
whole,
|
|
21463
|
+
unconfirmable: new Set([...whole].filter((key) => writeOnly.has(key)))
|
|
21464
|
+
});
|
|
21421
21465
|
}));
|
|
21422
21466
|
return loaded;
|
|
21423
21467
|
}
|
|
21424
|
-
syntheticRequiresReplacement(resourceType, propKey, syntheticCreateOnlyPaths) {
|
|
21468
|
+
syntheticRequiresReplacement(resourceType, propKey, syntheticCreateOnlyPaths, plainReference) {
|
|
21425
21469
|
if (this.replacementRules.requiresReplacement(resourceType, propKey, void 0, void 0)) return true;
|
|
21426
21470
|
if (this.replacementRules.isClassified(resourceType, propKey)) return false;
|
|
21427
|
-
|
|
21471
|
+
const createOnly = syntheticCreateOnlyPaths.get(resourceType);
|
|
21472
|
+
if (createOnly === void 0 || !createOnly.whole.has(propKey)) return false;
|
|
21473
|
+
if (plainReference) return true;
|
|
21474
|
+
return createOnly.unconfirmable !== "all" && !createOnly.unconfirmable.has(propKey);
|
|
21428
21475
|
}
|
|
21429
21476
|
promoteReplacementDependents(changes, desiredTemplate, syntheticCreateOnlyPaths, forcedReplacements) {
|
|
21430
21477
|
const queue = [];
|
|
@@ -21468,7 +21515,7 @@ var DiffCalculator = class DiffCalculator {
|
|
|
21468
21515
|
oldValue,
|
|
21469
21516
|
newValue,
|
|
21470
21517
|
replacementPropagated: true,
|
|
21471
|
-
requiresReplacement: this.syntheticRequiresReplacement(change.resourceType, propKey, syntheticCreateOnlyPaths) || namesRecreatedParent(change.resourceType, propKey, changes.get(replacedId)?.resourceType)
|
|
21518
|
+
requiresReplacement: this.syntheticRequiresReplacement(change.resourceType, propKey, syntheticCreateOnlyPaths, isPlainReferenceTo(desiredTemplate.Resources[dependentId]?.Properties?.[propKey], replacedId, desiredTemplate.Resources[replacedId]?.Type)) || namesRecreatedParent(change.resourceType, propKey, changes.get(replacedId)?.resourceType)
|
|
21472
21519
|
});
|
|
21473
21520
|
}
|
|
21474
21521
|
if (syntheticChanges.length === 0) continue;
|
|
@@ -21543,7 +21590,7 @@ var DiffCalculator = class DiffCalculator {
|
|
|
21543
21590
|
path: propKey,
|
|
21544
21591
|
oldValue: change.currentProperties?.[propKey],
|
|
21545
21592
|
newValue: change.desiredProperties?.[propKey],
|
|
21546
|
-
requiresReplacement: this.syntheticRequiresReplacement(change.resourceType, propKey, syntheticCreateOnlyPaths),
|
|
21593
|
+
requiresReplacement: this.syntheticRequiresReplacement(change.resourceType, propKey, syntheticCreateOnlyPaths, false),
|
|
21547
21594
|
inPlacePropagated: true,
|
|
21548
21595
|
...noEchoPromoted && { noEchoPromoted: true }
|
|
21549
21596
|
});
|
|
@@ -22665,7 +22712,7 @@ var CloudControlProvider = class {
|
|
|
22665
22712
|
const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
|
|
22666
22713
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
22667
22714
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
22668
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
22715
|
+
const { ASGProvider } = await import("./asg-provider-eXsnCQh2.js");
|
|
22669
22716
|
const delegateRegion = ambientRegion();
|
|
22670
22717
|
let asgProvider = this.asgDeleteDelegates.get(delegateRegion);
|
|
22671
22718
|
if (asgProvider === void 0) {
|
|
@@ -22771,7 +22818,7 @@ var CloudControlProvider = class {
|
|
|
22771
22818
|
const family = SDK_DELETE_FAMILIES.get(resourceType);
|
|
22772
22819
|
const cached = this.sdkDeleteDelegates.get(family);
|
|
22773
22820
|
if (cached !== void 0 && cached.region === ccRegion) return cached.provider;
|
|
22774
|
-
const provider = family === "rds" ? new (await (import("./rds-provider-
|
|
22821
|
+
const provider = family === "rds" ? new (await (import("./rds-provider-6YeZRRfW.js"))).RDSProvider({ region: ccRegion }) : new (await (import("./neptune-provider-ZYVwKq6K.js"))).NeptuneProvider({ region: ccRegion });
|
|
22775
22822
|
this.sdkDeleteDelegates.set(family, {
|
|
22776
22823
|
region: ccRegion,
|
|
22777
22824
|
provider
|
|
@@ -27862,7 +27909,7 @@ var DeploymentEventsStore = class {
|
|
|
27862
27909
|
}
|
|
27863
27910
|
enqueueWrite(op) {
|
|
27864
27911
|
const next = this.writeChain.then(op).catch((err) => {
|
|
27865
|
-
this.warnOnce(`Failed to persist deployment events for run ${this.runId}: ${
|
|
27912
|
+
this.warnOnce(`Failed to persist deployment events for run ${this.runId}: ${describeAwsFailure(err).detail}`);
|
|
27866
27913
|
});
|
|
27867
27914
|
this.writeChain = next;
|
|
27868
27915
|
return next;
|
|
@@ -27883,7 +27930,7 @@ var DeploymentEventsStore = class {
|
|
|
27883
27930
|
if (Array.isArray(parsed.runs)) return parsed.runs;
|
|
27884
27931
|
}
|
|
27885
27932
|
} catch (err) {
|
|
27886
|
-
this.logger.debug(`Deployment-events index unreadable, rewriting: ${
|
|
27933
|
+
this.logger.debug(`Deployment-events index unreadable, rewriting: ${describeAwsFailure(err).detail}`);
|
|
27887
27934
|
}
|
|
27888
27935
|
return [];
|
|
27889
27936
|
}
|
|
@@ -29270,7 +29317,7 @@ function classifyFailedOp(op, stateResources, siblings = []) {
|
|
|
29270
29317
|
if (op.physicalIdRecoveredFromError === false) return "skip-failed-superseded";
|
|
29271
29318
|
if (op.physicalIdRecoveredFromError === true) {
|
|
29272
29319
|
if (current) {
|
|
29273
|
-
if (current.physicalId === op.physicalId) return "skip-failed-noop";
|
|
29320
|
+
if (current.physicalId === op.physicalId || current.resourceType === op.resourceType && typeof current.physicalId === "string" && samePhysicalId(op.resourceType, current.physicalId, op.physicalId)) return "skip-failed-noop";
|
|
29274
29321
|
if (!isReplacedRecord(op, current) && !isProvenDistinctRecord(op, current)) return "skip-failed-mismatch";
|
|
29275
29322
|
}
|
|
29276
29323
|
if (stateHoldsPhysicalId(stateResources, op.resourceType, op.physicalId)) return "skip-failed-noop";
|
|
@@ -29321,14 +29368,14 @@ function replacedResourceDeleted(op, siblings) {
|
|
|
29321
29368
|
return siblings.some((s) => s !== op && isReplacementOrphan(s) && s.logicalId === op.logicalId && s.replacedPhysicalId === op.physicalId && s.replacedResourceDeleted === true);
|
|
29322
29369
|
}
|
|
29323
29370
|
function stateHoldsPhysicalId(stateResources, resourceType, physicalId) {
|
|
29324
|
-
return Object.values(stateResources).some((r) => r?.resourceType === resourceType && r.physicalId === physicalId);
|
|
29371
|
+
return Object.values(stateResources).some((r) => r?.resourceType === resourceType && typeof r.physicalId === "string" && samePhysicalId(resourceType, r.physicalId, physicalId));
|
|
29325
29372
|
}
|
|
29326
29373
|
function demoteSupersededOrphans(segments, orphans = []) {
|
|
29327
29374
|
let demoted = 0;
|
|
29328
29375
|
segments.forEach((segment, s) => {
|
|
29329
29376
|
for (const op of segment.failedOperations ?? []) {
|
|
29330
29377
|
if (op.changeType !== "CREATE" || op.physicalIdRecoveredFromError !== true) continue;
|
|
29331
|
-
if (segments.slice(s + 1).some((t) => (t.operations ?? []).some((o) => mayOwn(o, op, true)) || (t.failedOperations ?? []).some((o) => mayOwn(o, op, false))) || segments.slice(s).some((t) => t.supersededLogicalIds?.includes(op.logicalId) === true) || orphans.some((o) => o?.logicalId === op.logicalId || o?.state?.resourceType === op.resourceType && o.state?.physicalId
|
|
29378
|
+
if (segments.slice(s + 1).some((t) => (t.operations ?? []).some((o) => mayOwn(o, op, true)) || (t.failedOperations ?? []).some((o) => mayOwn(o, op, false))) || segments.slice(s).some((t) => t.supersededLogicalIds?.includes(op.logicalId) === true) || orphans.some((o) => o?.logicalId === op.logicalId || o?.state?.resourceType === op.resourceType && holdsSameId(op.resourceType, o.state?.physicalId, op.physicalId))) {
|
|
29332
29379
|
op.physicalIdRecoveredFromError = false;
|
|
29333
29380
|
demoted++;
|
|
29334
29381
|
}
|
|
@@ -29339,8 +29386,12 @@ function demoteSupersededOrphans(segments, orphans = []) {
|
|
|
29339
29386
|
function mayOwn(o, orphan, completed) {
|
|
29340
29387
|
if (o?.resourceType !== orphan.resourceType) return false;
|
|
29341
29388
|
if (completed && o.changeType === "CREATE") return true;
|
|
29342
|
-
if (o.physicalId
|
|
29343
|
-
return o.previousState?.physicalId
|
|
29389
|
+
if (holdsSameId(orphan.resourceType, o.physicalId, orphan.physicalId)) return true;
|
|
29390
|
+
return holdsSameId(orphan.resourceType, o.previousState?.physicalId, orphan.physicalId);
|
|
29391
|
+
}
|
|
29392
|
+
function holdsSameId(resourceType, held, orphanId) {
|
|
29393
|
+
if (typeof held !== "string" || typeof orphanId !== "string") return held === orphanId;
|
|
29394
|
+
return samePhysicalId(resourceType, held, orphanId);
|
|
29344
29395
|
}
|
|
29345
29396
|
function isJournaledOrphan(op) {
|
|
29346
29397
|
return op.changeType === "CREATE" && typeof op.physicalIdRecoveredFromError === "boolean";
|
|
@@ -29608,8 +29659,11 @@ async function replayDelete(s) {
|
|
|
29608
29659
|
provisionedBy: deleteProvisionedBy
|
|
29609
29660
|
});
|
|
29610
29661
|
const createRollbackClaimed = inlinePolicyWriters.claimedFor(op.resourceType, op.logicalId, stateResources);
|
|
29611
|
-
const
|
|
29662
|
+
const removeProtection = ctx.removeProtection === true;
|
|
29663
|
+
const physicalId = op.physicalId;
|
|
29664
|
+
const deleteCreated = () => provider.delete(op.logicalId, physicalId, op.resourceType, op.properties, {
|
|
29612
29665
|
expectedRegion: ctx.region,
|
|
29666
|
+
...removeProtection && { removeProtection: true },
|
|
29613
29667
|
...createRollbackClaimed && { inlinePolicyClaimed: createRollbackClaimed },
|
|
29614
29668
|
...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
|
|
29615
29669
|
...ctx.skipFinalSnapshot === true && { skipFinalSnapshot: true },
|
|
@@ -29617,6 +29671,7 @@ async function replayDelete(s) {
|
|
|
29617
29671
|
recordedAttributes: stateResources[op.logicalId]?.attributes,
|
|
29618
29672
|
recordedNoEchoLeaves: stateResources[op.logicalId]?.noEchoLeaves
|
|
29619
29673
|
});
|
|
29674
|
+
const createRollbackDelete = removeProtection ? await runDeleteAttempt(true, deleteCreated) : await deleteCreated();
|
|
29620
29675
|
throwIfDeleteSkipped(createRollbackDelete, op.logicalId, op.physicalId, "while rolling back its CREATE", {
|
|
29621
29676
|
ctx,
|
|
29622
29677
|
stackName,
|
|
@@ -30005,7 +30060,7 @@ async function deleteMarkedRecreate(error, s) {
|
|
|
30005
30060
|
if (madeId === void 0) return false;
|
|
30006
30061
|
const shown = `${shownLogicalId(s.op.logicalId)} (${refusalResourceType(s.oldType)})`;
|
|
30007
30062
|
const id = s.mask(madeId);
|
|
30008
|
-
if (Object.values(s.stateResources).some((r) => r?.resourceType === s.oldType && r.physicalId === madeId)) return false;
|
|
30063
|
+
if (Object.values(s.stateResources).some((r) => r?.resourceType === s.oldType && typeof r.physicalId === "string" && samePhysicalId(s.oldType, r.physicalId, madeId))) return false;
|
|
30009
30064
|
if (s.deletionPolicy === "Retain" || s.deletionPolicy === "Snapshot") {
|
|
30010
30065
|
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`);
|
|
30011
30066
|
return false;
|
|
@@ -33279,6 +33334,439 @@ async function replayFailedOperations(...args) {
|
|
|
33279
33334
|
return await withProducerRegions(() => replayProducerRegionEvidence(args[3]), () => withStackRecords(replayStackRecordsView(args[1]), () => replayFailedOperationsUnbound(...args)));
|
|
33280
33335
|
}
|
|
33281
33336
|
|
|
33337
|
+
//#endregion
|
|
33338
|
+
//#region src/deployment/rollback-executor/journaled-orphans.ts
|
|
33339
|
+
const NONE = {
|
|
33340
|
+
segments: [],
|
|
33341
|
+
count: 0
|
|
33342
|
+
};
|
|
33343
|
+
async function loadJournaledOrphans(stateBackend, stackName, region, rollbackOrphans, logger, options = {}) {
|
|
33344
|
+
let segments;
|
|
33345
|
+
try {
|
|
33346
|
+
const journal = await stateBackend.loadRollbackJournal(stackName, region);
|
|
33347
|
+
if (!journal) return NONE;
|
|
33348
|
+
segments = journal.segments;
|
|
33349
|
+
} catch (err) {
|
|
33350
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
33351
|
+
logger.warn(safeMsg`Could not read the stack's rollback journal (${displaySafe(detail)}); ` + safeMsg`no resource it records for a failed CREATE is deleted, and ${options.unreadableOutcome ?? "a destroy that proceeds removes the journal with the state"}.`);
|
|
33352
|
+
return {
|
|
33353
|
+
...NONE,
|
|
33354
|
+
unreadable: true
|
|
33355
|
+
};
|
|
33356
|
+
}
|
|
33357
|
+
const physicalIdOnly = (ops) => ops.filter((op) => op.changeType !== "CREATE");
|
|
33358
|
+
const evidence = segments.map((segment) => options.deployRunId !== void 0 && segment.reason === "nested-pending-parent" && segment.runId === options.deployRunId ? {
|
|
33359
|
+
...segment,
|
|
33360
|
+
operations: physicalIdOnly(segment.operations)
|
|
33361
|
+
} : segment);
|
|
33362
|
+
const newer = options.newerOperations ?? [];
|
|
33363
|
+
if (newer.length > 0) evidence.push({ operations: physicalIdOnly(newer) });
|
|
33364
|
+
demoteSupersededOrphans(evidence, Array.isArray(rollbackOrphans) ? rollbackOrphans : []);
|
|
33365
|
+
const deployLogicalIds = new Set(newer.map((op) => op.logicalId));
|
|
33366
|
+
for (const segment of segments) if (options.deployRunId !== void 0 && segment.reason === "nested-pending-parent" && segment.runId === options.deployRunId) for (const op of segment.operations) deployLogicalIds.add(op.logicalId);
|
|
33367
|
+
const out = [];
|
|
33368
|
+
let count = 0;
|
|
33369
|
+
for (let s = segments.length - 1; s >= 0; s--) {
|
|
33370
|
+
const segment = segments[s];
|
|
33371
|
+
if (segment.reason === "nested-pending-parent") continue;
|
|
33372
|
+
const replay = splitImportedOps(segment.failedOperations ?? [], segment).replay;
|
|
33373
|
+
const ops = replay.filter(isJournaledOrphan);
|
|
33374
|
+
if (ops.length === 0) continue;
|
|
33375
|
+
const companions = replay.filter((op) => op.changeType === "UPDATE" && replacementNeverSwapped(op, ops));
|
|
33376
|
+
out.push({
|
|
33377
|
+
segment,
|
|
33378
|
+
ops,
|
|
33379
|
+
...companions.length > 0 && { companions }
|
|
33380
|
+
});
|
|
33381
|
+
count += ops.length;
|
|
33382
|
+
}
|
|
33383
|
+
return {
|
|
33384
|
+
segments: out,
|
|
33385
|
+
count,
|
|
33386
|
+
deployLogicalIds
|
|
33387
|
+
};
|
|
33388
|
+
}
|
|
33389
|
+
function journaledOrphanLines(orphans, logger) {
|
|
33390
|
+
return orphans.segments.flatMap(({ ops }) => ops.map((op) => ` - ${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}) ${displacedPhysicalIdShown(op, logger) ?? "a physical id"}`));
|
|
33391
|
+
}
|
|
33392
|
+
function dropFailedCommands(stackName, region, logicalIds) {
|
|
33393
|
+
const ids = [...new Set(logicalIds)];
|
|
33394
|
+
if (ids.length === 0) return void 0;
|
|
33395
|
+
const built = ids.map((id) => pasteableCommand("cdkd rollback", [
|
|
33396
|
+
{
|
|
33397
|
+
value: stackName,
|
|
33398
|
+
hole: "stack",
|
|
33399
|
+
opts: { plainIdent: true }
|
|
33400
|
+
},
|
|
33401
|
+
{
|
|
33402
|
+
flag: "--stack-region",
|
|
33403
|
+
value: region,
|
|
33404
|
+
hole: "region",
|
|
33405
|
+
opts: { plainIdent: true }
|
|
33406
|
+
},
|
|
33407
|
+
{
|
|
33408
|
+
flag: "--drop-failed",
|
|
33409
|
+
value: id,
|
|
33410
|
+
hole: "logical-id",
|
|
33411
|
+
opts: { plainIdent: true }
|
|
33412
|
+
}
|
|
33413
|
+
]));
|
|
33414
|
+
const idWithheld = built.some((b) => b.withheld.some((w) => w.hole === "logical-id"));
|
|
33415
|
+
return {
|
|
33416
|
+
intro: `If cdkd can never delete ${ids.length === 1 ? "it" : "one of them"} (a cause you cannot fix), check the resource by hand, then drop just its rollback-journal entry; every other entry is kept.` + withheldTargetClause(built[0], "stack", "cdkd rollback", "This stack's name") + withheldTargetClause(built[0], "region", "cdkd rollback", "This stack's region") + (idWithheld ? " A logical id that is not a plain identifier is not named in the command below; read it from the stack's rollback-journal.json (next to its state.json)." : ""),
|
|
33417
|
+
commands: built.map((b) => b.command)
|
|
33418
|
+
};
|
|
33419
|
+
}
|
|
33420
|
+
function dropFailedHint(stackName, region, logicalIds) {
|
|
33421
|
+
const hint = dropFailedCommands(stackName, region, logicalIds);
|
|
33422
|
+
if (hint === void 0) return "";
|
|
33423
|
+
return `\n${hint.intro}` + hint.commands.map((c) => `\nDrop with: ${c}`).join("");
|
|
33424
|
+
}
|
|
33425
|
+
function warnDropFailed(logger, stackName, region, logicalIds) {
|
|
33426
|
+
const hint = dropFailedCommands(stackName, region, logicalIds);
|
|
33427
|
+
if (hint === void 0) return;
|
|
33428
|
+
logger.warn(safeMsg`${hint.intro}`);
|
|
33429
|
+
for (const command of hint.commands) logger.warn(safeMsg`Drop with: ${command}`);
|
|
33430
|
+
}
|
|
33431
|
+
async function deleteJournaledOrphans(orphans, stateResources, stackName, ctx, options = {}) {
|
|
33432
|
+
const total = {
|
|
33433
|
+
failures: 0,
|
|
33434
|
+
warnings: 0,
|
|
33435
|
+
interrupted: false,
|
|
33436
|
+
handled: [],
|
|
33437
|
+
leftInPlace: 0,
|
|
33438
|
+
failedLogicalIds: []
|
|
33439
|
+
};
|
|
33440
|
+
const inlinePolicyWriters = new RollbackInlinePolicyWriters();
|
|
33441
|
+
const failedIds = total.failedLogicalIds;
|
|
33442
|
+
const record = ctx.recordEvent;
|
|
33443
|
+
const printing = journaledOrphanPrintingBag(orphans.segments.flatMap(({ ops, companions }) => [...companions ?? [], ...ops]), stateResources);
|
|
33444
|
+
const maskedCtx = record === void 0 ? ctx : {
|
|
33445
|
+
...ctx,
|
|
33446
|
+
recordEvent: (event) => record(maskEventTextWithBoundBags(event))
|
|
33447
|
+
};
|
|
33448
|
+
for (const { segment, ops: orphanOps, companions } of orphans.segments) {
|
|
33449
|
+
if (options.isInterrupted?.()) {
|
|
33450
|
+
total.interrupted = true;
|
|
33451
|
+
break;
|
|
33452
|
+
}
|
|
33453
|
+
const ops = [...companions ?? [], ...orphanOps];
|
|
33454
|
+
const replay = () => withPrintingSecrets(printing, () => withStackName(stackName, () => replayFailedOperations(ops, stateResources, stackName, maskedCtx, {
|
|
33455
|
+
emitEnvelope: false,
|
|
33456
|
+
inlinePolicyWriters,
|
|
33457
|
+
forDestroy: true,
|
|
33458
|
+
...options.isInterrupted && { isInterrupted: options.isInterrupted }
|
|
33459
|
+
})));
|
|
33460
|
+
const result = segment.skipPrefix === void 0 ? await replay() : await withSkipPrefix(segment.skipPrefix, replay);
|
|
33461
|
+
total.failures += result.failures;
|
|
33462
|
+
total.warnings += result.warnings;
|
|
33463
|
+
total.leftInPlace += result.leftInPlace;
|
|
33464
|
+
const pending = new Set(result.remainingFailedOps);
|
|
33465
|
+
for (const op of ops) if (!pending.has(op)) total.handled.push({
|
|
33466
|
+
segment,
|
|
33467
|
+
op
|
|
33468
|
+
});
|
|
33469
|
+
if (result.interrupted) {
|
|
33470
|
+
total.interrupted = true;
|
|
33471
|
+
break;
|
|
33472
|
+
}
|
|
33473
|
+
for (const op of orphanOps) if (pending.has(op)) failedIds.push(op.logicalId);
|
|
33474
|
+
}
|
|
33475
|
+
if (options.pointAtDrop !== false && failedIds.length > 0) {
|
|
33476
|
+
ctx.logger.warn(safeMsg`${failedIds.length} resource(s) a failed deploy of stack ${displayIdent(stackName)} created ` + "could not be deleted (see above); the rollback journal, their only record, keeps them for a re-run.");
|
|
33477
|
+
warnDropFailed(ctx.logger, stackName, ctx.region, failedIds);
|
|
33478
|
+
}
|
|
33479
|
+
return total;
|
|
33480
|
+
}
|
|
33481
|
+
async function settleJournaledOrphansOnSuccess(args) {
|
|
33482
|
+
const { stateBackend, stackName, region, stateResources, newerOperations, ctx, logger } = args;
|
|
33483
|
+
const stack = displayIdent(stackName);
|
|
33484
|
+
const newerIds = newerOperations.map((op) => op.logicalId);
|
|
33485
|
+
let orphans;
|
|
33486
|
+
try {
|
|
33487
|
+
orphans = await loadJournaledOrphans(stateBackend, stackName, region, args.rollbackOrphans, logger, {
|
|
33488
|
+
newerOperations,
|
|
33489
|
+
...args.deployRunId !== void 0 && { deployRunId: args.deployRunId },
|
|
33490
|
+
unreadableOutcome: "the successful deploy removes the journal"
|
|
33491
|
+
});
|
|
33492
|
+
} catch (err) {
|
|
33493
|
+
logger.warn(safeMsg`Could not act on the rollback journal of stack ${stack}: ${errorDetail(err)}. It is kept.`);
|
|
33494
|
+
await markSuperseded(stateBackend, stackName, region, newerIds);
|
|
33495
|
+
return {
|
|
33496
|
+
unaddressed: 1,
|
|
33497
|
+
keepJournal: true
|
|
33498
|
+
};
|
|
33499
|
+
}
|
|
33500
|
+
if (orphans.count === 0) return {
|
|
33501
|
+
unaddressed: 0,
|
|
33502
|
+
keepJournal: false
|
|
33503
|
+
};
|
|
33504
|
+
const all = orphans.segments.flatMap(({ segment, ops }) => ops.map((op) => ({
|
|
33505
|
+
segment,
|
|
33506
|
+
op
|
|
33507
|
+
})));
|
|
33508
|
+
let kept = all;
|
|
33509
|
+
let failedDeletes = [];
|
|
33510
|
+
let leftInPlace = 0;
|
|
33511
|
+
if (stateResources === void 0) logger.warn(safeMsg`The rollback journal of stack ${stack} records ${all.length} resource(s) a failed deploy ` + `created, but the stack's state cannot be read, so whether a record now owns them is unknown: none is deleted.`);
|
|
33512
|
+
else {
|
|
33513
|
+
logger.info(safeMsg`The rollback journal of stack ${stack} records ${all.length} resource(s) a failed deploy ` + `created that no state record holds; acting on them per their DeletionPolicy before the journal is removed:`);
|
|
33514
|
+
for (const line of journaledOrphanLines(orphans, logger)) logger.info(line);
|
|
33515
|
+
try {
|
|
33516
|
+
const { unreadable, tracked } = await applySuccessRule(orphans, stateResources, orphans.deployLogicalIds ?? /* @__PURE__ */ new Set(), args.foreignHolder, stack, logger, args.isInterrupted, ctx);
|
|
33517
|
+
const acting = {
|
|
33518
|
+
segments: orphans.segments.map(({ segment, ops }) => ({
|
|
33519
|
+
segment,
|
|
33520
|
+
ops: ops.filter((op) => !unreadable.has(op) && !tracked.has(op))
|
|
33521
|
+
})).filter(({ ops }) => ops.length > 0),
|
|
33522
|
+
count: orphans.count - unreadable.size - tracked.size
|
|
33523
|
+
};
|
|
33524
|
+
const writtenThisRun = [...orphans.deployLogicalIds ?? []].filter((id) => Object.prototype.hasOwnProperty.call(stateResources, id)).map((id) => stateResources[id]).filter((r) => r !== void 0 && r !== null && typeof r === "object");
|
|
33525
|
+
const outcome = await deleteJournaledOrphans(acting, { ...stateResources }, stackName, {
|
|
33526
|
+
...ctx,
|
|
33527
|
+
writtenThisRun
|
|
33528
|
+
}, {
|
|
33529
|
+
pointAtDrop: false,
|
|
33530
|
+
...args.isInterrupted && { isInterrupted: args.isInterrupted }
|
|
33531
|
+
});
|
|
33532
|
+
leftInPlace = outcome.leftInPlace;
|
|
33533
|
+
failedDeletes = outcome.failedLogicalIds;
|
|
33534
|
+
kept = all.filter(({ segment, op }) => unreadable.has(op) || !tracked.has(op) && !isHandledOrphan(outcome.handled, segment, op));
|
|
33535
|
+
} catch (err) {
|
|
33536
|
+
logger.warn(safeMsg`Acting on the journaled resources of stack ${stack} failed: ${errorDetail(err)}`);
|
|
33537
|
+
}
|
|
33538
|
+
}
|
|
33539
|
+
const keptOps = new Set(kept.map(({ op }) => op));
|
|
33540
|
+
const skipped = all.filter(({ op }) => !keptOps.has(op) && op.physicalIdRecoveredFromError === false).length;
|
|
33541
|
+
const clearedOrphans = all.filter(({ op }) => !keptOps.has(op));
|
|
33542
|
+
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) => ({
|
|
33543
|
+
segment,
|
|
33544
|
+
op
|
|
33545
|
+
})))];
|
|
33546
|
+
const stripCleared = cleared.length === 0 ? void 0 : async () => {
|
|
33547
|
+
try {
|
|
33548
|
+
await stateBackend.dropRollbackJournalFailedOperations(stackName, region, (op, segment) => isHandledOrphan(cleared, segment, op));
|
|
33549
|
+
} catch (err) {
|
|
33550
|
+
logger.warn(safeMsg`Failed to remove the settled entries from the rollback journal of stack ${stack}: ` + safeMsg`${errorDetail(err)}. A cdkd rollback or cdkd destroy could act on them again; run a ` + "successful cdkd deploy of the stack first, which settles them again.");
|
|
33551
|
+
}
|
|
33552
|
+
};
|
|
33553
|
+
if (kept.length === 0) return {
|
|
33554
|
+
unaddressed: skipped + leftInPlace,
|
|
33555
|
+
keepJournal: false,
|
|
33556
|
+
...stripCleared && { stripCleared }
|
|
33557
|
+
};
|
|
33558
|
+
const keptIds = new Set(kept.map(({ op }) => op.logicalId));
|
|
33559
|
+
const supersededIds = newerIds.filter((id) => !keptIds.has(id));
|
|
33560
|
+
const demoted = kept.filter(({ op }) => op.physicalIdRecoveredFromError === false);
|
|
33561
|
+
const reduce = () => stateBackend.reduceRollbackJournalToFailedOperations(stackName, region, (op, segment) => isHandledOrphan(kept, segment, op), supersededIds, (op, segment) => isHandledOrphan(demoted, segment, op));
|
|
33562
|
+
let reduced = false;
|
|
33563
|
+
for (let attempt = 0; attempt < 2 && !reduced; attempt++) try {
|
|
33564
|
+
await reduce();
|
|
33565
|
+
reduced = true;
|
|
33566
|
+
} catch (err) {
|
|
33567
|
+
if (attempt === 1) logger.warn(safeMsg`Failed to reduce the rollback journal of stack ${stack} to its undeleted resources: ` + safeMsg`${errorDetail(err)}. The whole journal is kept.`);
|
|
33568
|
+
}
|
|
33569
|
+
if (!reduced) {
|
|
33570
|
+
await markSuperseded(stateBackend, stackName, region, supersededIds);
|
|
33571
|
+
await stripCleared?.();
|
|
33572
|
+
}
|
|
33573
|
+
logger.warn(safeMsg`${kept.length} resource(s) a failed deploy of stack ${stack} created were not deleted ` + (reduced ? "(see above). The rollback journal, their only record, is kept with just them; the next " : "(see above). The rollback journal, their only record, is kept; the next ") + "successful deploy retries.");
|
|
33574
|
+
warnDropFailed(logger, stackName, region, failedDeletes);
|
|
33575
|
+
return {
|
|
33576
|
+
unaddressed: kept.length + skipped + leftInPlace,
|
|
33577
|
+
keepJournal: true
|
|
33578
|
+
};
|
|
33579
|
+
}
|
|
33580
|
+
async function applySuccessRule(orphans, stateResources, deployLogicalIds, foreignHolder, stack, logger, isInterrupted, identityCtx) {
|
|
33581
|
+
const unreadable = /* @__PURE__ */ new Set();
|
|
33582
|
+
const tracked = /* @__PURE__ */ new Set();
|
|
33583
|
+
let interrupted = false;
|
|
33584
|
+
for (const { ops } of orphans.segments) for (const op of ops) {
|
|
33585
|
+
if (op.physicalIdRecoveredFromError !== true || !op.physicalId) continue;
|
|
33586
|
+
if (interrupted || isInterrupted?.()) {
|
|
33587
|
+
interrupted = true;
|
|
33588
|
+
unreadable.add(op);
|
|
33589
|
+
continue;
|
|
33590
|
+
}
|
|
33591
|
+
const opId = op.physicalId;
|
|
33592
|
+
if (Object.values(stateResources).some((r) => r?.resourceType === op.resourceType && typeof r.physicalId === "string" && samePhysicalId(op.resourceType, r.physicalId, opId))) {
|
|
33593
|
+
tracked.add(op);
|
|
33594
|
+
continue;
|
|
33595
|
+
}
|
|
33596
|
+
const hasRecord = Object.prototype.hasOwnProperty.call(stateResources, op.logicalId);
|
|
33597
|
+
const record = hasRecord ? stateResources[op.logicalId] : void 0;
|
|
33598
|
+
const recordUnderId = hasRecord && !isReplacedRecord(op, record);
|
|
33599
|
+
if (recordUnderId || deployLogicalIds.has(op.logicalId)) {
|
|
33600
|
+
const verdict = recordUnderId ? await recordIdentity(op, record, identityCtx, logger) : "unknown";
|
|
33601
|
+
if (verdict === "same") {
|
|
33602
|
+
tracked.add(op);
|
|
33603
|
+
continue;
|
|
33604
|
+
}
|
|
33605
|
+
if (verdict !== "different") {
|
|
33606
|
+
op.physicalIdRecoveredFromError = false;
|
|
33607
|
+
continue;
|
|
33608
|
+
}
|
|
33609
|
+
markProvenDistinctFromRecord(op, record);
|
|
33610
|
+
}
|
|
33611
|
+
const holding = await foreignHolder(op.resourceType, op.physicalId);
|
|
33612
|
+
if (holding === void 0) {
|
|
33613
|
+
const created = await createdResourceStillThere(op, identityCtx);
|
|
33614
|
+
if (created === "gone") {
|
|
33615
|
+
logger.info(safeMsg`${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}), which a failed deploy ` + safeMsg`of stack ${stack} created, is already gone: nothing to delete.`);
|
|
33616
|
+
tracked.add(op);
|
|
33617
|
+
} else if (created === "mismatch") {
|
|
33618
|
+
logger.warn(safeMsg`${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}), which a failed deploy ` + safeMsg`of stack ${stack} created, is not deleted: the resource now under its physical id is another ` + "one (its identity differs from the one that deploy recorded, so its name was reused).");
|
|
33619
|
+
op.physicalIdRecoveredFromError = false;
|
|
33620
|
+
} else if (created === "unproven") {
|
|
33621
|
+
logger.warn(safeMsg`${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}), which a failed deploy ` + safeMsg`of stack ${stack} created, is not deleted: nothing proves the resource now under its physical ` + "id is the one that deploy created (it may have been deleted and its name reused).");
|
|
33622
|
+
op.physicalIdRecoveredFromError = false;
|
|
33623
|
+
}
|
|
33624
|
+
continue;
|
|
33625
|
+
}
|
|
33626
|
+
if (holding.kind === "held") {
|
|
33627
|
+
logger.warn(safeMsg`${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}), which a failed deploy ` + safeMsg`of stack ${stack} created, is not deleted: ${holding.by} holds a resource of that type under ` + "the same physical id.");
|
|
33628
|
+
op.physicalIdRecoveredFromError = false;
|
|
33629
|
+
continue;
|
|
33630
|
+
}
|
|
33631
|
+
logger.warn(safeMsg`${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}), which a failed deploy ` + safeMsg`of stack ${stack} created, is not deleted: ${holding.what}, so whether another stack holds it is unknown.`);
|
|
33632
|
+
unreadable.add(op);
|
|
33633
|
+
}
|
|
33634
|
+
return {
|
|
33635
|
+
unreadable,
|
|
33636
|
+
tracked
|
|
33637
|
+
};
|
|
33638
|
+
}
|
|
33639
|
+
async function recordIdentity(op, record, ctx, logger) {
|
|
33640
|
+
if (typeof record !== "object" || record === null || record.resourceType !== op.resourceType || typeof record.physicalId !== "string" || record.physicalId === "" || !op.physicalId) return "unknown";
|
|
33641
|
+
try {
|
|
33642
|
+
const { provider } = ctx.providerRegistry.getProviderFor({
|
|
33643
|
+
resourceType: op.resourceType,
|
|
33644
|
+
provisionedBy: op.provisionedBy
|
|
33645
|
+
});
|
|
33646
|
+
if (typeof provider.isSameResource !== "function") return "unknown";
|
|
33647
|
+
return await provider.isSameResource(op.physicalId, {
|
|
33648
|
+
physicalId: record.physicalId,
|
|
33649
|
+
...record.provisionedBy !== void 0 && { provisionedBy: record.provisionedBy }
|
|
33650
|
+
}, op.resourceType, { expectedRegion: ctx.region });
|
|
33651
|
+
} catch (err) {
|
|
33652
|
+
logger.debug(safeMsg`Could not compare ${logicalIdShown(op.logicalId)}'s journaled resource with its state record (${displaySafe(err instanceof Error ? err.name : typeof err)}).`);
|
|
33653
|
+
return "unknown";
|
|
33654
|
+
}
|
|
33655
|
+
}
|
|
33656
|
+
async function createdResourceStillThere(op, ctx) {
|
|
33657
|
+
if (op.deletionPolicy === "Retain") return "proven";
|
|
33658
|
+
if (!orphanDeleteNeedsIdentity(op.resourceType)) return "proven";
|
|
33659
|
+
const physicalId = op.physicalId;
|
|
33660
|
+
if (!physicalId) return "unproven";
|
|
33661
|
+
const live = await readResourceIdentity(ctx.providerRegistry, {
|
|
33662
|
+
resourceType: op.resourceType,
|
|
33663
|
+
physicalId,
|
|
33664
|
+
provisionedBy: op.provisionedBy
|
|
33665
|
+
}, ctx.region);
|
|
33666
|
+
if (live === RESOURCE_NOT_FOUND) return "gone";
|
|
33667
|
+
const journaled = op.createdResourceIdentity;
|
|
33668
|
+
if (typeof journaled !== "string" || journaled === "" || typeof live !== "string") return "unproven";
|
|
33669
|
+
return live === journaled ? "proven" : "mismatch";
|
|
33670
|
+
}
|
|
33671
|
+
function makeForeignHolderScan(stateBackend) {
|
|
33672
|
+
let scan;
|
|
33673
|
+
const key = (type, id) => JSON.stringify([type, physicalIdKey(type, id)]);
|
|
33674
|
+
const run = async () => {
|
|
33675
|
+
const holders = /* @__PURE__ */ new Map();
|
|
33676
|
+
let refs;
|
|
33677
|
+
try {
|
|
33678
|
+
refs = await stateBackend.listStacks();
|
|
33679
|
+
} catch {
|
|
33680
|
+
return {
|
|
33681
|
+
holders,
|
|
33682
|
+
unreadable: "the state bucket listing (it could not be read)"
|
|
33683
|
+
};
|
|
33684
|
+
}
|
|
33685
|
+
let unreadable;
|
|
33686
|
+
await Promise.all(refs.map(async (ref) => {
|
|
33687
|
+
const named = (why) => safeMsg`the state record of stack ${displayIdent(ref.stackName)} (${why})`;
|
|
33688
|
+
if (ref.region === void 0) {
|
|
33689
|
+
unreadable ??= named("its region cannot be read");
|
|
33690
|
+
return;
|
|
33691
|
+
}
|
|
33692
|
+
const region = ref.region;
|
|
33693
|
+
let state;
|
|
33694
|
+
try {
|
|
33695
|
+
state = (await stateBackend.getState(ref.stackName, region))?.state;
|
|
33696
|
+
} catch {
|
|
33697
|
+
unreadable ??= named("it could not be read");
|
|
33698
|
+
return;
|
|
33699
|
+
}
|
|
33700
|
+
if (state === void 0) return;
|
|
33701
|
+
const resources = state.resources;
|
|
33702
|
+
if (resources !== void 0 && (typeof resources !== "object" || resources === null || Array.isArray(resources))) {
|
|
33703
|
+
unreadable ??= named("its resources cannot be read");
|
|
33704
|
+
return;
|
|
33705
|
+
}
|
|
33706
|
+
if (!hasReadableOrphans(state) || unreadableOrphanRecords(state).length > 0) {
|
|
33707
|
+
unreadable ??= named("its rollback-orphan records cannot be read");
|
|
33708
|
+
return;
|
|
33709
|
+
}
|
|
33710
|
+
const held = [...Object.values(resources ?? {}), ...(state.orphans ?? []).map((record) => record.state)];
|
|
33711
|
+
for (const record of held) {
|
|
33712
|
+
const r = record;
|
|
33713
|
+
if (typeof r?.resourceType !== "string" || typeof r.physicalId !== "string") continue;
|
|
33714
|
+
const k = key(r.resourceType, r.physicalId);
|
|
33715
|
+
const list = holders.get(k) ?? [];
|
|
33716
|
+
list.push({
|
|
33717
|
+
stackName: ref.stackName,
|
|
33718
|
+
region
|
|
33719
|
+
});
|
|
33720
|
+
holders.set(k, list);
|
|
33721
|
+
}
|
|
33722
|
+
}));
|
|
33723
|
+
return {
|
|
33724
|
+
holders,
|
|
33725
|
+
...unreadable !== void 0 && { unreadable }
|
|
33726
|
+
};
|
|
33727
|
+
};
|
|
33728
|
+
return (self) => async (resourceType, physicalId) => {
|
|
33729
|
+
scan ??= run();
|
|
33730
|
+
const { holders, unreadable } = await scan;
|
|
33731
|
+
const other = (holders.get(key(resourceType, physicalId)) ?? []).find((h) => !(h.stackName === self.stackName && h.region === self.region));
|
|
33732
|
+
if (other) return {
|
|
33733
|
+
kind: "held",
|
|
33734
|
+
by: safeMsg`the state record of stack ${displayIdent(other.stackName)} (${displaySafe(other.region)})`
|
|
33735
|
+
};
|
|
33736
|
+
return unreadable === void 0 ? void 0 : {
|
|
33737
|
+
kind: "unreadable",
|
|
33738
|
+
what: unreadable
|
|
33739
|
+
};
|
|
33740
|
+
};
|
|
33741
|
+
}
|
|
33742
|
+
async function markSuperseded(stateBackend, stackName, region, ids) {
|
|
33743
|
+
try {
|
|
33744
|
+
await stateBackend.markRollbackJournalSuperseded(stackName, region, ids);
|
|
33745
|
+
} catch {}
|
|
33746
|
+
}
|
|
33747
|
+
function errorDetail(err) {
|
|
33748
|
+
return displaySafe(err instanceof Error ? err.message : String(err));
|
|
33749
|
+
}
|
|
33750
|
+
function isHandledOrphan(handled, segment, op) {
|
|
33751
|
+
return handled.some((h) => h.segment.timestamp === segment.timestamp && h.segment.runId === segment.runId && h.op.logicalId === op.logicalId && h.op.changeType === op.changeType && h.op.resourceType === op.resourceType && h.op.physicalId === op.physicalId);
|
|
33752
|
+
}
|
|
33753
|
+
function orphanKey(segment, op) {
|
|
33754
|
+
return JSON.stringify([
|
|
33755
|
+
segment.timestamp,
|
|
33756
|
+
segment.runId ?? null,
|
|
33757
|
+
op.logicalId,
|
|
33758
|
+
op.changeType,
|
|
33759
|
+
op.resourceType,
|
|
33760
|
+
op.physicalId ?? null
|
|
33761
|
+
]);
|
|
33762
|
+
}
|
|
33763
|
+
function sameJournaledOrphans(a, b) {
|
|
33764
|
+
const keys = (o) => o.segments.flatMap(({ segment, ops }) => ops.map((op) => orphanKey(segment, op))).sort();
|
|
33765
|
+
const ka = keys(a);
|
|
33766
|
+
const kb = keys(b);
|
|
33767
|
+
return ka.length === kb.length && ka.every((k, i) => k === kb[i]);
|
|
33768
|
+
}
|
|
33769
|
+
|
|
33282
33770
|
//#endregion
|
|
33283
33771
|
//#region src/provisioning/nested-stack-context.ts
|
|
33284
33772
|
const storage$1 = new AsyncLocalStorage();
|
|
@@ -33378,7 +33866,7 @@ function getNestedRevertRun() {
|
|
|
33378
33866
|
return revertRunStorage.getStore();
|
|
33379
33867
|
}
|
|
33380
33868
|
function errorText(error) {
|
|
33381
|
-
return displaySafe(
|
|
33869
|
+
return displaySafe(describeAwsFailure(error).detail);
|
|
33382
33870
|
}
|
|
33383
33871
|
function isPlainRecord(value) {
|
|
33384
33872
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -33551,6 +34039,13 @@ async function revertNestedChildFromJournal(args) {
|
|
|
33551
34039
|
...ctx.options?.eventRecorder && { recordEvent: (event) => ctx.options.eventRecorder.record(maskEventTextWithBoundBags(event)) },
|
|
33552
34040
|
finalSnapshotClients: ctx.options?.finalSnapshotClients,
|
|
33553
34041
|
skipFinalSnapshot: ctx.options?.skipFinalSnapshot === true || ctx.destroyOptions?.skipFinalSnapshot === true,
|
|
34042
|
+
...ctx.destroyOptions?.removeProtection === true && {
|
|
34043
|
+
removeProtection: true,
|
|
34044
|
+
foreignHolder: makeForeignHolderScan(ctx.stateBackend)({
|
|
34045
|
+
stackName: childStackName,
|
|
34046
|
+
region
|
|
34047
|
+
})
|
|
34048
|
+
},
|
|
33554
34049
|
importedProducerRegions: producerRegions.regions,
|
|
33555
34050
|
producerRegionsIncomplete: !producerRegions.complete,
|
|
33556
34051
|
nestedChildRevert: true
|
|
@@ -33635,7 +34130,7 @@ async function planOrphanAdoption(params) {
|
|
|
33635
34130
|
provider = params.getProvider(state.resourceType, state.provisionedBy);
|
|
33636
34131
|
} catch (error) {
|
|
33637
34132
|
outcome.remaining.push(record);
|
|
33638
|
-
outcome.notices.push(`${shownId} (${shownType}) is still in AWS as ${shownPhysicalId} from an earlier rollback, but this build cannot route that type (${displayAwsMessage(
|
|
34133
|
+
outcome.notices.push(`${shownId} (${shownType}) is still in AWS as ${shownPhysicalId} from an earlier rollback, but this build cannot route that type (${displayAwsMessage(describeAwsFailure(error).detail)}) — cdkd is not adopting it.`);
|
|
33639
34134
|
continue;
|
|
33640
34135
|
}
|
|
33641
34136
|
if (!provider.import) {
|
|
@@ -33654,7 +34149,7 @@ async function planOrphanAdoption(params) {
|
|
|
33654
34149
|
knownPhysicalId: state.physicalId
|
|
33655
34150
|
});
|
|
33656
34151
|
} catch (error) {
|
|
33657
|
-
outcome.notices.push(`${shownId} (${shownType}) is recorded as left in AWS as ${shownPhysicalId}, but cdkd could not confirm it exists (${displayAwsMessage(
|
|
34152
|
+
outcome.notices.push(`${shownId} (${shownType}) is recorded as left in AWS as ${shownPhysicalId}, but cdkd could not confirm it exists (${displayAwsMessage(describeAwsFailure(error).detail)}) — keeping the record and not adopting it this run.`);
|
|
33658
34153
|
outcome.remaining.push(record);
|
|
33659
34154
|
continue;
|
|
33660
34155
|
}
|
|
@@ -33707,7 +34202,7 @@ function makeSiblingClaimReader(params) {
|
|
|
33707
34202
|
try {
|
|
33708
34203
|
refs = await stateBackend.listStacks();
|
|
33709
34204
|
} catch (error) {
|
|
33710
|
-
logger.debug(`orphan adoption: could not list sibling stacks — ${displayAwsMessage(
|
|
34205
|
+
logger.debug(`orphan adoption: could not list sibling stacks — ${displayAwsMessage(describeAwsFailure(error).detail)}`);
|
|
33711
34206
|
return claimed;
|
|
33712
34207
|
}
|
|
33713
34208
|
for (const ref of refs) {
|
|
@@ -33733,445 +34228,13 @@ function makeSiblingClaimReader(params) {
|
|
|
33733
34228
|
logger.debug(safeMsg`orphan adoption: ${displayStackName(ref.stackName)} holds ${unreadable.length} ` + safeMsg`resource record(s) with no readable physical id — ${named}` + safeMsg`${rest > 0 ? ` and ${rest} more` : ""} — skipped; the claim set is a lower ` + `bound without them`);
|
|
33734
34229
|
}
|
|
33735
34230
|
} catch (error) {
|
|
33736
|
-
logger.debug(`orphan adoption: skipping unreadable state for ${displayStackName(ref.stackName)} — ${displayAwsMessage(
|
|
34231
|
+
logger.debug(`orphan adoption: skipping unreadable state for ${displayStackName(ref.stackName)} — ${displayAwsMessage(describeAwsFailure(error).detail)}`);
|
|
33737
34232
|
}
|
|
33738
34233
|
}
|
|
33739
34234
|
return claimed;
|
|
33740
34235
|
};
|
|
33741
34236
|
}
|
|
33742
34237
|
|
|
33743
|
-
//#endregion
|
|
33744
|
-
//#region src/deployment/rollback-executor/journaled-orphans.ts
|
|
33745
|
-
const NONE = {
|
|
33746
|
-
segments: [],
|
|
33747
|
-
count: 0
|
|
33748
|
-
};
|
|
33749
|
-
async function loadJournaledOrphans(stateBackend, stackName, region, rollbackOrphans, logger, options = {}) {
|
|
33750
|
-
let segments;
|
|
33751
|
-
try {
|
|
33752
|
-
const journal = await stateBackend.loadRollbackJournal(stackName, region);
|
|
33753
|
-
if (!journal) return NONE;
|
|
33754
|
-
segments = journal.segments;
|
|
33755
|
-
} catch (err) {
|
|
33756
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
33757
|
-
logger.warn(safeMsg`Could not read the stack's rollback journal (${displaySafe(detail)}); ` + safeMsg`no resource it records for a failed CREATE is deleted, and ${options.unreadableOutcome ?? "a destroy that proceeds removes the journal with the state"}.`);
|
|
33758
|
-
return {
|
|
33759
|
-
...NONE,
|
|
33760
|
-
unreadable: true
|
|
33761
|
-
};
|
|
33762
|
-
}
|
|
33763
|
-
const physicalIdOnly = (ops) => ops.filter((op) => op.changeType !== "CREATE");
|
|
33764
|
-
const evidence = segments.map((segment) => options.deployRunId !== void 0 && segment.reason === "nested-pending-parent" && segment.runId === options.deployRunId ? {
|
|
33765
|
-
...segment,
|
|
33766
|
-
operations: physicalIdOnly(segment.operations)
|
|
33767
|
-
} : segment);
|
|
33768
|
-
const newer = options.newerOperations ?? [];
|
|
33769
|
-
if (newer.length > 0) evidence.push({ operations: physicalIdOnly(newer) });
|
|
33770
|
-
demoteSupersededOrphans(evidence, Array.isArray(rollbackOrphans) ? rollbackOrphans : []);
|
|
33771
|
-
const deployLogicalIds = new Set(newer.map((op) => op.logicalId));
|
|
33772
|
-
for (const segment of segments) if (options.deployRunId !== void 0 && segment.reason === "nested-pending-parent" && segment.runId === options.deployRunId) for (const op of segment.operations) deployLogicalIds.add(op.logicalId);
|
|
33773
|
-
const out = [];
|
|
33774
|
-
let count = 0;
|
|
33775
|
-
for (let s = segments.length - 1; s >= 0; s--) {
|
|
33776
|
-
const segment = segments[s];
|
|
33777
|
-
if (segment.reason === "nested-pending-parent") continue;
|
|
33778
|
-
const replay = splitImportedOps(segment.failedOperations ?? [], segment).replay;
|
|
33779
|
-
const ops = replay.filter(isJournaledOrphan);
|
|
33780
|
-
if (ops.length === 0) continue;
|
|
33781
|
-
const companions = replay.filter((op) => op.changeType === "UPDATE" && replacementNeverSwapped(op, ops));
|
|
33782
|
-
out.push({
|
|
33783
|
-
segment,
|
|
33784
|
-
ops,
|
|
33785
|
-
...companions.length > 0 && { companions }
|
|
33786
|
-
});
|
|
33787
|
-
count += ops.length;
|
|
33788
|
-
}
|
|
33789
|
-
return {
|
|
33790
|
-
segments: out,
|
|
33791
|
-
count,
|
|
33792
|
-
deployLogicalIds
|
|
33793
|
-
};
|
|
33794
|
-
}
|
|
33795
|
-
function journaledOrphanLines(orphans, logger) {
|
|
33796
|
-
return orphans.segments.flatMap(({ ops }) => ops.map((op) => ` - ${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}) ${displacedPhysicalIdShown(op, logger) ?? "a physical id"}`));
|
|
33797
|
-
}
|
|
33798
|
-
function dropFailedCommands(stackName, region, logicalIds) {
|
|
33799
|
-
const ids = [...new Set(logicalIds)];
|
|
33800
|
-
if (ids.length === 0) return void 0;
|
|
33801
|
-
const built = ids.map((id) => pasteableCommand("cdkd rollback", [
|
|
33802
|
-
{
|
|
33803
|
-
value: stackName,
|
|
33804
|
-
hole: "stack",
|
|
33805
|
-
opts: { plainIdent: true }
|
|
33806
|
-
},
|
|
33807
|
-
{
|
|
33808
|
-
flag: "--stack-region",
|
|
33809
|
-
value: region,
|
|
33810
|
-
hole: "region",
|
|
33811
|
-
opts: { plainIdent: true }
|
|
33812
|
-
},
|
|
33813
|
-
{
|
|
33814
|
-
flag: "--drop-failed",
|
|
33815
|
-
value: id,
|
|
33816
|
-
hole: "logical-id",
|
|
33817
|
-
opts: { plainIdent: true }
|
|
33818
|
-
}
|
|
33819
|
-
]));
|
|
33820
|
-
const idWithheld = built.some((b) => b.withheld.some((w) => w.hole === "logical-id"));
|
|
33821
|
-
return {
|
|
33822
|
-
intro: `If cdkd can never delete ${ids.length === 1 ? "it" : "one of them"} (a cause you cannot fix), check the resource by hand, then drop just its rollback-journal entry; every other entry is kept.` + withheldTargetClause(built[0], "stack", "cdkd rollback", "This stack's name") + withheldTargetClause(built[0], "region", "cdkd rollback", "This stack's region") + (idWithheld ? " A logical id that is not a plain identifier is not named in the command below; read it from the stack's rollback-journal.json (next to its state.json)." : ""),
|
|
33823
|
-
commands: built.map((b) => b.command)
|
|
33824
|
-
};
|
|
33825
|
-
}
|
|
33826
|
-
function dropFailedHint(stackName, region, logicalIds) {
|
|
33827
|
-
const hint = dropFailedCommands(stackName, region, logicalIds);
|
|
33828
|
-
if (hint === void 0) return "";
|
|
33829
|
-
return `\n${hint.intro}` + hint.commands.map((c) => `\nDrop with: ${c}`).join("");
|
|
33830
|
-
}
|
|
33831
|
-
function warnDropFailed(logger, stackName, region, logicalIds) {
|
|
33832
|
-
const hint = dropFailedCommands(stackName, region, logicalIds);
|
|
33833
|
-
if (hint === void 0) return;
|
|
33834
|
-
logger.warn(safeMsg`${hint.intro}`);
|
|
33835
|
-
for (const command of hint.commands) logger.warn(safeMsg`Drop with: ${command}`);
|
|
33836
|
-
}
|
|
33837
|
-
async function deleteJournaledOrphans(orphans, stateResources, stackName, ctx, options = {}) {
|
|
33838
|
-
const total = {
|
|
33839
|
-
failures: 0,
|
|
33840
|
-
warnings: 0,
|
|
33841
|
-
interrupted: false,
|
|
33842
|
-
handled: [],
|
|
33843
|
-
leftInPlace: 0,
|
|
33844
|
-
failedLogicalIds: []
|
|
33845
|
-
};
|
|
33846
|
-
const inlinePolicyWriters = new RollbackInlinePolicyWriters();
|
|
33847
|
-
const failedIds = total.failedLogicalIds;
|
|
33848
|
-
const record = ctx.recordEvent;
|
|
33849
|
-
const printing = journaledOrphanPrintingBag(orphans.segments.flatMap(({ ops, companions }) => [...companions ?? [], ...ops]), stateResources);
|
|
33850
|
-
const maskedCtx = record === void 0 ? ctx : {
|
|
33851
|
-
...ctx,
|
|
33852
|
-
recordEvent: (event) => record(maskEventTextWithBoundBags(event))
|
|
33853
|
-
};
|
|
33854
|
-
for (const { segment, ops: orphanOps, companions } of orphans.segments) {
|
|
33855
|
-
if (options.isInterrupted?.()) {
|
|
33856
|
-
total.interrupted = true;
|
|
33857
|
-
break;
|
|
33858
|
-
}
|
|
33859
|
-
const ops = [...companions ?? [], ...orphanOps];
|
|
33860
|
-
const replay = () => withPrintingSecrets(printing, () => withStackName(stackName, () => replayFailedOperations(ops, stateResources, stackName, maskedCtx, {
|
|
33861
|
-
emitEnvelope: false,
|
|
33862
|
-
inlinePolicyWriters,
|
|
33863
|
-
forDestroy: true,
|
|
33864
|
-
...options.isInterrupted && { isInterrupted: options.isInterrupted }
|
|
33865
|
-
})));
|
|
33866
|
-
const result = segment.skipPrefix === void 0 ? await replay() : await withSkipPrefix(segment.skipPrefix, replay);
|
|
33867
|
-
total.failures += result.failures;
|
|
33868
|
-
total.warnings += result.warnings;
|
|
33869
|
-
total.leftInPlace += result.leftInPlace;
|
|
33870
|
-
const pending = new Set(result.remainingFailedOps);
|
|
33871
|
-
for (const op of ops) if (!pending.has(op)) total.handled.push({
|
|
33872
|
-
segment,
|
|
33873
|
-
op
|
|
33874
|
-
});
|
|
33875
|
-
if (result.interrupted) {
|
|
33876
|
-
total.interrupted = true;
|
|
33877
|
-
break;
|
|
33878
|
-
}
|
|
33879
|
-
for (const op of orphanOps) if (pending.has(op)) failedIds.push(op.logicalId);
|
|
33880
|
-
}
|
|
33881
|
-
if (options.pointAtDrop !== false && failedIds.length > 0) {
|
|
33882
|
-
ctx.logger.warn(safeMsg`${failedIds.length} resource(s) a failed deploy of stack ${displayIdent(stackName)} created ` + "could not be deleted (see above); the rollback journal, their only record, keeps them for a re-run.");
|
|
33883
|
-
warnDropFailed(ctx.logger, stackName, ctx.region, failedIds);
|
|
33884
|
-
}
|
|
33885
|
-
return total;
|
|
33886
|
-
}
|
|
33887
|
-
async function settleJournaledOrphansOnSuccess(args) {
|
|
33888
|
-
const { stateBackend, stackName, region, stateResources, newerOperations, ctx, logger } = args;
|
|
33889
|
-
const stack = displayIdent(stackName);
|
|
33890
|
-
const newerIds = newerOperations.map((op) => op.logicalId);
|
|
33891
|
-
let orphans;
|
|
33892
|
-
try {
|
|
33893
|
-
orphans = await loadJournaledOrphans(stateBackend, stackName, region, args.rollbackOrphans, logger, {
|
|
33894
|
-
newerOperations,
|
|
33895
|
-
...args.deployRunId !== void 0 && { deployRunId: args.deployRunId },
|
|
33896
|
-
unreadableOutcome: "the successful deploy removes the journal"
|
|
33897
|
-
});
|
|
33898
|
-
} catch (err) {
|
|
33899
|
-
logger.warn(safeMsg`Could not act on the rollback journal of stack ${stack}: ${errorDetail(err)}. It is kept.`);
|
|
33900
|
-
await markSuperseded(stateBackend, stackName, region, newerIds);
|
|
33901
|
-
return {
|
|
33902
|
-
unaddressed: 1,
|
|
33903
|
-
keepJournal: true
|
|
33904
|
-
};
|
|
33905
|
-
}
|
|
33906
|
-
if (orphans.count === 0) return {
|
|
33907
|
-
unaddressed: 0,
|
|
33908
|
-
keepJournal: false
|
|
33909
|
-
};
|
|
33910
|
-
const all = orphans.segments.flatMap(({ segment, ops }) => ops.map((op) => ({
|
|
33911
|
-
segment,
|
|
33912
|
-
op
|
|
33913
|
-
})));
|
|
33914
|
-
let kept = all;
|
|
33915
|
-
let failedDeletes = [];
|
|
33916
|
-
let leftInPlace = 0;
|
|
33917
|
-
if (stateResources === void 0) logger.warn(safeMsg`The rollback journal of stack ${stack} records ${all.length} resource(s) a failed deploy ` + `created, but the stack's state cannot be read, so whether a record now owns them is unknown: none is deleted.`);
|
|
33918
|
-
else {
|
|
33919
|
-
logger.info(safeMsg`The rollback journal of stack ${stack} records ${all.length} resource(s) a failed deploy ` + `created that no state record holds; acting on them per their DeletionPolicy before the journal is removed:`);
|
|
33920
|
-
for (const line of journaledOrphanLines(orphans, logger)) logger.info(line);
|
|
33921
|
-
try {
|
|
33922
|
-
const { unreadable, tracked } = await applySuccessRule(orphans, stateResources, orphans.deployLogicalIds ?? /* @__PURE__ */ new Set(), args.foreignHolder, stack, logger, args.isInterrupted, ctx);
|
|
33923
|
-
const acting = {
|
|
33924
|
-
segments: orphans.segments.map(({ segment, ops }) => ({
|
|
33925
|
-
segment,
|
|
33926
|
-
ops: ops.filter((op) => !unreadable.has(op) && !tracked.has(op))
|
|
33927
|
-
})).filter(({ ops }) => ops.length > 0),
|
|
33928
|
-
count: orphans.count - unreadable.size - tracked.size
|
|
33929
|
-
};
|
|
33930
|
-
const writtenThisRun = [...orphans.deployLogicalIds ?? []].filter((id) => Object.prototype.hasOwnProperty.call(stateResources, id)).map((id) => stateResources[id]).filter((r) => r !== void 0 && r !== null && typeof r === "object");
|
|
33931
|
-
const outcome = await deleteJournaledOrphans(acting, { ...stateResources }, stackName, {
|
|
33932
|
-
...ctx,
|
|
33933
|
-
writtenThisRun
|
|
33934
|
-
}, {
|
|
33935
|
-
pointAtDrop: false,
|
|
33936
|
-
...args.isInterrupted && { isInterrupted: args.isInterrupted }
|
|
33937
|
-
});
|
|
33938
|
-
leftInPlace = outcome.leftInPlace;
|
|
33939
|
-
failedDeletes = outcome.failedLogicalIds;
|
|
33940
|
-
kept = all.filter(({ segment, op }) => unreadable.has(op) || !tracked.has(op) && !isHandledOrphan(outcome.handled, segment, op));
|
|
33941
|
-
} catch (err) {
|
|
33942
|
-
logger.warn(safeMsg`Acting on the journaled resources of stack ${stack} failed: ${errorDetail(err)}`);
|
|
33943
|
-
}
|
|
33944
|
-
}
|
|
33945
|
-
const keptOps = new Set(kept.map(({ op }) => op));
|
|
33946
|
-
const skipped = all.filter(({ op }) => !keptOps.has(op) && op.physicalIdRecoveredFromError === false).length;
|
|
33947
|
-
const clearedOrphans = all.filter(({ op }) => !keptOps.has(op));
|
|
33948
|
-
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) => ({
|
|
33949
|
-
segment,
|
|
33950
|
-
op
|
|
33951
|
-
})))];
|
|
33952
|
-
const stripCleared = cleared.length === 0 ? void 0 : async () => {
|
|
33953
|
-
try {
|
|
33954
|
-
await stateBackend.dropRollbackJournalFailedOperations(stackName, region, (op, segment) => isHandledOrphan(cleared, segment, op));
|
|
33955
|
-
} catch (err) {
|
|
33956
|
-
logger.warn(safeMsg`Failed to remove the settled entries from the rollback journal of stack ${stack}: ` + safeMsg`${errorDetail(err)}. A cdkd rollback or cdkd destroy could act on them again; run a ` + "successful cdkd deploy of the stack first, which settles them again.");
|
|
33957
|
-
}
|
|
33958
|
-
};
|
|
33959
|
-
if (kept.length === 0) return {
|
|
33960
|
-
unaddressed: skipped + leftInPlace,
|
|
33961
|
-
keepJournal: false,
|
|
33962
|
-
...stripCleared && { stripCleared }
|
|
33963
|
-
};
|
|
33964
|
-
const keptIds = new Set(kept.map(({ op }) => op.logicalId));
|
|
33965
|
-
const supersededIds = newerIds.filter((id) => !keptIds.has(id));
|
|
33966
|
-
const demoted = kept.filter(({ op }) => op.physicalIdRecoveredFromError === false);
|
|
33967
|
-
const reduce = () => stateBackend.reduceRollbackJournalToFailedOperations(stackName, region, (op, segment) => isHandledOrphan(kept, segment, op), supersededIds, (op, segment) => isHandledOrphan(demoted, segment, op));
|
|
33968
|
-
let reduced = false;
|
|
33969
|
-
for (let attempt = 0; attempt < 2 && !reduced; attempt++) try {
|
|
33970
|
-
await reduce();
|
|
33971
|
-
reduced = true;
|
|
33972
|
-
} catch (err) {
|
|
33973
|
-
if (attempt === 1) logger.warn(safeMsg`Failed to reduce the rollback journal of stack ${stack} to its undeleted resources: ` + safeMsg`${errorDetail(err)}. The whole journal is kept.`);
|
|
33974
|
-
}
|
|
33975
|
-
if (!reduced) {
|
|
33976
|
-
await markSuperseded(stateBackend, stackName, region, supersededIds);
|
|
33977
|
-
await stripCleared?.();
|
|
33978
|
-
}
|
|
33979
|
-
logger.warn(safeMsg`${kept.length} resource(s) a failed deploy of stack ${stack} created were not deleted ` + (reduced ? "(see above). The rollback journal, their only record, is kept with just them; the next " : "(see above). The rollback journal, their only record, is kept; the next ") + "successful deploy retries.");
|
|
33980
|
-
warnDropFailed(logger, stackName, region, failedDeletes);
|
|
33981
|
-
return {
|
|
33982
|
-
unaddressed: kept.length + skipped + leftInPlace,
|
|
33983
|
-
keepJournal: true
|
|
33984
|
-
};
|
|
33985
|
-
}
|
|
33986
|
-
async function applySuccessRule(orphans, stateResources, deployLogicalIds, foreignHolder, stack, logger, isInterrupted, identityCtx) {
|
|
33987
|
-
const unreadable = /* @__PURE__ */ new Set();
|
|
33988
|
-
const tracked = /* @__PURE__ */ new Set();
|
|
33989
|
-
let interrupted = false;
|
|
33990
|
-
for (const { ops } of orphans.segments) for (const op of ops) {
|
|
33991
|
-
if (op.physicalIdRecoveredFromError !== true || !op.physicalId) continue;
|
|
33992
|
-
if (interrupted || isInterrupted?.()) {
|
|
33993
|
-
interrupted = true;
|
|
33994
|
-
unreadable.add(op);
|
|
33995
|
-
continue;
|
|
33996
|
-
}
|
|
33997
|
-
if (Object.values(stateResources).some((r) => r?.resourceType === op.resourceType && r.physicalId === op.physicalId)) {
|
|
33998
|
-
tracked.add(op);
|
|
33999
|
-
continue;
|
|
34000
|
-
}
|
|
34001
|
-
const hasRecord = Object.prototype.hasOwnProperty.call(stateResources, op.logicalId);
|
|
34002
|
-
const record = hasRecord ? stateResources[op.logicalId] : void 0;
|
|
34003
|
-
const recordUnderId = hasRecord && !isReplacedRecord(op, record);
|
|
34004
|
-
if (recordUnderId || deployLogicalIds.has(op.logicalId)) {
|
|
34005
|
-
const verdict = recordUnderId ? await recordIdentity(op, record, identityCtx, logger) : "unknown";
|
|
34006
|
-
if (verdict === "same") {
|
|
34007
|
-
tracked.add(op);
|
|
34008
|
-
continue;
|
|
34009
|
-
}
|
|
34010
|
-
if (verdict !== "different") {
|
|
34011
|
-
op.physicalIdRecoveredFromError = false;
|
|
34012
|
-
continue;
|
|
34013
|
-
}
|
|
34014
|
-
markProvenDistinctFromRecord(op, record);
|
|
34015
|
-
}
|
|
34016
|
-
const holding = await foreignHolder(op.resourceType, op.physicalId);
|
|
34017
|
-
if (holding === void 0) {
|
|
34018
|
-
const created = await createdResourceStillThere(op, identityCtx);
|
|
34019
|
-
if (created === "gone") {
|
|
34020
|
-
logger.info(safeMsg`${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}), which a failed deploy ` + safeMsg`of stack ${stack} created, is already gone: nothing to delete.`);
|
|
34021
|
-
tracked.add(op);
|
|
34022
|
-
} else if (created === "mismatch") {
|
|
34023
|
-
logger.warn(safeMsg`${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}), which a failed deploy ` + safeMsg`of stack ${stack} created, is not deleted: the resource now under its physical id is another ` + "one (its identity differs from the one that deploy recorded, so its name was reused).");
|
|
34024
|
-
op.physicalIdRecoveredFromError = false;
|
|
34025
|
-
} else if (created === "unproven") {
|
|
34026
|
-
logger.warn(safeMsg`${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}), which a failed deploy ` + safeMsg`of stack ${stack} created, is not deleted: nothing proves the resource now under its physical ` + "id is the one that deploy created (it may have been deleted and its name reused).");
|
|
34027
|
-
op.physicalIdRecoveredFromError = false;
|
|
34028
|
-
}
|
|
34029
|
-
continue;
|
|
34030
|
-
}
|
|
34031
|
-
if (holding.kind === "held") {
|
|
34032
|
-
logger.warn(safeMsg`${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}), which a failed deploy ` + safeMsg`of stack ${stack} created, is not deleted: ${holding.by} holds a resource of that type under ` + "the same physical id.");
|
|
34033
|
-
op.physicalIdRecoveredFromError = false;
|
|
34034
|
-
continue;
|
|
34035
|
-
}
|
|
34036
|
-
logger.warn(safeMsg`${logicalIdShown(op.logicalId)} (${resourceTypeShown(op.resourceType)}), which a failed deploy ` + safeMsg`of stack ${stack} created, is not deleted: ${holding.what}, so whether another stack holds it is unknown.`);
|
|
34037
|
-
unreadable.add(op);
|
|
34038
|
-
}
|
|
34039
|
-
return {
|
|
34040
|
-
unreadable,
|
|
34041
|
-
tracked
|
|
34042
|
-
};
|
|
34043
|
-
}
|
|
34044
|
-
async function recordIdentity(op, record, ctx, logger) {
|
|
34045
|
-
if (typeof record !== "object" || record === null || record.resourceType !== op.resourceType || typeof record.physicalId !== "string" || record.physicalId === "" || !op.physicalId) return "unknown";
|
|
34046
|
-
try {
|
|
34047
|
-
const { provider } = ctx.providerRegistry.getProviderFor({
|
|
34048
|
-
resourceType: op.resourceType,
|
|
34049
|
-
provisionedBy: op.provisionedBy
|
|
34050
|
-
});
|
|
34051
|
-
if (typeof provider.isSameResource !== "function") return "unknown";
|
|
34052
|
-
return await provider.isSameResource(op.physicalId, {
|
|
34053
|
-
physicalId: record.physicalId,
|
|
34054
|
-
...record.provisionedBy !== void 0 && { provisionedBy: record.provisionedBy }
|
|
34055
|
-
}, op.resourceType, { expectedRegion: ctx.region });
|
|
34056
|
-
} catch (err) {
|
|
34057
|
-
logger.debug(safeMsg`Could not compare ${logicalIdShown(op.logicalId)}'s journaled resource with its state record (${displaySafe(err instanceof Error ? err.name : typeof err)}).`);
|
|
34058
|
-
return "unknown";
|
|
34059
|
-
}
|
|
34060
|
-
}
|
|
34061
|
-
async function createdResourceStillThere(op, ctx) {
|
|
34062
|
-
if (op.deletionPolicy === "Retain") return "proven";
|
|
34063
|
-
if (!orphanDeleteNeedsIdentity(op.resourceType)) return "proven";
|
|
34064
|
-
const physicalId = op.physicalId;
|
|
34065
|
-
if (!physicalId) return "unproven";
|
|
34066
|
-
const live = await readResourceIdentity(ctx.providerRegistry, {
|
|
34067
|
-
resourceType: op.resourceType,
|
|
34068
|
-
physicalId,
|
|
34069
|
-
provisionedBy: op.provisionedBy
|
|
34070
|
-
}, ctx.region);
|
|
34071
|
-
if (live === RESOURCE_NOT_FOUND) return "gone";
|
|
34072
|
-
const journaled = op.createdResourceIdentity;
|
|
34073
|
-
if (typeof journaled !== "string" || journaled === "" || typeof live !== "string") return "unproven";
|
|
34074
|
-
return live === journaled ? "proven" : "mismatch";
|
|
34075
|
-
}
|
|
34076
|
-
function makeForeignHolderScan(stateBackend) {
|
|
34077
|
-
let scan;
|
|
34078
|
-
const key = (type, id) => JSON.stringify([type, id]);
|
|
34079
|
-
const run = async () => {
|
|
34080
|
-
const holders = /* @__PURE__ */ new Map();
|
|
34081
|
-
let refs;
|
|
34082
|
-
try {
|
|
34083
|
-
refs = await stateBackend.listStacks();
|
|
34084
|
-
} catch {
|
|
34085
|
-
return {
|
|
34086
|
-
holders,
|
|
34087
|
-
unreadable: "the state bucket listing (it could not be read)"
|
|
34088
|
-
};
|
|
34089
|
-
}
|
|
34090
|
-
let unreadable;
|
|
34091
|
-
await Promise.all(refs.map(async (ref) => {
|
|
34092
|
-
const named = (why) => safeMsg`the state record of stack ${displayIdent(ref.stackName)} (${why})`;
|
|
34093
|
-
if (ref.region === void 0) {
|
|
34094
|
-
unreadable ??= named("its region cannot be read");
|
|
34095
|
-
return;
|
|
34096
|
-
}
|
|
34097
|
-
const region = ref.region;
|
|
34098
|
-
let state;
|
|
34099
|
-
try {
|
|
34100
|
-
state = (await stateBackend.getState(ref.stackName, region))?.state;
|
|
34101
|
-
} catch {
|
|
34102
|
-
unreadable ??= named("it could not be read");
|
|
34103
|
-
return;
|
|
34104
|
-
}
|
|
34105
|
-
if (state === void 0) return;
|
|
34106
|
-
const resources = state.resources;
|
|
34107
|
-
if (resources !== void 0 && (typeof resources !== "object" || resources === null || Array.isArray(resources))) {
|
|
34108
|
-
unreadable ??= named("its resources cannot be read");
|
|
34109
|
-
return;
|
|
34110
|
-
}
|
|
34111
|
-
if (!hasReadableOrphans(state) || unreadableOrphanRecords(state).length > 0) {
|
|
34112
|
-
unreadable ??= named("its rollback-orphan records cannot be read");
|
|
34113
|
-
return;
|
|
34114
|
-
}
|
|
34115
|
-
const held = [...Object.values(resources ?? {}), ...(state.orphans ?? []).map((record) => record.state)];
|
|
34116
|
-
for (const record of held) {
|
|
34117
|
-
const r = record;
|
|
34118
|
-
if (typeof r?.resourceType !== "string" || typeof r.physicalId !== "string") continue;
|
|
34119
|
-
const k = key(r.resourceType, r.physicalId);
|
|
34120
|
-
const list = holders.get(k) ?? [];
|
|
34121
|
-
list.push({
|
|
34122
|
-
stackName: ref.stackName,
|
|
34123
|
-
region
|
|
34124
|
-
});
|
|
34125
|
-
holders.set(k, list);
|
|
34126
|
-
}
|
|
34127
|
-
}));
|
|
34128
|
-
return {
|
|
34129
|
-
holders,
|
|
34130
|
-
...unreadable !== void 0 && { unreadable }
|
|
34131
|
-
};
|
|
34132
|
-
};
|
|
34133
|
-
return (self) => async (resourceType, physicalId) => {
|
|
34134
|
-
scan ??= run();
|
|
34135
|
-
const { holders, unreadable } = await scan;
|
|
34136
|
-
const other = (holders.get(key(resourceType, physicalId)) ?? []).find((h) => !(h.stackName === self.stackName && h.region === self.region));
|
|
34137
|
-
if (other) return {
|
|
34138
|
-
kind: "held",
|
|
34139
|
-
by: safeMsg`the state record of stack ${displayIdent(other.stackName)} (${displaySafe(other.region)})`
|
|
34140
|
-
};
|
|
34141
|
-
return unreadable === void 0 ? void 0 : {
|
|
34142
|
-
kind: "unreadable",
|
|
34143
|
-
what: unreadable
|
|
34144
|
-
};
|
|
34145
|
-
};
|
|
34146
|
-
}
|
|
34147
|
-
async function markSuperseded(stateBackend, stackName, region, ids) {
|
|
34148
|
-
try {
|
|
34149
|
-
await stateBackend.markRollbackJournalSuperseded(stackName, region, ids);
|
|
34150
|
-
} catch {}
|
|
34151
|
-
}
|
|
34152
|
-
function errorDetail(err) {
|
|
34153
|
-
return displaySafe(err instanceof Error ? err.message : String(err));
|
|
34154
|
-
}
|
|
34155
|
-
function isHandledOrphan(handled, segment, op) {
|
|
34156
|
-
return handled.some((h) => h.segment.timestamp === segment.timestamp && h.segment.runId === segment.runId && h.op.logicalId === op.logicalId && h.op.changeType === op.changeType && h.op.resourceType === op.resourceType && h.op.physicalId === op.physicalId);
|
|
34157
|
-
}
|
|
34158
|
-
function orphanKey(segment, op) {
|
|
34159
|
-
return JSON.stringify([
|
|
34160
|
-
segment.timestamp,
|
|
34161
|
-
segment.runId ?? null,
|
|
34162
|
-
op.logicalId,
|
|
34163
|
-
op.changeType,
|
|
34164
|
-
op.resourceType,
|
|
34165
|
-
op.physicalId ?? null
|
|
34166
|
-
]);
|
|
34167
|
-
}
|
|
34168
|
-
function sameJournaledOrphans(a, b) {
|
|
34169
|
-
const keys = (o) => o.segments.flatMap(({ segment, ops }) => ops.map((op) => orphanKey(segment, op))).sort();
|
|
34170
|
-
const ka = keys(a);
|
|
34171
|
-
const kb = keys(b);
|
|
34172
|
-
return ka.length === kb.length && ka.every((k, i) => k === kb[i]);
|
|
34173
|
-
}
|
|
34174
|
-
|
|
34175
34238
|
//#endregion
|
|
34176
34239
|
//#region src/deployment/deploy-engine/rollback.ts
|
|
34177
34240
|
function redactOperationsForJournal(operations) {
|
|
@@ -35716,8 +35779,8 @@ function buildResolverContext(base, stackName) {
|
|
|
35716
35779
|
...base.redactedAttributeReads && { redactedAttributeReads: base.redactedAttributeReads }
|
|
35717
35780
|
};
|
|
35718
35781
|
}
|
|
35719
|
-
function printNestedStackReadsOnly(context, resourceType) {
|
|
35720
|
-
if (resourceType === "AWS::CloudFormation::Stack") context.printingSecrets =
|
|
35782
|
+
function printNestedStackReadsOnly(context, resourceType, rowPrintingRegistry) {
|
|
35783
|
+
if (resourceType === "AWS::CloudFormation::Stack") context.printingSecrets = rowPrintingRegistry;
|
|
35721
35784
|
}
|
|
35722
35785
|
function getAttTargetOf(node) {
|
|
35723
35786
|
if (node === null || typeof node !== "object" || Array.isArray(node)) return void 0;
|
|
@@ -35785,7 +35848,7 @@ async function provisionCreate(logicalId, change, stateResources, stackName, tem
|
|
|
35785
35848
|
if (context.recordedSecretValues) this.perResourceSecrets.set(logicalId, context.recordedSecretValues);
|
|
35786
35849
|
const noEchoOverrides = await this.noEchoAttributeOverridesFor(desiredProps, stateResources, stackName);
|
|
35787
35850
|
if (noEchoOverrides !== void 0) context.noEchoAttributeOverrides = noEchoOverrides;
|
|
35788
|
-
printNestedStackReadsOnly(context, resourceType);
|
|
35851
|
+
printNestedStackReadsOnly(context, resourceType, this.secretNameBagFor(logicalId));
|
|
35789
35852
|
const resolvedProps = await this.resolver.resolve(desiredProps, context);
|
|
35790
35853
|
this.noteSecretNamedRecord(logicalId, {
|
|
35791
35854
|
resourceType,
|
|
@@ -35997,7 +36060,7 @@ async function provisionUpdate(logicalId, change, stateResources, stackName, tem
|
|
|
35997
36060
|
this.perResourceSecrets.set(logicalId, updateSecrets);
|
|
35998
36061
|
const noEchoOverrides = await this.noEchoAttributeOverridesFor(desiredProps, stateResources, stackName);
|
|
35999
36062
|
if (noEchoOverrides !== void 0) context.noEchoAttributeOverrides = noEchoOverrides;
|
|
36000
|
-
printNestedStackReadsOnly(context, resourceType);
|
|
36063
|
+
printNestedStackReadsOnly(context, resourceType, this.secretNameBagFor(logicalId));
|
|
36001
36064
|
const resolvedProps = await this.resolver.resolve(desiredProps, context);
|
|
36002
36065
|
this.noteSecretNamedRecord(logicalId, {
|
|
36003
36066
|
resourceType,
|
|
@@ -39520,5 +39583,5 @@ DeployEngine.prototype.replacementNameOrigin = replacementNameOrigin;
|
|
|
39520
39583
|
DeployEngine.prototype.orphanedNameCollisionAdvice = orphanedNameCollisionAdvice;
|
|
39521
39584
|
|
|
39522
39585
|
//#endregion
|
|
39523
|
-
export { recordDisplacedSkips as $, noEchoLeavesOf as $a, refuseMalformedResourcesForDeploy as $i, withPrintingSecrets as $n, importableOutputs as $o, passedParameterClassesOf as $r, resolveStateBucketWithDefault as $s, secretNamePrintingBag as $t, gray as A, coerceCfnBoolean as Aa, resolveBucketRegion as Ac, malformedScrubResourceEntriesRefusalMessage as Ai, findDestructiveChanges as An, recordMaskOnlyValue as Ao, envCredentialsAreAssumedRole as Ar, formatDockerLoginError as As, removeProtectionTypeList as At, isHandledOrphan as B, prefetchCreateOnlyPropertyPaths as Ba, refuseMalformedOutputs as Bi, planTagDiff as Bn, isSingleDynamicReferenceToken as Bo, getAccountInfo as Br, escapeRegExp$3 as Bs, findNestedStackTypeChanges as Bt, recordedProtectionNote as C, isStatefulRecreateTargetSync as Ca, ownValue as Cc, malformedOrphansWarning as Ci, collectPublishedOutputNames as Cn, pathCrossesDottedKey as Co, assertSendableRoleArn as Cr, buildDockerImage as Cs, INDEX_SETTLE_POLL_INTERVAL_MS as Ct, createReadOnlyAttributeHealerFactory as D, isWarmThroughputDecrease as Da, renderAssemblyPathEscape as Dc, malformedResourceEntriesWarning as Di, DEFAULT_RESOURCE_WARN_AFTER_MS as Dn, identityKeyFor as Do, AWS_CREDENTIAL_ENV_KEYS as Dr, describeDockerFailure as Ds, S3_AUTO_DELETE_OBJECTS_TAG as Dt, formatResourceLine as E, coerceWarmThroughput as Ea, displayAssemblyPath as Ec, malformedRenderedContainersWarning as Ei, DEFAULT_RESOURCE_TIMEOUT_MS as En, recoverMaskedOutput as Eo, sendableAssumeRoleCommand as Er, describeDockerExecFailure as Es, ECR_AUTO_DELETE_IMAGES_TAG as Et, namesAnyDeclaredParameter as F, readConfigString as Fa, refuseMalformedOrphanRecords as Fi, reserveStackCreateToken as Fn, STATE_SOURCED_BASELINE_RULES as Fo, s3BucketRegionalDomainName as Fr, redactDockerArgvValues as Fs, isReplacementOrphan as Ft, makeSiblingClaimReader as G, lambdaFunctionNameForMask as Ga, refuseMalformedResourceEntriesForDestroy as Gi, definedAttributes as Gn, splitImportedOps as Go, keepsSecretReferenceToken as Gr, synthesisStatusMessage as Gs, redactedDeleteAddressFields as Gt, loadJournaledOrphans as H, describeTypeWithThrottleRetry as Ha, refuseMalformedResourceAttributesForOrphan as Hi, refuseMalformedDesiredTags as Hn, isLockInfoExpired as Ho, carriesDynamicReference as Hr, AssetManifestLoader as Hs, inheritProducerRegions as Ht, reachableDivergentParameters as I, replayWarn as Ia, refuseMalformedOrphanRecordsForDestroy as Ii, withCreateTokenLedger as In, STATE_SOURCED_CROSS_GENERATION_RULES as Io, s3BucketWebsiteUrl as Ir, redactedDockerCause as Is, planFailedOps as It, displacedOpClause as J, TemplateParser as Ja, refuseMalformedResourceEntriesForOrphan as Ji, ProviderRegistry as Jn, exportNamesCarriedFrom as Jo, isStalePlaceholderArnAttribute as Jr, loadCdkJson as Js, updatePartialReason as Jt, planOrphanAdoption as K, sameLambdaFunctionAddress as Ka, refuseMalformedResourceEntriesForImport as Ki, stringifyIfAssigned as Kn, acceptedCreateOnlyDropsOf as Ko, AWS_NO_VALUE as Kr, getDefaultStateBucketName as Ks, redactedDeleteAddressSkip as Kt, resourcesNamingDeclaredParameter as L, requireConfigArray as La, refuseMalformedOrphans as Li, acquireIdempotencyToken as Ln, STATE_SOURCED_READBACK_RULES as Lo, coerceParameterTypedValue as Lr, runDockerForeground as Ls, planRollback as Lt, red as M, configBooleanRefusal as Ma, previewableOrphanRecords as Mi, RollbackInlinePolicyWriters as Mn, recordNoEchoAttributeValues as Mo, s3BucketArn as Mr, isDockerClientEnvKey as Ms, recordAfterRollbackUpdate as Mt, yellow as N, configIntegerRefusal as Na, refuseDivergentRecordRegionForDestroy as Ni, earliestDefined as Nn, recordProvenPublicExpression as No, s3BucketDomainName as Nr, isMalformedEnvKey as Ns, demoteSupersededOrphans as Nt, bold as O, toCfnInteger as Oa, resolveAssemblyPath as Oc, malformedResourcePropertiesWarning as Oi, maskingRetryLogger as On, carriesSecretMask as Oo, applyCallerIdentityCredentials as Or, dockerSpawnEnvWithSensitive as Os, hasCdkAutoDeleteTag as Ot, computeParameterTaint as P, configStringRefusal as Pa, refuseMalformedNestedChildOutputs as Pi, ledgerForStack as Pn, wholeStringLeavesOf as Po, s3BucketDualStackDomainName as Pr, partitionSensitiveEnv as Ps, isJournaledOrphan as Pt, nestedChildStackName as Q, maskedLeafCoordinatesOf as Qa, refuseMalformedResourcePropertiesForOrphan as Qi, getCurrentResourceSecrets as Qn, importableOutputKeys as Qo, parameterInputsFor as Qr, resolveSkipPrefix as Qs, orphanRecordsPrintingBag as Qt, deleteJournaledOrphans as R, requireConfigObject as Ra, refuseMalformedOrphansForDestroy as Ri, DBPROXY_TAGS_WHAT as Rn, TEMPLATE_SOURCED_RULES as Ro, isUnboundTemplateParameter as Rr, runDockerStreaming as Rs, replacementNeverSwapped as Rt, recordedProtectionEvidence as S, isStatefulRecreateTargetForReplace as Sa, nullPrototypeRecord as Sc, malformedOrphansRefusalMessage as Si, collectDeclaredOutputNames as Sn, isUncertifiedBaselineMaskPosition as So, assertFlagRoleArn as Sr, buildDenyExternalAccessPolicy as Ss, DELETE_INDEX_WAIT_PROCEED_NOTE as St, markRefusedBeforeApplying as T, WARM_THROUGHPUT_MEMBERS as Ta, describeFileReadFailure as Tc, malformedOutputsWarning as Ti, bindingSkippedOutputs as Tn, recordNestedStackParameterExpressions as To, isIamRoleArn as Tr, describeDockerCapturedOutput as Ts, waitForIndexesSettled as Tt, makeForeignHolderScan as U, withRetry as Ua, refuseMalformedResourceEntries as Ui, tagMapAsList as Un, S3StateBackend as Uo, carriesFetchableDynamicReference as Ur, getDockerImageBySourceHash as Us, REDACTED_DELETE_ADDRESS_SKIP_REASON as Ut, journaledOrphanLines as V, templateResourceTypes as Va, refuseMalformedOutputsForDestroy as Vi, readTagList as Vn, LockManager as Vo, isImpossibleEmptyStoredAttribute as Vr, stripControlChars as Vs, getCurrentProducerRegions as Vt, sameJournaledOrphans as W, canonicalLambdaFunctionName as Wa, refuseMalformedResourceEntriesForDeploy as Wi, tagPlanWarning as Wn, rebuildClientForBucketRegion as Wo, isNamelessDynamicReferenceError as Wr, Synthesizer as Ws, isRedactedRecordedValue as Wt, dropSettledNestedJournals as X, maskReadbackAtCoordinates as Xa, refuseMalformedResourcePropertiesForDrift as Xi, wouldReturnToSdkProvider as Xn, hasReasonlessBaselineRefusal as Xo, parseWebACLArn as Xr, resolveAutoAssetStorage as Xs, journaledOrphanPrintingBag as Xt, displacedPhysicalIdShown as Y, isMarkedCoordinate as Ya, refuseMalformedResourcePropertiesForDestroy as Yi, ccBrokenReason as Yn, hasReadableExportSet as Yo, refStateLookupFromResource as Yr, resolveApp as Ys, completedReplayEntries as Yt, getNestedRevertRun as Z, maskWholeValue as Za, refuseMalformedResourcePropertiesForExport as Zi, isCustomResourceType as Zn, hasUnverifiableParameterRefusal as Zo, withSharedDrainBudget as Zr, resolveCaptureObservedState as Zs, maskEventTextWithBoundBags as Zt, makeCanonicalizePropertiesFn as _, NO_CC_HANDLERS_REASON as _a, StageLoadError as _c, malformedLocalResourceEntriesWarning as _i, secretBearingStateKeyWarning as _n, markSameGenerationBag as _o, IntrinsicFunctionResolver as _r, isCrossRegionRedirect as _s, beginDeleteWait as _t, findNestedTemplateTreeDefect as a, repairMalformedOutputsForReadOnly as aa, CFN_TEMPLATE_BODY_LIMIT as ac, accountArgs as ai, createPreDeleteFinalSnapshot as an, createUnionSecretMasker as ao, deleteSkipReason as ar, isSensitiveAttributeName as as, replayFailedOperations as at, noEchoParameterNamesOf as b, shownType as ba, hasOwnKey as bc, malformedOrphanRecordsWarning as bi, isWholeDynamicReferenceValue as bn, DYNAMIC_REFERENCE_TOKEN_SCAN as bo, regionLessSecretName as br, validateAssetBucketName as bs, resolveDynamoDbDeleteBudgetClock as bt, renderNestedTemplateTreeDefect as c, repairMalformedResourcesForReadOnly as ca, findLargeInlineResources as cc, hasReadableOrphans as ci, refusesFinalSnapshot as cn, logOnlyValueCount as co, markWaitAbandoned as cr, buildAssetRedirectMap as cs, destroyStackRecordsView as ct, conditionInputsFrom as d, unreadableResourceEntries as da, decodeListingKey as dc, isReadableOrphanRecord as di, DeploymentEventsStore as dn, recordLogOnlyValue as do, isTerminationProtectionPropagationError as dr, rewriteTemplateAssetReferences as ds, PROTECTION_PROPERTY_BY_TYPE as dt, refuseMalformedResourcesForDestroy as ea, resolveStateBucketWithDefaultAndSource as ec, JSON_LISTING_HOLE_VALUE as ei, stateSecretNameNeedles as en, noEchoOutputsComparison as eo, CloudControlProvider as er, isReadableBag as es, revertNestedChildFromJournal as et, parentSuppliedValues as f, withheldAccountClause as fa, expectedOwnerParam as fc, isReadableResourceEntry as fi, extractDeploymentEventError as fn, shareLogOnlyValues as fo, observeThenDisableInstanceApiTermination as fr, AssetModeResolver as fs, isProtectionValueActive as ft, mergeNoChangeOutputs as g, withoutSilentDropProperties as ga, AssemblyReader as gc, malformedLocalOutputsWarning as gi, secretBearing as gn, maskSecretsInText as go, INTRINSIC_KEYS as gr, getBootstrapMarkerKey as gs, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as gt, keptWholeReasonText as h, unwrittenCreateOnlyReplacement as ha, derivePartitionAndUrlSuffix as hc, malformedExportSourceWarning as hi, exportAliasCollisionScrubWarning as hn, maskSecretsInError as ho, DiffCalculator as hr, ensureAssetStorage as hs, DynamoDBGlobalTableProvider as ht, childTemplateLoader as i, repairMalformedOrphansForReadOnly as ia, ssmResolvedValueType as ic, UNREADABLE_RESOURCES_MAP_ROW as ii, ccRoutedFinalSnapshotError as in, carryLogOnlyValues as io, deleteIndeterminateGuards as ir, AssetPublisher as is, withNestedStackContext as it, green as j, coerceCfnInteger as ja, malformedStateRefusalMessage as ji, formatDestructiveChange as jn, recordMaskOnlyValuesIn as jo, isSettledInstanceState as jr, getDockerCmd as js, orphanDeleteNeedsIdentity as jt, cyan as k, toFiniteNumber as ka, clearBucketRegionCache as kc, malformedResourcesWarning as ki, constructPathOf as kn, provenPublicValue as ko, callerEnvCredentials as kr, finchSecretArgvRefusal as ks, isTruthyCfnBoolean as kt, templateIdentity as l, unpreviewableOrphanRecords as la, uploadCfnTemplate as lc, hasReadableOutputs as li, unsupportedFinalSnapshotError as ln, printingCorpusOf as lo, disableInstanceApiTermination as lr, createAssetRedirectResolver as ls, getStackRecords as lt, isSecretBearingReferenceString as m, findSilentDropProperties as ma, canonicalizeRegion as mc, malformedExportNamesWarning as mi, displayTextOrWithheld as mn, errorCauseChain as mo, reEnableInstanceApiTermination as mr, assertAssetBucketRegion as ms, readProtection as mt, IMPLICIT_DELETE_DEPENDENCIES as n, refuseMalformedState as na, stateBucketExistenceConfirmed as nc, STATE_RESOURCES_MALFORMED as ni, PRE_DELETE_SNAPSHOT_TYPES as nn, readsNoEchoSource as no, unchangedBehindSecretReference as nr, orphansCarriedFrom as ns, withNestedRevertRun as nt, isAbsoluteAssetPath as o, repairMalformedResourceEntriesForReadOnly as oa, CFN_TEMPLATE_URL_LIMIT as oc, deployRefusesOrphanRowsReason as oi, effectiveDeletionPolicy as on, hasMaskableValues as oo, withIndeterminateGuard as or, stringifyValue as os, replayRollback as ot, readRecordedConditionVerdicts as p, findActionableSilentDrops as pa, PARTITION_TABLE as pc, malformedDriftResourcePropertiesWarning as pi, WITHHELD_NAME_DISPLAY as pn, createSecretMasker as po, reDisableInstanceApiTermination as pr, BOOTSTRAP_MARKER_PREFIX as ps, perType as pt, NESTED_PENDING_PARENT_REASON as q, DagBuilder as qa, refuseMalformedResourceEntriesForImportSave as qi, CC_BROKEN_REASON as qn, describeRegionValueKind as qo, cfnRefValueFromPhysicalId as qr, getLegacyStateBucketName as qs, updatePartialMessage as qt, computeImplicitDeleteEdges as r, repairMalformedOrphanRecordsForReadOnly as ra, warnDeprecatedNoPrefixCliFlag as rc, UNREADABLE_ORPHANS_CONTAINER_ROW as ri, buildFinalSnapshotIdentifier as rn, liveMatchesUnresolvedTokenFrame as ro, UNSPECIFIED_SKIP_REASON as rr, shouldRetainResource as rs, getCurrentNestedStackContext as rt, listNestedTemplateRows as s, repairMalformedResourcePropertiesForReadOnly as sa, MIGRATE_TMP_PREFIX as sc, displayLogicalId as si, isFinalSnapshotError as sn, literalSplitDelimitersOf as so, isWaitAbandonedError as sr, WorkGraph as ss, awaitInFlightSibling as st, DeployEngine as t, refuseMalformedResourcesForExport as ta, resolveUseCdkBootstrapAssets as tc, STATE_REGION_DIVERGED as ti, ATOMIC_FINAL_SNAPSHOT_TYPES as tn, passedNoEchoParametersOf as to, slowCcOperationTimeoutMs as tr, orphansAfterRollback as ts, revertedNestedRowIds as tt, conditionFingerprint as u, unreadableOrphanRecords as ua, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as uc, hasReadableResources as ui, DeploymentEventsReader as un, recordLogOnlyParameterValue as uo, ec2InstanceProtectionSite as ur, loadPublishableAssetManifest as us, withStackRecords as ut, noEchoAttributeNamesOf as v, hasNoCloudControlHandlers as va, processStackMessages as vc, malformedLocalResourcesWarning as vi, secretSafeKeyDisplay as vn, redactSecretsForState as vo, classifyReplaySecretRegion as vr, parseBootstrapMarker as vs, compensateRemovedDeletionProtection as vt, getPriorAttempts as w, renderStatefulReason as wa, absoluteAssemblyPathEscape as wc, malformedOutputsRefusalMessage as wi, isExportAliasCollision as wn, inheritNestedStackParameterAssociations as wo, explicitRoleArnOrThrow as wr, resolveDockerContextDirectory as ws, deleteTableWithIndexBusyRetry as wt, withResourceDeadline as x, MULTI_REGION_RECREATE_BLOCKED_TYPES as xa, hasPlainPrototype$1 as xc, malformedOrphanRowsKeptWarning as xi, noEchoParameterValueSeed as xn, dynamicReferenceTokens as xo, applyRoleArnIfSet as xr, validateContainerRepoName as xs, resolveDynamoDbDeleteBudgetMs as xt, noEchoComparisonForTemplate as y, findReplacedReadersOfRecreateTargets as ya, defineOwnKey as yc, malformedOrphanRecordsRefusalMessage as yi, exportNameSecretExposure as yn, scrubResourceRecord as yo, producerRegionsFromState as yr, readBootstrapMarkerBody as ys, deleteBudgetKey as yt, dropFailedHint as z, requireConfigString as za, refuseMalformedOrphansForOrphan as zi, DBPROXY_TAG_OPTIONS as zn, WHOLE_DYNAMIC_REFERENCE_PATTERN as zo, parameterTypeMayLoseSecretIdentity as zr, warnFinchArgvExposure as zs, resolveReplacementOldType as zt };
|
|
39524
|
-
//# sourceMappingURL=deploy-engine-
|
|
39586
|
+
export { dropFailedHint as $, maskedLeafCoordinatesOf as $a, refuseMalformedResourcePropertiesForOrphan as $i, getCurrentResourceSecrets as $n, importableOutputKeys as $o, parameterInputsFor as $r, resolveSkipPrefix as $s, secretNamePrintingBag as $t, gray as A, toFiniteNumber as Aa, clearBucketRegionCache as Ac, malformedResourcesWarning as Ai, findDestructiveChanges as An, provenPublicValue as Ao, callerEnvCredentials as Ar, finchSecretArgvRefusal as As, removeProtectionTypeList as At, NESTED_PENDING_PARENT_REASON as B, requireConfigString as Ba, refuseMalformedOrphansForOrphan as Bi, planTagDiff as Bn, WHOLE_DYNAMIC_REFERENCE_PATTERN as Bo, parameterTypeMayLoseSecretIdentity as Br, warnFinchArgvExposure as Bs, findNestedStackTypeChanges as Bt, recordedProtectionNote as C, isStatefulRecreateTargetForReplace as Ca, nullPrototypeRecord as Cc, malformedOrphansRefusalMessage as Ci, collectPublishedOutputNames as Cn, isUncertifiedBaselineMaskPosition as Co, assertFlagRoleArn as Cr, buildDenyExternalAccessPolicy as Cs, INDEX_SETTLE_POLL_INTERVAL_MS as Ct, createReadOnlyAttributeHealerFactory as D, coerceWarmThroughput as Da, displayAssemblyPath as Dc, malformedRenderedContainersWarning as Di, DEFAULT_RESOURCE_WARN_AFTER_MS as Dn, recoverMaskedOutput as Do, sendableAssumeRoleCommand as Dr, describeDockerExecFailure as Ds, S3_AUTO_DELETE_OBJECTS_TAG as Dt, formatResourceLine as E, WARM_THROUGHPUT_MEMBERS as Ea, describeFileReadFailure as Ec, malformedOutputsWarning as Ei, DEFAULT_RESOURCE_TIMEOUT_MS as En, recordNestedStackParameterExpressions as Eo, isIamRoleArn as Er, describeDockerCapturedOutput as Es, ECR_AUTO_DELETE_IMAGES_TAG as Et, namesAnyDeclaredParameter as F, configStringRefusal as Fa, refuseMalformedNestedChildOutputs as Fi, reserveStackCreateToken as Fn, wholeStringLeavesOf as Fo, s3BucketDualStackDomainName as Fr, partitionSensitiveEnv as Fs, isReplacementOrphan as Ft, nestedChildStackName as G, canonicalLambdaFunctionName as Ga, refuseMalformedResourceEntriesForDeploy as Gi, definedAttributes as Gn, rebuildClientForBucketRegion as Go, isNamelessDynamicReferenceError as Gr, Synthesizer as Gs, redactedDeleteAddressFields as Gt, displacedPhysicalIdShown as H, templateResourceTypes as Ha, refuseMalformedOutputsForDestroy as Hi, refuseMalformedDesiredTags as Hn, LockManager as Ho, isImpossibleEmptyStoredAttribute as Hr, stripControlChars as Hs, inheritProducerRegions as Ht, reachableDivergentParameters as I, readConfigString as Ia, refuseMalformedOrphanRecords as Ii, withCreateTokenLedger as In, STATE_SOURCED_BASELINE_RULES as Io, s3BucketRegionalDomainName as Ir, redactDockerArgvValues as Is, planFailedOps as It, revertedNestedRowIds as J, DagBuilder as Ja, refuseMalformedResourceEntriesForImportSave as Ji, ProviderRegistry as Jn, describeRegionValueKind as Jo, cfnRefValueFromPhysicalId as Jr, getLegacyStateBucketName as Js, updatePartialReason as Jt, recordDisplacedSkips as K, lambdaFunctionNameForMask as Ka, refuseMalformedResourceEntriesForDestroy as Ki, stringifyIfAssigned as Kn, splitImportedOps as Ko, keepsSecretReferenceToken as Kr, synthesisStatusMessage as Ks, redactedDeleteAddressSkip as Kt, resourcesNamingDeclaredParameter as L, replayWarn as La, refuseMalformedOrphanRecordsForDestroy as Li, acquireIdempotencyToken as Ln, STATE_SOURCED_CROSS_GENERATION_RULES as Lo, s3BucketWebsiteUrl as Lr, redactedDockerCause as Ls, planRollback as Lt, red as M, coerceCfnInteger as Ma, malformedStateRefusalMessage as Mi, RollbackInlinePolicyWriters as Mn, recordMaskOnlyValuesIn as Mo, isSettledInstanceState as Mr, getDockerCmd as Ms, recordAfterRollbackUpdate as Mt, yellow as N, configBooleanRefusal as Na, previewableOrphanRecords as Ni, earliestDefined as Nn, recordNoEchoAttributeValues as No, s3BucketArn as Nr, isDockerClientEnvKey as Ns, demoteSupersededOrphans as Nt, bold as O, isWarmThroughputDecrease as Oa, renderAssemblyPathEscape as Oc, malformedResourceEntriesWarning as Oi, maskingRetryLogger as On, identityKeyFor as Oo, AWS_CREDENTIAL_ENV_KEYS as Or, describeDockerFailure as Os, hasCdkAutoDeleteTag as Ot, computeParameterTaint as P, configIntegerRefusal as Pa, refuseDivergentRecordRegionForDestroy as Pi, ledgerForStack as Pn, recordProvenPublicExpression as Po, s3BucketDomainName as Pr, isMalformedEnvKey as Ps, isJournaledOrphan as Pt, deleteJournaledOrphans as Q, maskWholeValue as Qa, refuseMalformedResourcePropertiesForExport as Qi, isCustomResourceType as Qn, hasUnverifiableParameterRefusal as Qo, withSharedDrainBudget as Qr, resolveCaptureObservedState as Qs, orphanRecordsPrintingBag as Qt, makeSiblingClaimReader as R, requireConfigArray as Ra, refuseMalformedOrphans as Ri, DBPROXY_TAGS_WHAT as Rn, STATE_SOURCED_READBACK_RULES as Ro, coerceParameterTypedValue as Rr, runDockerForeground as Rs, replacementNeverSwapped as Rt, recordedProtectionEvidence as S, MULTI_REGION_RECREATE_BLOCKED_TYPES as Sa, hasPlainPrototype$1 as Sc, malformedOrphanRowsKeptWarning as Si, collectDeclaredOutputNames as Sn, dynamicReferenceTokens as So, applyRoleArnIfSet as Sr, validateContainerRepoName as Ss, DELETE_INDEX_WAIT_PROCEED_NOTE as St, markRefusedBeforeApplying as T, renderStatefulReason as Ta, absoluteAssemblyPathEscape as Tc, malformedOutputsRefusalMessage as Ti, bindingSkippedOutputs as Tn, inheritNestedStackParameterAssociations as To, explicitRoleArnOrThrow as Tr, resolveDockerContextDirectory as Ts, waitForIndexesSettled as Tt, dropSettledNestedJournals as U, describeTypeWithThrottleRetry as Ua, refuseMalformedResourceAttributesForOrphan as Ui, tagMapAsList as Un, isLockInfoExpired as Uo, carriesDynamicReference as Ur, AssetManifestLoader as Us, REDACTED_DELETE_ADDRESS_SKIP_REASON as Ut, displacedOpClause as V, prefetchCreateOnlyPropertyPaths as Va, refuseMalformedOutputs as Vi, readTagList as Vn, isSingleDynamicReferenceToken as Vo, getAccountInfo as Vr, escapeRegExp$3 as Vs, getCurrentProducerRegions as Vt, getNestedRevertRun as W, withRetry as Wa, refuseMalformedResourceEntries as Wi, tagPlanWarning as Wn, S3StateBackend as Wo, carriesFetchableDynamicReference as Wr, getDockerImageBySourceHash as Ws, isRedactedRecordedValue as Wt, getCurrentNestedStackContext as X, isMarkedCoordinate as Xa, refuseMalformedResourcePropertiesForDestroy as Xi, isCustomResource as Xn, hasReadableExportSet as Xo, refStateLookupFromResource as Xr, resolveApp as Xs, journaledOrphanPrintingBag as Xt, withNestedRevertRun as Y, TemplateParser as Ya, refuseMalformedResourceEntriesForOrphan as Yi, ccBrokenReason as Yn, exportNamesCarriedFrom as Yo, isStalePlaceholderArnAttribute as Yr, loadCdkJson as Ys, completedReplayEntries as Yt, withNestedStackContext as Z, maskReadbackAtCoordinates as Za, refuseMalformedResourcePropertiesForDrift as Zi, wouldReturnToSdkProvider as Zn, hasReasonlessBaselineRefusal as Zo, parseWebACLArn as Zr, resolveAutoAssetStorage as Zs, maskEventTextWithBoundBags as Zt, makeCanonicalizePropertiesFn as _, withoutSilentDropProperties as _a, AssemblyReader as _c, malformedLocalOutputsWarning as _i, secretBearingStateKeyWarning as _n, maskSecretsInText as _o, INTRINSIC_KEYS as _r, getBootstrapMarkerKey as _s, beginDeleteWait as _t, findNestedTemplateTreeDefect as a, repairMalformedOrphansForReadOnly as aa, ssmResolvedValueType as ac, UNREADABLE_RESOURCES_MAP_ROW as ai, createPreDeleteFinalSnapshot as an, carryLogOnlyValues as ao, deleteIndeterminateGuards as ar, AssetPublisher as as, replayFailedOperations as at, noEchoParameterNamesOf as b, findReplacedReadersOfRecreateTargets as ba, defineOwnKey as bc, malformedOrphanRecordsRefusalMessage as bi, isWholeDynamicReferenceValue as bn, scrubResourceRecord as bo, producerRegionsFromState as br, readBootstrapMarkerBody as bs, resolveDynamoDbDeleteBudgetClock as bt, renderNestedTemplateTreeDefect as c, repairMalformedResourcePropertiesForReadOnly as ca, MIGRATE_TMP_PREFIX as cc, displayLogicalId as ci, refusesFinalSnapshot as cn, literalSplitDelimitersOf as co, isWaitAbandonedError as cr, WorkGraph as cs, destroyStackRecordsView as ct, conditionInputsFrom as d, unreadableOrphanRecords as da, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as dc, hasReadableResources as di, DeploymentEventsStore as dn, recordLogOnlyParameterValue as do, ec2InstanceProtectionSite as dr, loadPublishableAssetManifest as ds, PROTECTION_PROPERTY_BY_TYPE as dt, refuseMalformedResourcesForDeploy as ea, resolveStateBucketWithDefault as ec, passedParameterClassesOf as ei, stateSecretNameNeedles as en, noEchoLeavesOf as eo, withPrintingSecrets as er, importableOutputs as es, isHandledOrphan as et, parentSuppliedValues as f, unreadableResourceEntries as fa, decodeListingKey as fc, isReadableOrphanRecord as fi, extractDeploymentEventError as fn, recordLogOnlyValue as fo, isTerminationProtectionPropagationError as fr, rewriteTemplateAssetReferences as fs, isProtectionValueActive as ft, mergeNoChangeOutputs as g, unwrittenCreateOnlyReplacement as ga, derivePartitionAndUrlSuffix as gc, malformedExportSourceWarning as gi, secretBearing as gn, maskSecretsInError as go, DiffCalculator as gr, ensureAssetStorage as gs, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as gt, keptWholeReasonText as h, findSilentDropProperties as ha, canonicalizeRegion as hc, malformedExportNamesWarning as hi, exportAliasCollisionScrubWarning as hn, errorCauseChain as ho, reEnableInstanceApiTermination as hr, assertAssetBucketRegion as hs, DynamoDBGlobalTableProvider as ht, childTemplateLoader as i, repairMalformedOrphanRecordsForReadOnly as ia, warnDeprecatedNoPrefixCliFlag as ic, UNREADABLE_ORPHANS_CONTAINER_ROW as ii, ccRoutedFinalSnapshotError as in, liveMatchesUnresolvedTokenFrame as io, UNSPECIFIED_SKIP_REASON as ir, shouldRetainResource as is, sameJournaledOrphans as it, green as j, coerceCfnBoolean as ja, resolveBucketRegion as jc, malformedScrubResourceEntriesRefusalMessage as ji, formatDestructiveChange as jn, recordMaskOnlyValue as jo, envCredentialsAreAssumedRole as jr, formatDockerLoginError as js, orphanDeleteNeedsIdentity as jt, cyan as k, toCfnInteger as ka, resolveAssemblyPath as kc, malformedResourcePropertiesWarning as ki, constructPathOf as kn, carriesSecretMask as ko, applyCallerIdentityCredentials as kr, dockerSpawnEnvWithSensitive as ks, isTruthyCfnBoolean as kt, templateIdentity as l, repairMalformedResourcesForReadOnly as la, findLargeInlineResources as lc, hasReadableOrphans as li, unsupportedFinalSnapshotError as ln, logOnlyValueCount as lo, markWaitAbandoned as lr, buildAssetRedirectMap as ls, getStackRecords as lt, isSecretBearingReferenceString as m, findActionableSilentDrops as ma, PARTITION_TABLE as mc, malformedDriftResourcePropertiesWarning as mi, displayTextOrWithheld as mn, createSecretMasker as mo, reDisableInstanceApiTermination as mr, BOOTSTRAP_MARKER_PREFIX as ms, readProtection as mt, IMPLICIT_DELETE_DEPENDENCIES as n, refuseMalformedResourcesForExport as na, resolveUseCdkBootstrapAssets as nc, STATE_REGION_DIVERGED as ni, PRE_DELETE_SNAPSHOT_TYPES as nn, passedNoEchoParametersOf as no, slowCcOperationTimeoutMs as nr, orphansAfterRollback as ns, loadJournaledOrphans as nt, isAbsoluteAssetPath as o, repairMalformedOutputsForReadOnly as oa, CFN_TEMPLATE_BODY_LIMIT as oc, accountArgs as oi, effectiveDeletionPolicy as on, createUnionSecretMasker as oo, deleteSkipReason as or, isSensitiveAttributeName as os, replayRollback as ot, readRecordedConditionVerdicts as p, withheldAccountClause as pa, expectedOwnerParam as pc, isReadableResourceEntry as pi, WITHHELD_NAME_DISPLAY as pn, shareLogOnlyValues as po, observeThenDisableInstanceApiTermination as pr, AssetModeResolver as ps, perType as pt, revertNestedChildFromJournal as q, sameLambdaFunctionAddress as qa, refuseMalformedResourceEntriesForImport as qi, CC_BROKEN_REASON as qn, acceptedCreateOnlyDropsOf as qo, AWS_NO_VALUE as qr, getDefaultStateBucketName as qs, updatePartialMessage as qt, computeImplicitDeleteEdges as r, refuseMalformedState as ra, stateBucketExistenceConfirmed as rc, STATE_RESOURCES_MALFORMED as ri, buildFinalSnapshotIdentifier as rn, readsNoEchoSource as ro, unchangedBehindSecretReference as rr, orphansCarriedFrom as rs, makeForeignHolderScan as rt, listNestedTemplateRows as s, repairMalformedResourceEntriesForReadOnly as sa, CFN_TEMPLATE_URL_LIMIT as sc, deployRefusesOrphanRowsReason as si, isFinalSnapshotError as sn, hasMaskableValues as so, withIndeterminateGuard as sr, stringifyValue as ss, awaitInFlightSibling as st, DeployEngine as t, refuseMalformedResourcesForDestroy as ta, resolveStateBucketWithDefaultAndSource as tc, JSON_LISTING_HOLE_VALUE as ti, ATOMIC_FINAL_SNAPSHOT_TYPES as tn, noEchoOutputsComparison as to, CloudControlProvider as tr, isReadableBag as ts, journaledOrphanLines as tt, conditionFingerprint as u, unpreviewableOrphanRecords as ua, uploadCfnTemplate as uc, hasReadableOutputs as ui, DeploymentEventsReader as un, printingCorpusOf as uo, disableInstanceApiTermination as ur, createAssetRedirectResolver as us, withStackRecords as ut, noEchoAttributeNamesOf as v, NO_CC_HANDLERS_REASON as va, StageLoadError as vc, malformedLocalResourceEntriesWarning as vi, secretSafeKeyDisplay as vn, markSameGenerationBag as vo, IntrinsicFunctionResolver as vr, isCrossRegionRedirect as vs, compensateRemovedDeletionProtection as vt, getPriorAttempts as w, isStatefulRecreateTargetSync as wa, ownValue as wc, malformedOrphansWarning as wi, isExportAliasCollision as wn, pathCrossesDottedKey as wo, assertSendableRoleArn as wr, buildDockerImage as ws, deleteTableWithIndexBusyRetry as wt, withResourceDeadline as x, shownType as xa, hasOwnKey as xc, malformedOrphanRecordsWarning as xi, noEchoParameterValueSeed as xn, DYNAMIC_REFERENCE_TOKEN_SCAN as xo, regionLessSecretName as xr, validateAssetBucketName as xs, resolveDynamoDbDeleteBudgetMs as xt, noEchoComparisonForTemplate as y, hasNoCloudControlHandlers as ya, processStackMessages as yc, malformedLocalResourcesWarning as yi, exportNameSecretExposure as yn, redactSecretsForState as yo, classifyReplaySecretRegion as yr, parseBootstrapMarker as ys, deleteBudgetKey as yt, planOrphanAdoption as z, requireConfigObject as za, refuseMalformedOrphansForDestroy as zi, DBPROXY_TAG_OPTIONS as zn, TEMPLATE_SOURCED_RULES as zo, isUnboundTemplateParameter as zr, runDockerStreaming as zs, resolveReplacementOldType as zt };
|
|
39587
|
+
//# sourceMappingURL=deploy-engine-Z_zHC0jz.js.map
|