@go-to-k/cdkd 0.289.2 → 0.289.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{asg-provider-C5FQJwUN.js → asg-provider-CpxZ9sVH.js} +3 -3
- package/dist/{asg-provider-C5FQJwUN.js.map → asg-provider-CpxZ9sVH.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-ClLLdy68.js → deploy-engine-BEpYvI14.js} +599 -196
- package/dist/deploy-engine-BEpYvI14.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{logger-D2Md1kTq.js → logger-CecsQ1UT.js} +53 -3
- package/dist/logger-CecsQ1UT.js.map +1 -0
- package/dist/{program-Du5rJeYT.js → program-CyIOIvtX.js} +140 -33
- package/dist/{program-Du5rJeYT.js.map → program-CyIOIvtX.js.map} +1 -1
- package/dist/{version-DUhfbsEF.js → version-C3wRsCF2.js} +2 -2
- package/dist/{version-DUhfbsEF.js.map → version-C3wRsCF2.js.map} +1 -1
- package/package.json +4 -4
- package/dist/deploy-engine-ClLLdy68.js.map +0 -1
- package/dist/logger-D2Md1kTq.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as collectInlinePolicyNamesManagedBySiblings, $n as
|
|
2
|
-
import { _ as withSkipPrefix, c as PATTERN_B_NAME_OPTIONS, f as explicitNamePropertyFor, h as getCurrentStackName, i as reserveStdoutForPayload, l as PATTERN_B_NAME_PROPERTIES, m as generateResourceNameWithFallback, n as getLogger, o as runStackBuffered, p as generateResourceName, s as getLiveRenderer, u as PATTERN_B_RESOURCE_TYPES, v as withStackName } from "./logger-
|
|
1
|
+
import { $ as collectInlinePolicyNamesManagedBySiblings, $n as buildDockerImage, $r as LocalInvokeBuildError$1, $t as DagBuilder, A as isStatefulRecreateTargetForReplace, An as importableOutputs, Ar as findLargeInlineResources, At as coerceCfnBoolean, B as gray, Bn as rewriteTemplateAssetReferences, Br as resolveBucketRegion, Bt as withSharedDrainBudget, C as refusesFinalSnapshot, Cn as buildLockContentionMessage, Cr as resolveStateBucketWithDefaultAndSource, Ct as isUnboundTemplateParameter, D as makeSiblingClaimReader, Dn as DEFAULT_STATE_PREFIX, Dr as CFN_TEMPLATE_BODY_LIMIT, Dt as normalizeAwsTagsToCfn, E as extractDeploymentEventError, En as CUSTOM_RESOURCE_RESPONSE_PREFIX, Er as warnDeprecatedNoPrefixCliFlag, Et as WAFv2WebACLProvider, F as isWarmThroughputDecrease, Fn as stringifyValue, Fr as canonicalizeRegion, Ft as requireConfigArray, G as collectPublishedOutputNames, Gn as getBootstrapMarkerKey, Gt as s3BucketWebsiteUrl, H as red, Hn as BOOTSTRAP_MARKER_PREFIX, Hr as getAwsClients, Ht as s3BucketDomainName, I as toFiniteNumber, In as WorkGraph, Ir as derivePartitionAndUrlSuffix, It as requireConfigObject, J as secretBearing, Jn as readBootstrapMarkerBody, Jr as CrossAccountSecretRefusalError, Jt as INTRINSIC_KEYS, K as exportAliasCollisionScrubWarning, Kn as isCrossRegionRedirect, Kr as CdkdError, Kt as applyRoleArnIfSet, L as formatResourceLine, Ln as buildAssetRedirectMap, Lr as AssemblyReader, Lt as requireConfigString, M as renderStatefulReason, Mn as orphansCarriedFrom, Mr as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Mt as configStringRefusal, N as WARM_THROUGHPUT_MEMBERS, Nn as shouldRetainResource, Nr as expectedOwnerParam, Nt as readConfigString, O as planOrphanAdoption, On as exportNamesCarriedFrom, Or as CFN_TEMPLATE_URL_LIMIT, Ot as resolveExplicitPhysicalId, P as coerceWarmThroughput$1, Pn as AssetPublisher, Pr as PARTITION_TABLE, Pt as replayWarn, Q as IAMRoleProvider, Qn as describeAwsFailure, Qr as IntrinsicResolutionRefusalError, Qt as withRetry, R as bold, Rn as createAssetRedirectResolver, Rr as processStackMessages, Rt as classifyReplaySecretRegion, S as isFinalSnapshotError, Sn as buildForceUnlockCommand, Sr as resolveStateBucketWithDefault, St as getAccountInfo, T as makeCanonicalizePropertiesFn, Tn as shellQuote, Tr as stateBucketExistenceConfirmed, Tt as refStateLookupFromResource, U as yellow, Un as assertAssetBucketRegion, Ur as resetAwsClients, Ut as s3BucketDualStackDomainName, V as green, Vn as AssetModeResolver, Vr as AwsClients, Vt as s3BucketArn, W as collectDeclaredOutputNames, Wn as ensureAssetStorage, Wr as setAwsClients, Wt as s3BucketRegionalDomainName, X as secretSafeKeyDisplay, Xn as validateContainerRepoName, Xr as DeployCancelledError, Xt as findSilentDropProperties, Y as secretBearingStateKeyWarning, Yn as validateAssetBucketName, Yt as findActionableSilentDrops, Z as getCurrentResourceSecrets, Zn as buildDenyExternalAccessPolicy, Zr as DynamicReferenceRegionAmbiguousError, Zt as describeTypeWithThrottleRetry, _ as ATOMIC_FINAL_SNAPSHOT_TYPES, _i as isThrottlingError, _n as scrubResourceRecord, _r as getLegacyStateBucketName, _t as isTerminationProtectionPropagationError, a as DeploymentEventsStore, ai as ResourceTimeoutError, an as carriesSecretMask, ar as getDockerCmd, at as maskerOrIdentity, b as ccRoutedFinalSnapshotError, bi as markRedactedCause, bn as rebuildClientForBucketRegion, br as resolveCaptureObservedState, bt as cfnRefValueFromPhysicalId, c as replayFailedOperations, ci as StackTerminationProtectionError, cn as errorCauseChain, cr as runDockerForeground, ct as interruptWatchListenerCount, d as updatePartialReason, dn as markSameGenerationBag, dr as stripControlChars, dt as CloudControlProvider, ei as LocalStartServiceError, en as TemplateParser, er as describeDockerCapturedOutput, et as clearOnUpdateRemoval, f as withResourceDeadline, fn as maskSecretsInError, fr as AssetManifestLoader, ft as slowCcOperationTimeoutMs, g as bindingSkippedOutputs, gi as isRetryableTransientError, gn as redactSecretsForState, gr as getDefaultStateBucketName, gt as disableInstanceApiTermination, h as computeImplicitDeleteEdges, hi as isMarkedNonRetryable, hn as recoverMaskedOutput, hr as synthesisStatusMessage, ht as deleteSkipReason, i as DeploymentEventsReader, ii as ProvisioningError, in as TEMPLATE_SOURCED_RULES, ir as formatDockerLoginError, it as maskDeep, j as isStatefulRecreateTargetSync, jn as orphansAfterRollback, jr as uploadCfnTemplate, jt as configBooleanRefusal, k as MULTI_REGION_RECREATE_BLOCKED_TYPES, kn as importableOutputKeys, kr as MIGRATE_TMP_PREFIX, kt as assertRegionMatch, l as replayRollback, ln as identityKeyFor, lr as runDockerStreaming, lt as isInterruptedWaitError, m as IMPLICIT_DELETE_DEPENDENCIES, mi as withErrorHandling, mn as recordMaskOnlyValue, mr as Synthesizer, mt as deleteIndeterminateGuards, n as DEFAULT_RESOURCE_WARN_AFTER_MS, ni as NestedStackChildDirectDestroyError, nn as STATE_SOURCED_CROSS_GENERATION_RULES, nr as describeDockerFailure, nt as wouldReturnToSdkProvider, o as planFailedOps, oi as ResourceUpdateNotSupportedError, on as createSecretMasker, or as partitionSensitiveEnv, ot as beginCommandInterruptScope, p as maskingRetryLogger, pi as normalizeAwsError, pn as maskSecretsInText, pr as getDockerImageBySourceHash, pt as UNSPECIFIED_SKIP_REASON, q as isExportAliasCollision, qn as parseBootstrapMarker, qt as DiffCalculator, r as DeployEngine, ri as PartialFailureError, rn as STATE_SOURCED_READBACK_RULES, rr as dockerSpawnEnvWithSensitive, rt as createMaskedRetryLogger, s as planRollback, si as StackHasActiveImportsError, sn as dynamicReferenceTokens, sr as redactDockerArgvValues, st as endCommandInterruptScope, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as STATE_SOURCED_BASELINE_RULES, tr as describeDockerExecFailure, tt as ProviderRegistry, u as updatePartialMessage, un as isSingleDynamicReferenceToken, ur as escapeRegExp, ut as startInterruptWatch, v as PRE_DELETE_SNAPSHOT_TYPES, vi as isTransientServerError, vn as LockManager, vr as resolveApp, vt as IntrinsicFunctionResolver, w as unsupportedFinalSnapshotError, wn as forceQuitRecoveryClause, wr as resolveUseCdkBootstrapAssets, wt as parameterTypeMayLoseSecretIdentity, x as createPreDeleteFinalSnapshot, xi as retryClassificationText, xn as UNRENDERABLE, xr as resolveSkipPrefix, xt as coerceParameterTypedValue, y as buildFinalSnapshotIdentifier, yi as markNonRetryable, yn as S3StateBackend, yr as resolveAutoAssetStorage, yt as carriesDynamicReference, z as cyan, zn as loadPublishableAssetManifest, zt as producerRegionsFromState } from "./deploy-engine-BEpYvI14.js";
|
|
2
|
+
import { _ as withSkipPrefix, c as PATTERN_B_NAME_OPTIONS, f as explicitNamePropertyFor, h as getCurrentStackName, i as reserveStdoutForPayload, l as PATTERN_B_NAME_PROPERTIES, m as generateResourceNameWithFallback, n as getLogger, o as runStackBuffered, p as generateResourceName, s as getLiveRenderer, u as PATTERN_B_RESOURCE_TYPES, v as withStackName, y as displaySafe } from "./logger-CecsQ1UT.js";
|
|
3
3
|
import { t as awsClientDefaults } from "./aws-client-defaults-D-iYiIJ6.js";
|
|
4
|
-
import { t as getCdkdVersion } from "./version-
|
|
5
|
-
import { r as protectedReplacementAdvice, t as ASGProvider } from "./asg-provider-
|
|
4
|
+
import { t as getCdkdVersion } from "./version-C3wRsCF2.js";
|
|
5
|
+
import { r as protectedReplacementAdvice, t as ASGProvider } from "./asg-provider-CpxZ9sVH.js";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
8
8
|
import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, NotFound, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
@@ -24334,9 +24334,12 @@ var SecretsManagerSecretProvider = class {
|
|
|
24334
24334
|
});
|
|
24335
24335
|
try {
|
|
24336
24336
|
let secretString;
|
|
24337
|
-
const
|
|
24338
|
-
if (
|
|
24339
|
-
|
|
24337
|
+
const rawGenerate = properties["GenerateSecretString"];
|
|
24338
|
+
if (rawGenerate != null) {
|
|
24339
|
+
const generateConfig = requireConfigObject(rawGenerate, "AWS::SecretsManager::Secret GenerateSecretString");
|
|
24340
|
+
secretString = this.generateSecretString(generateConfig);
|
|
24341
|
+
} else if (properties["SecretString"] !== void 0 && properties["SecretString"] !== "") secretString = requireSecretStringShape(properties["SecretString"]);
|
|
24342
|
+
if (secretString === void 0) this.logger.warn(`AWS::SecretsManager::Secret ${logicalId} declares no secret value (neither GenerateSecretString nor a non-empty SecretString); the secret is created with NO version. Consumers reading it will fail until a value is set.`);
|
|
24340
24343
|
const createParams = { Name: name };
|
|
24341
24344
|
if (secretString) createParams.SecretString = secretString;
|
|
24342
24345
|
if (properties["Description"]) createParams.Description = properties["Description"];
|
|
@@ -24365,7 +24368,7 @@ var SecretsManagerSecretProvider = class {
|
|
|
24365
24368
|
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
24366
24369
|
this.logger.debug(`Updating secret ${logicalId}: ${physicalId}`);
|
|
24367
24370
|
try {
|
|
24368
|
-
const secretString = this.changedSecretValue(properties, previousProperties);
|
|
24371
|
+
const { value: secretString, skippedGenerate } = this.changedSecretValue(properties, previousProperties);
|
|
24369
24372
|
const updateParams = { SecretId: physicalId };
|
|
24370
24373
|
if (secretString !== void 0) updateParams.SecretString = secretString;
|
|
24371
24374
|
const description = clearOnUpdateRemoval(properties["Description"], previousProperties["Description"], "");
|
|
@@ -24420,7 +24423,8 @@ var SecretsManagerSecretProvider = class {
|
|
|
24420
24423
|
return {
|
|
24421
24424
|
physicalId,
|
|
24422
24425
|
wasReplaced: false,
|
|
24423
|
-
attributes: { Id: physicalId }
|
|
24426
|
+
attributes: { Id: physicalId },
|
|
24427
|
+
effectiveProperties: skippedGenerate ? this.retainPreviousGenerateBlock(logicalId, properties, previousProperties) : void 0
|
|
24424
24428
|
};
|
|
24425
24429
|
} catch (error) {
|
|
24426
24430
|
const cause = error instanceof Error ? error : void 0;
|
|
@@ -24450,8 +24454,47 @@ var SecretsManagerSecretProvider = class {
|
|
|
24450
24454
|
}
|
|
24451
24455
|
}
|
|
24452
24456
|
/**
|
|
24453
|
-
* The
|
|
24454
|
-
*
|
|
24457
|
+
* The bag to RECORD when the generate block was skipped: the desired
|
|
24458
|
+
* properties with `GenerateSecretString` restored to the previously-applied
|
|
24459
|
+
* value, or with the key dropped when the previous side cannot be vouched
|
|
24460
|
+
* for either.
|
|
24461
|
+
*
|
|
24462
|
+
* Validated through `requireConfigObject` — the same predicate the wire read
|
|
24463
|
+
* runs — rather than a hand-written `typeof` twin, so the two cannot
|
|
24464
|
+
* disagree about a blank string, an explicit null or an intrinsic. The
|
|
24465
|
+
* retained block is COPIED, not aliased: both engine consumers spread the
|
|
24466
|
+
* answer one level deep only (the #1653 review rule).
|
|
24467
|
+
*
|
|
24468
|
+
* The DROP is announced rather than silent (the #1654 rule: dropping a key
|
|
24469
|
+
* moves a hazard unless something still says so). A record carrying
|
|
24470
|
+
* neither value source later reaches the reverse-replacement replay-create,
|
|
24471
|
+
* where `create()` — which cannot see the record's history — would create
|
|
24472
|
+
* the secret with NO version; the warning here is what makes that record
|
|
24473
|
+
* diagnosable, and `create()` warns again when it meets one.
|
|
24474
|
+
*
|
|
24475
|
+
* One shape is announced rather than reconciled: a secret created from a
|
|
24476
|
+
* LITERAL whose template then switches to a malformed generate block. The
|
|
24477
|
+
* previous side has no block, so the key is dropped, and the record then
|
|
24478
|
+
* carries neither source while AWS still holds the literal. Restoring the
|
|
24479
|
+
* previous `SecretString` would be the #1612 answer, but it re-records a
|
|
24480
|
+
* literal the template has REMOVED; the drop keeps the next deploy of the
|
|
24481
|
+
* same template an announced UPDATE (desired block vs absent), which is the
|
|
24482
|
+
* loud outcome this arm exists for.
|
|
24483
|
+
*/
|
|
24484
|
+
retainPreviousGenerateBlock(logicalId, properties, previousProperties) {
|
|
24485
|
+
const usablePrevious = requireConfigObject(previousProperties["GenerateSecretString"], "AWS::SecretsManager::Secret GenerateSecretString", { onUnusable: () => {} });
|
|
24486
|
+
const effective = { ...properties };
|
|
24487
|
+
if (usablePrevious === void 0) {
|
|
24488
|
+
delete effective["GenerateSecretString"];
|
|
24489
|
+
this.logger.warn(`AWS::SecretsManager::Secret ${logicalId}: GenerateSecretString is dropped from the recorded properties. The desired block is unusable and the previously recorded one is absent or unusable, so the record now carries no GenerateSecretString; fix the template so the next deploy records one.`);
|
|
24490
|
+
} else effective["GenerateSecretString"] = { ...usablePrevious };
|
|
24491
|
+
return effective;
|
|
24492
|
+
}
|
|
24493
|
+
/**
|
|
24494
|
+
* The `SecretString` an in-place update must send (as `value`), or
|
|
24495
|
+
* `undefined` when the value's SOURCE is unchanged (issue #2472) or when a
|
|
24496
|
+
* malformed `GenerateSecretString` block was SKIPPED (issue #3048,
|
|
24497
|
+
* `skippedGenerate: true` — the caller records the previous block instead).
|
|
24455
24498
|
*
|
|
24456
24499
|
* The source is `GenerateSecretString` when present (CloudFormation gives it
|
|
24457
24500
|
* precedence over a literal) and `SecretString` otherwise. A generated value
|
|
@@ -24524,15 +24567,37 @@ var SecretsManagerSecretProvider = class {
|
|
|
24524
24567
|
* template.
|
|
24525
24568
|
*/
|
|
24526
24569
|
changedSecretValue(properties, previousProperties) {
|
|
24527
|
-
const
|
|
24528
|
-
if (
|
|
24570
|
+
const rawGenerate = properties["GenerateSecretString"];
|
|
24571
|
+
if (rawGenerate != null) {
|
|
24572
|
+
const generateConfig = rawGenerate;
|
|
24529
24573
|
const previous = previousProperties["GenerateSecretString"];
|
|
24530
|
-
|
|
24574
|
+
if (isDeepStrictEqual(asJson(generateConfig), asJson(previous)) || isDeepStrictEqual(asJson(this.asPersisted(generateConfig)), asJson(previous))) return {
|
|
24575
|
+
value: void 0,
|
|
24576
|
+
skippedGenerate: false
|
|
24577
|
+
};
|
|
24578
|
+
const usable = requireConfigObject(generateConfig, "AWS::SecretsManager::Secret GenerateSecretString", { onUnusable: (m) => this.logger.warn(`${m} No new secret value is generated; the secret keeps the value AWS currently holds.`) });
|
|
24579
|
+
if (usable === void 0) return {
|
|
24580
|
+
value: void 0,
|
|
24581
|
+
skippedGenerate: true
|
|
24582
|
+
};
|
|
24583
|
+
return {
|
|
24584
|
+
value: this.generateSecretString(usable),
|
|
24585
|
+
skippedGenerate: false
|
|
24586
|
+
};
|
|
24531
24587
|
}
|
|
24532
24588
|
const literal = properties["SecretString"];
|
|
24533
|
-
if (literal === void 0) return
|
|
24534
|
-
|
|
24535
|
-
|
|
24589
|
+
if (literal === void 0) return {
|
|
24590
|
+
value: void 0,
|
|
24591
|
+
skippedGenerate: false
|
|
24592
|
+
};
|
|
24593
|
+
if (isDeepStrictEqual(asJson(literal), asJson(previousProperties["SecretString"]))) return {
|
|
24594
|
+
value: void 0,
|
|
24595
|
+
skippedGenerate: false
|
|
24596
|
+
};
|
|
24597
|
+
return {
|
|
24598
|
+
value: requireSecretStringShape(literal),
|
|
24599
|
+
skippedGenerate: false
|
|
24600
|
+
};
|
|
24536
24601
|
}
|
|
24537
24602
|
/**
|
|
24538
24603
|
* `bag` as the state writer would persist it: every plaintext this
|
|
@@ -74401,6 +74466,22 @@ function isPhase2CreatableType(resourceType) {
|
|
|
74401
74466
|
return isCustomResourceType(resourceType);
|
|
74402
74467
|
}
|
|
74403
74468
|
/**
|
|
74469
|
+
* One spelling of "this value came from an S3 key or a state record, and is
|
|
74470
|
+
* about to be interpolated into a message a terminal will render" (issue
|
|
74471
|
+
* #3003). `cdkd state show --show-nested` reaches the walker's refusals below,
|
|
74472
|
+
* and cdkd's output is line-oriented, so an unsanitized value invents a line
|
|
74473
|
+
* that reads like a row. A `logicalId` is a KEY of the record body -- CloudFormation
|
|
74474
|
+
* constrains a logical id, but nothing enforces that on a record read back
|
|
74475
|
+
* from S3, and it is half of the child stack name derived from it.
|
|
74476
|
+
*
|
|
74477
|
+
* Module-scoped rather than local to the walker: the first cut of this change
|
|
74478
|
+
* guarded the walker's two refusals and left the root one, which is the shape
|
|
74479
|
+
* the issue is about.
|
|
74480
|
+
*/
|
|
74481
|
+
function safeSegment(value) {
|
|
74482
|
+
return displaySafe(value, { asciiOnly: true }) || "<unrenderable>";
|
|
74483
|
+
}
|
|
74484
|
+
/**
|
|
74404
74485
|
* Recursively load the cdkd-state tree rooted at `(rootStackName, region)`.
|
|
74405
74486
|
* For every `AWS::CloudFormation::Stack` row in each level's
|
|
74406
74487
|
* `state.resources`, derives the child's v6 state key
|
|
@@ -74436,7 +74517,7 @@ async function buildCdkdStateStackTree(rootStackName, region, stateBackend, pref
|
|
|
74436
74517
|
if (prefetchedRootState !== void 0) rootState = prefetchedRootState;
|
|
74437
74518
|
else {
|
|
74438
74519
|
const rootResult = await stateBackend.getState(rootStackName, region);
|
|
74439
|
-
if (!rootResult) throw new Error(`No cdkd state found for stack '${rootStackName}' (${region}). Cannot build nested-stack tree.`);
|
|
74520
|
+
if (!rootResult) throw new Error(`No cdkd state found for stack '${safeSegment(rootStackName)}' (${safeSegment(region)}). Cannot build nested-stack tree.`);
|
|
74440
74521
|
rootState = rootResult.state;
|
|
74441
74522
|
}
|
|
74442
74523
|
return walkCdkdStateStackTree(rootStackName, region, rootState, stateBackend);
|
|
@@ -74447,8 +74528,8 @@ async function walkCdkdStateStackTree(stackName, region, state, stateBackend) {
|
|
|
74447
74528
|
if (resource.resourceType !== "AWS::CloudFormation::Stack") continue;
|
|
74448
74529
|
const childStackName = `${stackName}~${logicalId}`;
|
|
74449
74530
|
const childResult = await stateBackend.getState(childStackName, region);
|
|
74450
|
-
if (!childResult) throw new Error(`cdkd state is missing nested-child '${childStackName}' (${region}). Parent stack '${stackName}' lists '${logicalId}' as an ${NESTED_STACK_RESOURCE_TYPE} row but no child state file exists at 'cdkd/${childStackName}/${region}/state.json'. The cdkd state tree is inconsistent — re-deploy the parent stack to refresh, or run 'cdkd state orphan ${stackName}' and re-import.`);
|
|
74451
|
-
if (childResult.state.region !== void 0 && childResult.state.region !== region) throw new Error(`cdkd state region mismatch: nested-child '${childStackName}' has state.region='${childResult.state.region}' but its parent '${stackName}' is being walked against region='${region}'. AWS does not support cross-region nested stacks; the state tree appears corrupt — re-deploy the parent stack to refresh.`);
|
|
74531
|
+
if (!childResult) throw new Error(`cdkd state is missing nested-child '${safeSegment(childStackName)}' (${safeSegment(region)}). Parent stack '${safeSegment(stackName)}' lists '${safeSegment(logicalId)}' as an ${NESTED_STACK_RESOURCE_TYPE} row but no child state file exists at 'cdkd/${safeSegment(childStackName)}/${safeSegment(region)}/state.json'. The cdkd state tree is inconsistent — re-deploy the parent stack to refresh, or run 'cdkd state orphan ${safeSegment(stackName)}' and re-import.`);
|
|
74532
|
+
if (childResult.state.region !== void 0 && childResult.state.region !== region) throw new Error(`cdkd state region mismatch: nested-child '${safeSegment(childStackName)}' has state.region='${safeSegment(childResult.state.region)}' but its parent '${safeSegment(stackName)}' is being walked against region='${safeSegment(region)}'. AWS does not support cross-region nested stacks; the state tree appears corrupt — re-deploy the parent stack to refresh.`);
|
|
74452
74533
|
nestedChildren.set(logicalId, await walkCdkdStateStackTree(childStackName, region, childResult.state, stateBackend));
|
|
74453
74534
|
}
|
|
74454
74535
|
return {
|
|
@@ -76501,8 +76582,34 @@ function formatStackRef(ref) {
|
|
|
76501
76582
|
* `()` would read as "no region" rather than "a region cdkd will not print".
|
|
76502
76583
|
*/
|
|
76503
76584
|
function formatStackRefSafe(ref) {
|
|
76504
|
-
|
|
76505
|
-
|
|
76585
|
+
return ref.region ? `${safe(ref.stackName)} (${safe(ref.region)})` : safe(ref.stackName);
|
|
76586
|
+
}
|
|
76587
|
+
/**
|
|
76588
|
+
* One spelling of "this value came from an S3 key or a state record, and is
|
|
76589
|
+
* about to be interpolated into a message a terminal will render".
|
|
76590
|
+
*
|
|
76591
|
+
* Call it for a stack name or a region. NOT every refusal in this file goes
|
|
76592
|
+
* through it, and this comment does not say which do -- `grep safe(` answers
|
|
76593
|
+
* it exactly. The sentence that used to sit here claimed all of them, and
|
|
76594
|
+
* three sites in `state destroy` / `state refresh-observed` disprove it by
|
|
76595
|
+
* interpolating a `listStacks()` region raw (go-to-k/cdkd#3027). That is the
|
|
76596
|
+
* same over-claiming shape `lock-manager.ts`'s twin helper records having got
|
|
76597
|
+
* wrong three times.
|
|
76598
|
+
*
|
|
76599
|
+
* It exists as one function rather than the expression repeated per site
|
|
76600
|
+
* because the failure this closes WAS the repeated form: issue #2772 guarded
|
|
76601
|
+
* the rendered rows and left the refusals, and the first cut of #3003 guarded
|
|
76602
|
+
* three refusals and left four more in these same two commands. A value
|
|
76603
|
+
* reaching a message is the population, not a list of call sites.
|
|
76604
|
+
*
|
|
76605
|
+
* `asciiOnly` because the population has a known charset — CloudFormation
|
|
76606
|
+
* constrains a stack name and AWS constrains a region, so the allowlist is a
|
|
76607
|
+
* no-op on every legitimate input while an S3 key admits any UTF-8. Free-form
|
|
76608
|
+
* text (a parser's own message, an AWS error) takes the denylist class
|
|
76609
|
+
* instead; `display-safe.ts`'s header draws that line.
|
|
76610
|
+
*/
|
|
76611
|
+
function safe(value) {
|
|
76612
|
+
return displaySafe(value, { asciiOnly: true }) || "<unrenderable>";
|
|
76506
76613
|
}
|
|
76507
76614
|
/**
|
|
76508
76615
|
* Resolve a stack name + optional region flag against the `listStacks` index
|
|
@@ -76512,18 +76619,18 @@ function formatStackRefSafe(ref) {
|
|
|
76512
76619
|
*/
|
|
76513
76620
|
function resolveSingleRegion(stackName, refs, requestedRegion) {
|
|
76514
76621
|
const matches = refs.filter((r) => r.stackName === stackName);
|
|
76515
|
-
if (matches.length === 0) throw new Error(`No state found for stack '${stackName}'. Run 'cdkd state list' to see available stacks.`);
|
|
76622
|
+
if (matches.length === 0) throw new Error(`No state found for stack '${safe(stackName)}'. Run 'cdkd state list' to see available stacks.`);
|
|
76516
76623
|
if (requestedRegion) {
|
|
76517
76624
|
const ref = matches.find((r) => r.region === requestedRegion);
|
|
76518
76625
|
if (!ref) {
|
|
76519
|
-
const seen = matches.map((r) => r.region
|
|
76520
|
-
throw new Error(`No state found for stack '${stackName}' in region '${requestedRegion}'. Available regions: ${seen}.`);
|
|
76626
|
+
const seen = matches.map((r) => r.region === void 0 ? "(legacy)" : safe(r.region));
|
|
76627
|
+
throw new Error(`No state found for stack '${safe(stackName)}' in region '${safe(requestedRegion)}'. Available regions: ${seen.join(", ")}.`);
|
|
76521
76628
|
}
|
|
76522
76629
|
return ref;
|
|
76523
76630
|
}
|
|
76524
76631
|
if (matches.length === 1) return matches[0];
|
|
76525
|
-
const regions = matches.map((r) => r.region
|
|
76526
|
-
throw new Error(`Stack '${stackName}' has state in multiple regions: ${regions}. Re-run with --stack-region <region> to disambiguate.`);
|
|
76632
|
+
const regions = matches.map((r) => r.region === void 0 ? "(legacy)" : safe(r.region));
|
|
76633
|
+
throw new Error(`Stack '${safe(stackName)}' has state in multiple regions: ${regions.join(", ")}. Re-run with --stack-region <region> to disambiguate.`);
|
|
76527
76634
|
}
|
|
76528
76635
|
/**
|
|
76529
76636
|
* Shared bootstrap for every `state` subcommand: build the AWS clients,
|
|
@@ -76744,9 +76851,9 @@ async function stateResourcesCommand(stackName, options) {
|
|
|
76744
76851
|
const setup = await setupStateBackend(options);
|
|
76745
76852
|
try {
|
|
76746
76853
|
const ref = resolveSingleRegion(stackName, await setup.stateBackend.listStacks(), options.stackRegion);
|
|
76747
|
-
if (!ref.region) throw new Error(`Stack '${stackName}' has only a legacy state record without a region. Run 'cdkd deploy ${stackName}' (or any cdkd write) to migrate it to the region-scoped layout, then re-run this command.`);
|
|
76854
|
+
if (!ref.region) throw new Error(`Stack '${safe(stackName)}' has only a legacy state record without a region. Run 'cdkd deploy ${safe(stackName)}' (or any cdkd write) to migrate it to the region-scoped layout, then re-run this command.`);
|
|
76748
76855
|
const stateResult = await setup.stateBackend.getState(stackName, ref.region);
|
|
76749
|
-
if (!stateResult) throw new Error(`No state found for stack '${stackName}' (${ref.region}) in s3://${setup.bucket}/${setup.prefix}/. Run 'cdkd state list' to see available stacks.`);
|
|
76856
|
+
if (!stateResult) throw new Error(`No state found for stack '${safe(stackName)}' (${safe(ref.region)}) in s3://${setup.bucket}/${setup.prefix}/. Run 'cdkd state list' to see available stacks.`);
|
|
76750
76857
|
const resources = stateResult.state.resources ?? {};
|
|
76751
76858
|
const details = Object.entries(resources).map(([logicalId, resource]) => ({
|
|
76752
76859
|
logicalId,
|
|
@@ -76951,9 +77058,9 @@ async function stateShowCommand(stackName, options) {
|
|
|
76951
77058
|
const setup = await setupStateBackend(options);
|
|
76952
77059
|
try {
|
|
76953
77060
|
const ref = resolveSingleRegion(stackName, await setup.stateBackend.listStacks(), options.stackRegion);
|
|
76954
|
-
if (!ref.region) throw new Error(`Stack '${stackName}' has only a legacy state record without a region. Run 'cdkd deploy ${stackName}' (or any cdkd write) to migrate it to the region-scoped layout, then re-run this command.`);
|
|
77061
|
+
if (!ref.region) throw new Error(`Stack '${safe(stackName)}' has only a legacy state record without a region. Run 'cdkd deploy ${safe(stackName)}' (or any cdkd write) to migrate it to the region-scoped layout, then re-run this command.`);
|
|
76955
77062
|
const [stateResult, lockInfo] = await Promise.all([setup.stateBackend.getState(stackName, ref.region), setup.lockManager.getLockInfo(stackName, ref.region)]);
|
|
76956
|
-
if (!stateResult) throw new Error(`No state found for stack '${stackName}' (${ref.region}) in s3://${setup.bucket}/${setup.prefix}/. Run 'cdkd state list' to see available stacks.`);
|
|
77063
|
+
if (!stateResult) throw new Error(`No state found for stack '${safe(stackName)}' (${safe(ref.region)}) in s3://${setup.bucket}/${setup.prefix}/. Run 'cdkd state list' to see available stacks.`);
|
|
76957
77064
|
if (options.showNested) {
|
|
76958
77065
|
const treeWithLocks = await loadLocksForTree(await buildCdkdStateStackTree(stackName, ref.region, setup.stateBackend, stateResult.state), setup.lockManager, lockInfo);
|
|
76959
77066
|
if (options.json) {
|
|
@@ -81957,7 +82064,7 @@ async function resolveImportedProperties(stackState, template, region, stateBack
|
|
|
81957
82064
|
...baseContext,
|
|
81958
82065
|
recordedSecretValues
|
|
81959
82066
|
});
|
|
81960
|
-
resource.properties = recordedSecretValues.size > 0 ? redactSecretsForState(resolved, recordedSecretValues, unresolvedProperties) : resolved;
|
|
82067
|
+
resource.properties = recordedSecretValues.size > 0 ? redactSecretsForState(markSameGenerationBag(resolved), recordedSecretValues, unresolvedProperties) : resolved;
|
|
81961
82068
|
} catch (err) {
|
|
81962
82069
|
logger.warn(`Failed to resolve intrinsics in Properties for imported resource '${logicalId}' (${resource.resourceType}): ${maskSecretsInText(err instanceof Error ? err.message : String(err), recordedSecretValues)}. State will be written with the raw intrinsic shape, which may cause 'cdkd destroy' to fail on this resource — re-import once every referenced sibling is in state, or remove this resource via 'cdkd state orphan'.` + (unboundParameterNames.length > 0 ? ` This template also declares parameter(s) with no 'Default' that an import cannot bind (${unboundParameterNames.join(", ")}), and 'cdkd import' accepts no parameter values — if this property was built from one of those, re-importing a sibling will not change it: give the parameter a 'Default' in the template and re-import, or correct the recorded properties before the next 'cdkd deploy'.` : ""));
|
|
81963
82070
|
threw = true;
|
|
@@ -91753,4 +91860,4 @@ function buildProgram() {
|
|
|
91753
91860
|
|
|
91754
91861
|
//#endregion
|
|
91755
91862
|
export { buildProgram };
|
|
91756
|
-
//# sourceMappingURL=program-
|
|
91863
|
+
//# sourceMappingURL=program-CyIOIvtX.js.map
|