@go-to-k/cdkd 0.284.65 → 0.284.67
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-CNwOmQGg.js → asg-provider-fy2cEq7m.js} +3 -3
- package/dist/{asg-provider-CNwOmQGg.js.map → asg-provider-fy2cEq7m.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-52VBVCWI.js → deploy-engine-wrIe6cV6.js} +4 -4
- package/dist/{deploy-engine-52VBVCWI.js.map → deploy-engine-wrIe6cV6.js.map} +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{logger-zRrlbaQt.js → logger-C9-E73FI.js} +52 -2
- package/dist/{logger-zRrlbaQt.js.map → logger-C9-E73FI.js.map} +1 -1
- package/dist/{program-BfK9a98r.js → program-BkUhF3Bf.js} +74 -29
- package/dist/{program-BfK9a98r.js.map → program-BkUhF3Bf.js.map} +1 -1
- package/dist/{version-BtkYYOb6.js → version-DNFFsbnH.js} +2 -2
- package/dist/{version-BtkYYOb6.js.map → version-DNFFsbnH.js.map} +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as maskerOrIdentity, $n as findLargeInlineResources, $t as TemplateParser, A as renderStatefulReason, An as formatDockerLoginError, Ar as StackHasActiveImportsError, At as STATE_SOURCED_READBACK_RULES, B as exportAliasCollisionScrubWarning, Bn as getLegacyStateBucketName, Br as isThrottlingError, Bt as classifyReplaySecretRegion, C as isFinalSnapshotError, Cn as parseBootstrapMarker, Ct as configStringRefusal, D as extractDeploymentEventError, Dn as buildDenyExternalAccessPolicy, Dr as ProvisioningError, Dt as requireConfigObject, E as makeCanonicalizePropertiesFn, En as validateContainerRepoName, Er as PartialFailureError, Et as requireConfigArray, F as green, Fn as AssetManifestLoader, Ft as isSingleDynamicReferenceToken, G as IAMRoleProvider, Gn as resolveStateBucketWithDefault, Gt as s3BucketRegionalDomainName, H as secretBearingStateKeyWarning, Hn as resolveAutoAssetStorage, Ht as s3BucketArn, I as red, In as getDockerImageBySourceHash, Ir as normalizeAwsError, It as maskSecretsInError, J as ProviderRegistry, Jn as stateBucketExistenceConfirmed, Jt as DiffCalculator, K as collectInlinePolicyNamesManagedBySiblings, Kn as resolveStateBucketWithDefaultAndSource, Kt as s3BucketWebsiteUrl, L as yellow, Ln as Synthesizer, Lr as withErrorHandling, Lt as maskSecretsInText, M as bold, Mn as partitionSensitiveEnv, Mt as createSecretMasker, N as cyan, Nn as runDockerForeground, Nt as dynamicReferenceTokens, O as MULTI_REGION_RECREATE_BLOCKED_TYPES, On as buildDockerImage, Or as ResourceTimeoutError, Ot as requireConfigString, P as gray, Pn as runDockerStreaming, Pt as errorCauseChain, Q as maskDeep, Qn as MIGRATE_TMP_PREFIX, Qt as DagBuilder, R as collectDeclaredOutputNames, Rn as synthesisStatusMessage, Rr as isMarkedNonRetryable, Rt as redactSecretsForState, S as createPreDeleteFinalSnapshot, Sn as isCrossRegionRedirect, Sr as LocalStartServiceError, St as configBooleanRefusal, T as unsupportedFinalSnapshotError, Tn as validateAssetBucketName, Tr as NestedStackChildDirectDestroyError, Tt as replayWarn, U as stateKeySecretExposure, Un as resolveCaptureObservedState, Ut as s3BucketDomainName, V as isExportAliasCollision, Vn as resolveApp, Vr as markNonRetryable, Vt as producerRegionsFromState, W as getCurrentResourceSecrets, Wn as resolveSkipPrefix, Wt as s3BucketDualStackDomainName, X as findSilentDropProperties, Xn as CFN_TEMPLATE_BODY_LIMIT, Xt as describeTypeWithThrottleRetry, Y as findActionableSilentDrops, Yn as warnDeprecatedNoPrefixCliFlag, Yt as INTRINSIC_KEYS, Z as createMaskedRetryLogger, Zn as CFN_TEMPLATE_URL_LIMIT, Zt as withRetry, _ as computeImplicitDeleteEdges, _n as AssetModeResolver, _t as WAFv2WebACLProvider, a as DeploymentEventsStore, an as importableOutputKeys, ar as AssemblyReader, at as isInterruptedWaitError, b as buildFinalSnapshotIdentifier, bn as ensureAssetStorage, br as LocalInvokeBuildError$1, bt as assertRegionMatch, c as replayFailedOperations, cn as AssetPublisher, cr as resolveBucketRegion, ct as slowCcOperationTimeoutMs, d as updatePartialReason, dn as buildAssetRedirectMap, dr as resetAwsClients, dt as IntrinsicFunctionResolver, en as LockManager, er as uploadCfnTemplate, et as CUSTOM_RESOURCE_RESPONSE_PREFIX, f as UNSPECIFIED_SKIP_REASON, fn as createAssetRedirectResolver, fr as setAwsClients, ft as carriesDynamicReference, g as IMPLICIT_DELETE_DEPENDENCIES, gn as stripControlChars, gr as CrossAccountSecretRefusalError, gt as refStateLookupFromResource, h as maskingRetryLogger, hn as escapeRegExp, ht as parameterTypeMayLoseSecretIdentity, i as DeploymentEventsReader, in as exportNamesCarriedFrom, ir as derivePartitionAndUrlSuffix, it as interruptWatchListenerCount, j as formatResourceLine, jn as getDockerCmd, jr as StackTerminationProtectionError, jt as TEMPLATE_SOURCED_RULES, k as isStatefulRecreateTargetSync, kn as dockerSpawnEnvWithSensitive, kr as ResourceUpdateNotSupportedError, kt as STATE_SOURCED_CROSS_GENERATION_RULES, l as replayRollback, ln as stringifyValue, lr as AwsClients, lt as disableInstanceApiTermination, m as withResourceDeadline, mn as rewriteTemplateAssetReferences, mr as CdkdError, mt as getAccountInfo, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as S3StateBackend, nr as PARTITION_TABLE, nt as beginCommandInterruptScope, o as planFailedOps, on as importableOutputs, or as processStackMessages, ot as startInterruptWatch, p as deleteSkipReason, pn as loadPublishableAssetManifest, pt as cfnRefValueFromPhysicalId, q as clearOnUpdateRemoval, qn as resolveUseCdkBootstrapAssets, qt as applyRoleArnIfSet, r as DeployEngine, rn as rebuildClientForBucketRegion, rr as canonicalizeRegion, rt as endCommandInterruptScope, s as planRollback, sn as shouldRetainResource, st as CloudControlProvider, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as displaySafe, tr as expectedOwnerParam, tt as DEFAULT_STATE_PREFIX, u as updatePartialMessage, un as WorkGraph, ur as getAwsClients, ut as isTerminationProtectionPropagationError, v as ATOMIC_FINAL_SNAPSHOT_TYPES, vn as BOOTSTRAP_MARKER_PREFIX, vr as DeployCancelledError, vt as normalizeAwsTagsToCfn, w as refusesFinalSnapshot, wn as readBootstrapMarkerBody, wr as MissingCdkCliError, wt as readConfigString, x as ccRoutedFinalSnapshotError, xn as getBootstrapMarkerKey, xr as LocalMigrateError, xt as coerceCfnBoolean, y as PRE_DELETE_SNAPSHOT_TYPES, yn as assertAssetBucketRegion, yr as DynamicReferenceRegionAmbiguousError, yt as resolveExplicitPhysicalId, z as collectPublishedOutputNames, zn as getDefaultStateBucketName, zr as isRetryableTransientError, zt as scrubResourceRecord } from "./deploy-engine-
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as getCdkdVersion } from "./version-
|
|
4
|
-
import { t as ASGProvider } from "./asg-provider-
|
|
1
|
+
import { $ as maskerOrIdentity, $n as findLargeInlineResources, $t as TemplateParser, A as renderStatefulReason, An as formatDockerLoginError, Ar as StackHasActiveImportsError, At as STATE_SOURCED_READBACK_RULES, B as exportAliasCollisionScrubWarning, Bn as getLegacyStateBucketName, Br as isThrottlingError, Bt as classifyReplaySecretRegion, C as isFinalSnapshotError, Cn as parseBootstrapMarker, Ct as configStringRefusal, D as extractDeploymentEventError, Dn as buildDenyExternalAccessPolicy, Dr as ProvisioningError, Dt as requireConfigObject, E as makeCanonicalizePropertiesFn, En as validateContainerRepoName, Er as PartialFailureError, Et as requireConfigArray, F as green, Fn as AssetManifestLoader, Ft as isSingleDynamicReferenceToken, G as IAMRoleProvider, Gn as resolveStateBucketWithDefault, Gt as s3BucketRegionalDomainName, H as secretBearingStateKeyWarning, Hn as resolveAutoAssetStorage, Ht as s3BucketArn, I as red, In as getDockerImageBySourceHash, Ir as normalizeAwsError, It as maskSecretsInError, J as ProviderRegistry, Jn as stateBucketExistenceConfirmed, Jt as DiffCalculator, K as collectInlinePolicyNamesManagedBySiblings, Kn as resolveStateBucketWithDefaultAndSource, Kt as s3BucketWebsiteUrl, L as yellow, Ln as Synthesizer, Lr as withErrorHandling, Lt as maskSecretsInText, M as bold, Mn as partitionSensitiveEnv, Mt as createSecretMasker, N as cyan, Nn as runDockerForeground, Nt as dynamicReferenceTokens, O as MULTI_REGION_RECREATE_BLOCKED_TYPES, On as buildDockerImage, Or as ResourceTimeoutError, Ot as requireConfigString, P as gray, Pn as runDockerStreaming, Pt as errorCauseChain, Q as maskDeep, Qn as MIGRATE_TMP_PREFIX, Qt as DagBuilder, R as collectDeclaredOutputNames, Rn as synthesisStatusMessage, Rr as isMarkedNonRetryable, Rt as redactSecretsForState, S as createPreDeleteFinalSnapshot, Sn as isCrossRegionRedirect, Sr as LocalStartServiceError, St as configBooleanRefusal, T as unsupportedFinalSnapshotError, Tn as validateAssetBucketName, Tr as NestedStackChildDirectDestroyError, Tt as replayWarn, U as stateKeySecretExposure, Un as resolveCaptureObservedState, Ut as s3BucketDomainName, V as isExportAliasCollision, Vn as resolveApp, Vr as markNonRetryable, Vt as producerRegionsFromState, W as getCurrentResourceSecrets, Wn as resolveSkipPrefix, Wt as s3BucketDualStackDomainName, X as findSilentDropProperties, Xn as CFN_TEMPLATE_BODY_LIMIT, Xt as describeTypeWithThrottleRetry, Y as findActionableSilentDrops, Yn as warnDeprecatedNoPrefixCliFlag, Yt as INTRINSIC_KEYS, Z as createMaskedRetryLogger, Zn as CFN_TEMPLATE_URL_LIMIT, Zt as withRetry, _ as computeImplicitDeleteEdges, _n as AssetModeResolver, _t as WAFv2WebACLProvider, a as DeploymentEventsStore, an as importableOutputKeys, ar as AssemblyReader, at as isInterruptedWaitError, b as buildFinalSnapshotIdentifier, bn as ensureAssetStorage, br as LocalInvokeBuildError$1, bt as assertRegionMatch, c as replayFailedOperations, cn as AssetPublisher, cr as resolveBucketRegion, ct as slowCcOperationTimeoutMs, d as updatePartialReason, dn as buildAssetRedirectMap, dr as resetAwsClients, dt as IntrinsicFunctionResolver, en as LockManager, er as uploadCfnTemplate, et as CUSTOM_RESOURCE_RESPONSE_PREFIX, f as UNSPECIFIED_SKIP_REASON, fn as createAssetRedirectResolver, fr as setAwsClients, ft as carriesDynamicReference, g as IMPLICIT_DELETE_DEPENDENCIES, gn as stripControlChars, gr as CrossAccountSecretRefusalError, gt as refStateLookupFromResource, h as maskingRetryLogger, hn as escapeRegExp, ht as parameterTypeMayLoseSecretIdentity, i as DeploymentEventsReader, in as exportNamesCarriedFrom, ir as derivePartitionAndUrlSuffix, it as interruptWatchListenerCount, j as formatResourceLine, jn as getDockerCmd, jr as StackTerminationProtectionError, jt as TEMPLATE_SOURCED_RULES, k as isStatefulRecreateTargetSync, kn as dockerSpawnEnvWithSensitive, kr as ResourceUpdateNotSupportedError, kt as STATE_SOURCED_CROSS_GENERATION_RULES, l as replayRollback, ln as stringifyValue, lr as AwsClients, lt as disableInstanceApiTermination, m as withResourceDeadline, mn as rewriteTemplateAssetReferences, mr as CdkdError, mt as getAccountInfo, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as S3StateBackend, nr as PARTITION_TABLE, nt as beginCommandInterruptScope, o as planFailedOps, on as importableOutputs, or as processStackMessages, ot as startInterruptWatch, p as deleteSkipReason, pn as loadPublishableAssetManifest, pt as cfnRefValueFromPhysicalId, q as clearOnUpdateRemoval, qn as resolveUseCdkBootstrapAssets, qt as applyRoleArnIfSet, r as DeployEngine, rn as rebuildClientForBucketRegion, rr as canonicalizeRegion, rt as endCommandInterruptScope, s as planRollback, sn as shouldRetainResource, st as CloudControlProvider, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as displaySafe, tr as expectedOwnerParam, tt as DEFAULT_STATE_PREFIX, u as updatePartialMessage, un as WorkGraph, ur as getAwsClients, ut as isTerminationProtectionPropagationError, v as ATOMIC_FINAL_SNAPSHOT_TYPES, vn as BOOTSTRAP_MARKER_PREFIX, vr as DeployCancelledError, vt as normalizeAwsTagsToCfn, w as refusesFinalSnapshot, wn as readBootstrapMarkerBody, wr as MissingCdkCliError, wt as readConfigString, x as ccRoutedFinalSnapshotError, xn as getBootstrapMarkerKey, xr as LocalMigrateError, xt as coerceCfnBoolean, y as PRE_DELETE_SNAPSHOT_TYPES, yn as assertAssetBucketRegion, yr as DynamicReferenceRegionAmbiguousError, yt as resolveExplicitPhysicalId, z as collectPublishedOutputNames, zn as getDefaultStateBucketName, zr as isRetryableTransientError, zt as scrubResourceRecord } from "./deploy-engine-wrIe6cV6.js";
|
|
2
|
+
import { a as runStackBuffered, c as PATTERN_B_NAME_PROPERTIES, d as generateResourceName, f as generateResourceNameWithFallback, g as withStackName, h as withSkipPrefix, l as PATTERN_B_RESOURCE_TYPES, n as getLogger, o as getLiveRenderer, p as getCurrentStackName, r as reserveStdoutForPayload, s as PATTERN_B_NAME_OPTIONS } from "./logger-C9-E73FI.js";
|
|
3
|
+
import { t as getCdkdVersion } from "./version-DNFFsbnH.js";
|
|
4
|
+
import { t as ASGProvider } from "./asg-provider-fy2cEq7m.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
7
7
|
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, 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";
|
|
@@ -59215,6 +59215,7 @@ async function runDestroyForStack(stackName, state, ctx) {
|
|
|
59215
59215
|
for (const [logicalId, resource] of Object.entries(state.resources)) logger.info(` - ${logicalId} (${resource.resourceType})`);
|
|
59216
59216
|
const protectedCount = ctx.removeProtection ? countProtectedResources(state) : 0;
|
|
59217
59217
|
if (!ctx.skipConfirmation) {
|
|
59218
|
+
if (process.stdin.isTTY !== true) throw new CdkdError(`The destroy confirmation prompt for stack "${stackName}" cannot run in a non-interactive environment. Pass --yes / -y to confirm the destroy (cdkd destroy also accepts -f / --force), or run the command from a real terminal.`, "NON_INTERACTIVE_CONFIRM");
|
|
59218
59219
|
const rl = readline$1.createInterface({
|
|
59219
59220
|
input: process.stdin,
|
|
59220
59221
|
output: process.stdout
|
|
@@ -66661,6 +66662,7 @@ function incompleteRemediationMessage(reports, mode) {
|
|
|
66661
66662
|
async function driftCommand(stacks, options) {
|
|
66662
66663
|
const logger = getLogger();
|
|
66663
66664
|
if (options.verbose) logger.setLevel("debug");
|
|
66665
|
+
if (options.json) reserveStdoutForPayload();
|
|
66664
66666
|
warnIfDeprecatedRegion(options);
|
|
66665
66667
|
if (options.accept && options.revert) throw new Error("--accept and --revert are mutually exclusive. Use --accept to update cdkd state from AWS, or --revert to push cdkd state values back into AWS.");
|
|
66666
66668
|
foldRegionOption(options);
|
|
@@ -67615,18 +67617,19 @@ function setAtPath(target, path, value) {
|
|
|
67615
67617
|
*/
|
|
67616
67618
|
async function runAccept(reports, stateBackend, stateConfig, awsClients, options) {
|
|
67617
67619
|
const logger = getLogger();
|
|
67620
|
+
const out = humanTextSink(options.json);
|
|
67618
67621
|
const lockRecovery = {
|
|
67619
67622
|
profile: options.profile,
|
|
67620
67623
|
stateBucket: stateConfig.bucket,
|
|
67621
67624
|
statePrefix: stateConfig.prefix
|
|
67622
67625
|
};
|
|
67623
|
-
printAcceptPlan(reports);
|
|
67626
|
+
printAcceptPlan(reports, out);
|
|
67624
67627
|
if (options.dryRun) {
|
|
67625
67628
|
logger.info("--dry-run: state will NOT be written. Re-run without --dry-run to apply.");
|
|
67626
67629
|
return;
|
|
67627
67630
|
}
|
|
67628
67631
|
if (!options.yes) {
|
|
67629
|
-
if (!await confirmPrompt$5(`Update cdkd state with the AWS-current values shown above
|
|
67632
|
+
if (!await confirmPrompt$5(`Update cdkd state with the AWS-current values shown above?`, out)) {
|
|
67630
67633
|
logger.info("Aborted.");
|
|
67631
67634
|
return;
|
|
67632
67635
|
}
|
|
@@ -68249,18 +68252,19 @@ function deepEqualUnordered(a, b) {
|
|
|
68249
68252
|
*/
|
|
68250
68253
|
async function runRevert(reports, providerRegistry, stateBackend, stateConfig, awsClients, options) {
|
|
68251
68254
|
const logger = getLogger();
|
|
68255
|
+
const out = humanTextSink(options.json);
|
|
68252
68256
|
const lockRecovery = {
|
|
68253
68257
|
profile: options.profile,
|
|
68254
68258
|
stateBucket: stateConfig.bucket,
|
|
68255
68259
|
statePrefix: stateConfig.prefix
|
|
68256
68260
|
};
|
|
68257
|
-
printRevertPlan(reports);
|
|
68261
|
+
printRevertPlan(reports, out);
|
|
68258
68262
|
if (options.dryRun) {
|
|
68259
68263
|
logger.info("--dry-run: AWS will NOT be modified. Re-run without --dry-run to apply.");
|
|
68260
68264
|
return;
|
|
68261
68265
|
}
|
|
68262
68266
|
if (!options.yes) {
|
|
68263
|
-
if (!await confirmPrompt$5(`Push cdkd state values back into AWS for the resources shown above
|
|
68267
|
+
if (!await confirmPrompt$5(`Push cdkd state values back into AWS for the resources shown above?`, out)) {
|
|
68264
68268
|
logger.info("Aborted.");
|
|
68265
68269
|
return;
|
|
68266
68270
|
}
|
|
@@ -68427,13 +68431,26 @@ async function runRevert(reports, providerRegistry, stateBackend, stateConfig, a
|
|
|
68427
68431
|
if (totalUnsupported > 0) logger.warn(`${totalUnsupported} resource(s) cannot be reverted in place — re-deploy the stack with cdkd deploy --replace, or destroy + redeploy to push the cdkd-state values back into AWS.`);
|
|
68428
68432
|
if (totalFailed > 0 || totalUnsupported > 0 || totalUnresolvable > 0) throw new PartialFailureError(`Revert completed with ${totalFailed + totalUnsupported + totalUnresolvable} resource error(s) (${totalFailed} AWS update failure(s), ${totalUnsupported} update-not-supported, ${totalUnresolvable} whose dynamic reference(s) could not be resolved — those never reached provider.update; grant the caller secretsmanager:GetSecretValue / ssm:GetParameter, or fix the reference). Re-run 'cdkd drift <stack>' to see the remaining drift, then 'cdkd drift <stack> --revert' to retry.`);
|
|
68429
68433
|
}
|
|
68434
|
+
function humanTextSink(json) {
|
|
68435
|
+
return json ? {
|
|
68436
|
+
write: (chunk) => {
|
|
68437
|
+
process.stderr.write(chunk);
|
|
68438
|
+
},
|
|
68439
|
+
stream: process.stderr
|
|
68440
|
+
} : {
|
|
68441
|
+
write: (chunk) => {
|
|
68442
|
+
process.stdout.write(chunk);
|
|
68443
|
+
},
|
|
68444
|
+
stream: process.stdout
|
|
68445
|
+
};
|
|
68446
|
+
}
|
|
68430
68447
|
/**
|
|
68431
68448
|
* Print the planned state mutations for `--accept` (no AWS calls). One
|
|
68432
68449
|
* line per resource per property path, mirroring the human report's
|
|
68433
68450
|
* +/- diff format but flipped: the value on disk after this command
|
|
68434
68451
|
* runs is the `+` side.
|
|
68435
68452
|
*/
|
|
68436
|
-
function printAcceptPlan(reports) {
|
|
68453
|
+
function printAcceptPlan(reports, out) {
|
|
68437
68454
|
for (const report of reports) {
|
|
68438
68455
|
const drifted = report.outcomes.flatMap((o) => matchOutcome(o, {
|
|
68439
68456
|
drifted: (d) => [d],
|
|
@@ -68457,8 +68474,8 @@ function printAcceptPlan(reports) {
|
|
|
68457
68474
|
lines.push(` ${change.path}: ${formatScalar(change.stateValue)} -> ${formatScalar(change.awsValue)}\n`);
|
|
68458
68475
|
}
|
|
68459
68476
|
}
|
|
68460
|
-
|
|
68461
|
-
for (const line of lines)
|
|
68477
|
+
out.write(plannedWrites === 0 ? `\nPlan (--accept): no accepted values will be written to cdkd state for ${report.stackName} (${report.region}) — every drifted change below is refused (the run still writes the positioned re-redaction):\n` : `\nPlan (--accept): update cdkd state for ${report.stackName} (${report.region}):\n`);
|
|
68478
|
+
for (const line of lines) out.write(line);
|
|
68462
68479
|
}
|
|
68463
68480
|
}
|
|
68464
68481
|
/**
|
|
@@ -68466,7 +68483,7 @@ function printAcceptPlan(reports) {
|
|
|
68466
68483
|
* One line per resource summarising how many property paths will be
|
|
68467
68484
|
* overwritten on the AWS side.
|
|
68468
68485
|
*/
|
|
68469
|
-
function printRevertPlan(reports) {
|
|
68486
|
+
function printRevertPlan(reports, out) {
|
|
68470
68487
|
for (const report of reports) {
|
|
68471
68488
|
const drifted = report.outcomes.flatMap((o) => matchOutcome(o, {
|
|
68472
68489
|
drifted: (d) => [d],
|
|
@@ -68476,31 +68493,31 @@ function printRevertPlan(reports) {
|
|
|
68476
68493
|
skipped: () => []
|
|
68477
68494
|
}));
|
|
68478
68495
|
if (drifted.length === 0) continue;
|
|
68479
|
-
|
|
68496
|
+
out.write(`\nPlan (--revert): push cdkd state values back into AWS for ${report.stackName} (${report.region}):\n`);
|
|
68480
68497
|
for (const o of drifted) {
|
|
68481
68498
|
const word = o.changes.length === 1 ? "property path" : "property paths";
|
|
68482
|
-
|
|
68483
|
-
for (const change of o.changes)
|
|
68499
|
+
out.write(` → provider.update on ${o.logicalId} (${o.resourceType}): revert ${o.changes.length} ${word}\n`);
|
|
68500
|
+
for (const change of o.changes) out.write(` ${change.path}: ${formatScalar(change.awsValue)} -> ${formatScalar(change.stateValue)}\n`);
|
|
68484
68501
|
const stateResource = report.state.resources[o.logicalId];
|
|
68485
68502
|
if (stateResource) {
|
|
68486
68503
|
const preserved = findRevertPreservedTagKeys(o.changes, stateResource.observedProperties ?? stateResource.properties ?? {}, o.awsProperties);
|
|
68487
|
-
if (o.notComparedCause !== void 0 && preserved.length > 0)
|
|
68504
|
+
if (o.notComparedCause !== void 0 && preserved.length > 0) out.write(` ! ${preserved.length} AWS-authored tag(s) will be preserved, but cdkd could not resolve this resource's dynamic reference(s), so their names are withheld — they come from the live readback and cannot be checked for secrets without them.\n`);
|
|
68488
68505
|
else if (preserved.length > 0) {
|
|
68489
68506
|
const tagWord = preserved.length === 1 ? "tag" : "tags";
|
|
68490
|
-
|
|
68491
|
-
for (const path of preserved)
|
|
68507
|
+
out.write(` ! reverting this tag list KEEPS ${preserved.length} AWS-authored ${tagWord} the baseline does not carry:\n`);
|
|
68508
|
+
for (const path of preserved) out.write(` ${maskSecretsInText(path, o.secrets)}\n`);
|
|
68492
68509
|
const othersRevert = stateResource.observedProperties === void 0 ? "" : `Every other tag reverts normally. `;
|
|
68493
|
-
|
|
68510
|
+
out.write(` ${othersRevert}A service may require these (ECS needs AmazonECSManaged for managed scaling); 'aws:'-prefixed keys are AWS-reserved and cannot be removed by hand.\n`);
|
|
68494
68511
|
}
|
|
68495
68512
|
}
|
|
68496
68513
|
if (stateResource && stateResource.observedProperties === void 0) {
|
|
68497
68514
|
const unbaselined = findRevertUnbaselinedAwsKeys(o.changes, stateResource.properties ?? {}, o.awsProperties);
|
|
68498
|
-
if (o.notComparedCause !== void 0 && unbaselined.length > 0)
|
|
68515
|
+
if (o.notComparedCause !== void 0 && unbaselined.length > 0) out.write(` ! ${unbaselined.length} AWS-authored value(s) will be left untouched, but cdkd could not resolve this resource's dynamic reference(s), so their paths are withheld — they come from the live readback and cannot be checked for secrets without them.\n`);
|
|
68499
68516
|
else if (unbaselined.length > 0) {
|
|
68500
68517
|
const word = unbaselined.length === 1 ? "value" : "values";
|
|
68501
|
-
|
|
68502
|
-
for (const path of unbaselined)
|
|
68503
|
-
|
|
68518
|
+
out.write(` ! this resource has no observed-capture baseline, so the revert pushes the raw TEMPLATE and LEAVES ${unbaselined.length} AWS-authored ${word} untouched:\n`);
|
|
68519
|
+
for (const path of unbaselined) out.write(` ${maskSecretsInText(path, o.secrets)}\n`);
|
|
68520
|
+
out.write(` The template does not declare these, so cdkd cannot tell an AWS-authored value from an out-of-band change and will not reset either (issue #1626). Run 'cdkd state refresh-observed ${report.stackName}' (or re-deploy) to populate observedProperties if you want them reverted too.\n`);
|
|
68504
68521
|
}
|
|
68505
68522
|
}
|
|
68506
68523
|
}
|
|
@@ -68523,10 +68540,18 @@ async function runWithConcurrency(tasks, concurrency) {
|
|
|
68523
68540
|
})());
|
|
68524
68541
|
await Promise.all(workers);
|
|
68525
68542
|
}
|
|
68526
|
-
|
|
68543
|
+
/**
|
|
68544
|
+
* Ask the operator to confirm a mutation.
|
|
68545
|
+
*
|
|
68546
|
+
* Issue #2230: the prompt is written to `out.stream`, not unconditionally to
|
|
68547
|
+
* `process.stdout` — under `--json` that stream carries the payload, and a
|
|
68548
|
+
* bare `[y/N] ` spliced into it is the same corruption as a status line.
|
|
68549
|
+
* The prompt is still SHOWN; only its stream changes.
|
|
68550
|
+
*/
|
|
68551
|
+
async function confirmPrompt$5(prompt, out) {
|
|
68527
68552
|
const rl = readline$1.createInterface({
|
|
68528
68553
|
input: process.stdin,
|
|
68529
|
-
output:
|
|
68554
|
+
output: out.stream
|
|
68530
68555
|
});
|
|
68531
68556
|
try {
|
|
68532
68557
|
const ans = await rl.question(`${prompt} [y/N] `);
|
|
@@ -77955,9 +77980,29 @@ async function captureObservedForImportedResources(stackState, providerRegistry,
|
|
|
77955
77980
|
* than silently using a non-ARN string. The format MUST match
|
|
77956
77981
|
* `NestedStackProvider.synthesizeArn` so an import-then-deploy cycle does
|
|
77957
77982
|
* not surface phantom property changes on the nested-stack row.
|
|
77958
|
-
|
|
77959
|
-
|
|
77960
|
-
|
|
77983
|
+
*
|
|
77984
|
+
* THE REGION SEGMENT IS READ BACK, so it must be the CHILD's region and must
|
|
77985
|
+
* not be collapsed with the parent's (issue
|
|
77986
|
+
* [#2055](https://github.com/go-to-k/cdkd/issues/2055)).
|
|
77987
|
+
* `nestedStackChildRegionFromLocalArn` in
|
|
77988
|
+
* [src/deployment/intrinsic-function-resolver.ts](../../deployment/intrinsic-function-resolver.ts)
|
|
77989
|
+
* parses this segment to learn which region to resolve a child's persisted
|
|
77990
|
+
* `{{resolve:...}}` output in — a secret NAME is regional, so resolving it in
|
|
77991
|
+
* the wrong region can answer with a DIFFERENT secret. Reading the child's own
|
|
77992
|
+
* state record instead is not an option: the region is part of that record's S3
|
|
77993
|
+
* key, so the lookup would be circular. That reader's doc block carries the
|
|
77994
|
+
* full rationale; this note exists because the value is produced HERE and the
|
|
77995
|
+
* next edit to the import walk would otherwise have nothing in front of it.
|
|
77996
|
+
*
|
|
77997
|
+
* Both call sites already pass a child-scoped value — the top-level walk passes
|
|
77998
|
+
* `targetRegion` (the stack being imported) and the recursive nested walk
|
|
77999
|
+
* passes `childRegion` — and parent and child region are necessarily equal
|
|
78000
|
+
* until cross-region nested stacks ship. The parameter is named `childRegion`
|
|
78001
|
+
* anyway, matching `NestedStackProvider.synthesizeArn`, so the requirement is
|
|
78002
|
+
* visible at the signature rather than only in prose.
|
|
78003
|
+
*/
|
|
78004
|
+
function synthesizeNestedStackArn(childRegion, accountId, parentStackName, logicalId) {
|
|
78005
|
+
return `arn:cdkd-local:${childRegion}:${accountId}:nested-stack/${parentStackName}/${logicalId}`;
|
|
77961
78006
|
}
|
|
77962
78007
|
/**
|
|
77963
78008
|
* Validate the parent template ↔ AWS CFn tree shape consistency before any
|
|
@@ -88015,4 +88060,4 @@ function buildProgram() {
|
|
|
88015
88060
|
|
|
88016
88061
|
//#endregion
|
|
88017
88062
|
export { buildProgram };
|
|
88018
|
-
//# sourceMappingURL=program-
|
|
88063
|
+
//# sourceMappingURL=program-BkUhF3Bf.js.map
|