@go-to-k/cdkd 0.278.25 → 0.278.26

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/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { $ as isThrottlingError, $t as setAwsClients, A as red, At as getLegacyStateBucketName, B as isTerminationProtectionPropagationError, Bt as CFN_TEMPLATE_BODY_LIMIT, C as isStatefulRecreateTargetSync, Ct as runDockerForeground, D as cyan, Dt as Synthesizer, E as bold, Et as getDockerImageBySourceHash, F as ProviderRegistry, Ft as resolveStateBucketWithDefault, G as normalizeAwsTagsToCfn, Gt as expectedOwnerParam, H as cfnRefValueFromPhysicalId, Ht as MIGRATE_TMP_PREFIX, I as findActionableSilentDrops, It as resolveStateBucketWithDefaultAndSource, J as applyRoleArnIfSet, K as resolveExplicitPhysicalId, Kt as AssemblyReader, L as CloudControlProvider, Lt as resolveUseCdkBootstrapAssets, M as IAMRoleProvider, Mt as resolveAutoAssetStorage, N as collectInlinePolicyNamesManagedBySiblings, Nt as resolveCaptureObservedState, O as gray, Ot as synthesisStatusMessage, P as clearOnUpdateRemoval, Pt as resolveSkipPrefix, Q as isRetryableTransientError, Qt as resetAwsClients, R as slowCcOperationTimeoutMs, Rt as stateBucketExistenceConfirmed, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, Sn as withErrorHandling, St as getDockerCmd, T as formatResourceLine, Tt as AssetManifestLoader, U as refStateLookupFromResource, Ut as findLargeInlineResources, V as IntrinsicFunctionResolver, Vt as CFN_TEMPLATE_URL_LIMIT, W as WAFv2WebACLProvider, Wt as uploadCfnTemplate, X as describeTypeWithThrottleRetry, Xt as AwsClients, Y as DiffCalculator, Yt as resolveBucketRegion, Z as withRetry, Zt as getAwsClients, _ as createPreDeleteFinalSnapshot, _t as parseBootstrapMarker, a as DeploymentEventsStore, an as LocalInvokeBuildError$1, at as shouldRetainResource, b as unsupportedFinalSnapshotError, bt as buildDockerImage, c as replayFailedOperations, ct as WorkGraph, d as IMPLICIT_DELETE_DEPENDENCIES, dn as PartialFailureError, dt as loadPublishableAssetManifest, et as DagBuilder, f as computeImplicitDeleteEdges, fn as ProvisioningError, ft as rewriteTemplateAssetReferences, g as ccRoutedFinalSnapshotError, gn as StackTerminationProtectionError, gt as getBootstrapMarkerKey, h as buildFinalSnapshotIdentifier, hn as StackHasActiveImportsError, ht as ensureAssetStorage, i as DeploymentEventsReader, in as DeployCancelledError, it as rebuildClientForBucketRegion, j as yellow, jt as resolveApp, k as green, kt as getDefaultStateBucketName, l as replayRollback, ln as MissingCdkCliError, lt as buildAssetRedirectMap, m as PRE_DELETE_SNAPSHOT_TYPES, mn as ResourceUpdateNotSupportedError, mt as BOOTSTRAP_MARKER_PREFIX, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as LockManager, o as planFailedOps, on as LocalMigrateError, ot as AssetPublisher, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as ResourceTimeoutError, pt as AssetModeResolver, q as assertRegionMatch, qt as processStackMessages, r as DeployEngine, rt as S3StateBackend, s as planRollback, sn as LocalStartServiceError, st as stringifyValue, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as CdkdError, tt as TemplateParser, u as withResourceDeadline, un as NestedStackChildDirectDestroyError, ut as createAssetRedirectResolver, v as isFinalSnapshotError, vt as validateAssetBucketName, w as renderStatefulReason, wt as runDockerStreaming, x as extractDeploymentEventError, xn as normalizeAwsError, xt as formatDockerLoginError, y as refusesFinalSnapshot, yt as validateContainerRepoName, z as disableInstanceApiTermination, zt as warnDeprecatedNoPrefixCliFlag } from "./deploy-engine-B65VTlrZ.js";
2
+ import { $ as isThrottlingError, $t as setAwsClients, A as red, At as getLegacyStateBucketName, B as isTerminationProtectionPropagationError, Bt as CFN_TEMPLATE_BODY_LIMIT, C as isStatefulRecreateTargetSync, Ct as runDockerForeground, D as cyan, Dt as Synthesizer, E as bold, Et as getDockerImageBySourceHash, F as ProviderRegistry, Ft as resolveStateBucketWithDefault, G as normalizeAwsTagsToCfn, Gt as expectedOwnerParam, H as cfnRefValueFromPhysicalId, Ht as MIGRATE_TMP_PREFIX, I as findActionableSilentDrops, It as resolveStateBucketWithDefaultAndSource, J as applyRoleArnIfSet, K as resolveExplicitPhysicalId, Kt as AssemblyReader, L as CloudControlProvider, Lt as resolveUseCdkBootstrapAssets, M as IAMRoleProvider, Mt as resolveAutoAssetStorage, N as collectInlinePolicyNamesManagedBySiblings, Nt as resolveCaptureObservedState, O as gray, Ot as synthesisStatusMessage, P as clearOnUpdateRemoval, Pt as resolveSkipPrefix, Q as isRetryableTransientError, Qt as resetAwsClients, R as slowCcOperationTimeoutMs, Rt as stateBucketExistenceConfirmed, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, Sn as withErrorHandling, St as getDockerCmd, T as formatResourceLine, Tt as AssetManifestLoader, U as refStateLookupFromResource, Ut as findLargeInlineResources, V as IntrinsicFunctionResolver, Vt as CFN_TEMPLATE_URL_LIMIT, W as WAFv2WebACLProvider, Wt as uploadCfnTemplate, X as describeTypeWithThrottleRetry, Xt as AwsClients, Y as DiffCalculator, Yt as resolveBucketRegion, Z as withRetry, Zt as getAwsClients, _ as createPreDeleteFinalSnapshot, _t as parseBootstrapMarker, a as DeploymentEventsStore, an as LocalInvokeBuildError$1, at as shouldRetainResource, b as unsupportedFinalSnapshotError, bt as buildDockerImage, c as replayFailedOperations, ct as WorkGraph, d as IMPLICIT_DELETE_DEPENDENCIES, dn as PartialFailureError, dt as loadPublishableAssetManifest, et as DagBuilder, f as computeImplicitDeleteEdges, fn as ProvisioningError, ft as rewriteTemplateAssetReferences, g as ccRoutedFinalSnapshotError, gn as StackTerminationProtectionError, gt as getBootstrapMarkerKey, h as buildFinalSnapshotIdentifier, hn as StackHasActiveImportsError, ht as ensureAssetStorage, i as DeploymentEventsReader, in as DeployCancelledError, it as rebuildClientForBucketRegion, j as yellow, jt as resolveApp, k as green, kt as getDefaultStateBucketName, l as replayRollback, ln as MissingCdkCliError, lt as buildAssetRedirectMap, m as PRE_DELETE_SNAPSHOT_TYPES, mn as ResourceUpdateNotSupportedError, mt as BOOTSTRAP_MARKER_PREFIX, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as LockManager, o as planFailedOps, on as LocalMigrateError, ot as AssetPublisher, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as ResourceTimeoutError, pt as AssetModeResolver, q as assertRegionMatch, qt as processStackMessages, r as DeployEngine, rt as S3StateBackend, s as planRollback, sn as LocalStartServiceError, st as stringifyValue, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as CdkdError, tt as TemplateParser, u as withResourceDeadline, un as NestedStackChildDirectDestroyError, ut as createAssetRedirectResolver, v as isFinalSnapshotError, vt as validateAssetBucketName, w as renderStatefulReason, wt as runDockerStreaming, x as extractDeploymentEventError, xn as normalizeAwsError, xt as formatDockerLoginError, y as refusesFinalSnapshot, yt as validateContainerRepoName, z as disableInstanceApiTermination, zt as warnDeprecatedNoPrefixCliFlag } from "./deploy-engine-BsHkBRtK.js";
3
3
  import { a as getLiveRenderer, c as PATTERN_B_RESOURCE_TYPES, d as generateResourceNameWithFallback, f as withSkipPrefix, i as runStackBuffered, n as getLogger, o as PATTERN_B_NAME_OPTIONS, p as withStackName, s as PATTERN_B_NAME_PROPERTIES, u as generateResourceName } from "./logger-BYMEE-BS.js";
4
- import { t as ASGProvider } from "./asg-provider-BRlawK4H.js";
4
+ import { t as ASGProvider } from "./asg-provider-DLScqiT2.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";
@@ -48774,6 +48774,82 @@ async function runAccept(reports, stateBackend, stateConfig, awsClients, options
48774
48774
  * parent path — so `path.split('.', 1)` is always safe to extract the
48775
48775
  * top-level key.
48776
48776
  */
48777
+ /**
48778
+ * The AWS-authored property paths a `--revert` is about to DROP, for a
48779
+ * resource whose state predates observed-capture (issue #1478).
48780
+ *
48781
+ * The mechanism, and why this is not a Glue fix: `runRevert` picks the revert
48782
+ * baseline as `observedProperties ?? properties`. When `observedProperties` is
48783
+ * absent, the desired side is the raw TEMPLATE while the previous side is the
48784
+ * AWS-CURRENT snapshot — so {@link buildRevertNewProperties}, which overwrites
48785
+ * each drifted top-level key with the desired sub-shape wholesale, replaces
48786
+ * every AWS-authored key inside that subtree with the template's version. For
48787
+ * a Glue Iceberg table that silently wipes `table_type` /
48788
+ * `metadata_location`, the same outcome as issue #1461 reached by a different
48789
+ * trigger. The exposure is general: ANY resource where AWS writes into a bag
48790
+ * the template does not fully declare, on state written before
48791
+ * observed-capture.
48792
+ *
48793
+ * The user DID ask to push state over AWS, so this is not silent-wrong the way
48794
+ * #1461 was — but it is almost certainly not what they meant, and nothing told
48795
+ * them. So the chosen semantic is **warn and proceed**: it is the cheapest
48796
+ * honest step, preserves today's behavior, and does not foreclose the stricter
48797
+ * options (refuse outright, or treat "no observedProperties" as "previous is
48798
+ * unknown" so the merge preserves).
48799
+ *
48800
+ * Scoped deliberately:
48801
+ *
48802
+ * - **Only drifted top-level keys.** Non-drifted keys keep their AWS-current
48803
+ * value in `buildRevertNewProperties`, so nothing under them is dropped.
48804
+ * - **Only when `observedProperties` is absent.** With it present the desired
48805
+ * side is the deploy-time AWS snapshot, which already carries AWS-authored
48806
+ * fields — dropping one there is a legitimate revert of a real console
48807
+ * change, and warning about it would be noise on every run.
48808
+ * - **Only keys that vanish.** A key present on both sides with a different
48809
+ * VALUE is the drift the user asked to revert, not a silent loss.
48810
+ *
48811
+ * @returns dotted paths, sorted, e.g. `['Parameters.metadata_location']`.
48812
+ */
48813
+ function findRevertDroppedAwsKeys(drifts, desiredProperties, awsProperties) {
48814
+ const dropped = /* @__PURE__ */ new Set();
48815
+ const driftedTopLevelKeys = /* @__PURE__ */ new Set();
48816
+ for (const d of drifts) {
48817
+ const topLevelKey = d.path.split(".", 1)[0];
48818
+ if (topLevelKey) driftedTopLevelKeys.add(topLevelKey);
48819
+ }
48820
+ for (const key of driftedTopLevelKeys) {
48821
+ if (!(key in desiredProperties)) continue;
48822
+ collectMissingPaths(awsProperties[key], desiredProperties[key], key, dropped);
48823
+ }
48824
+ return [...dropped].sort();
48825
+ }
48826
+ /**
48827
+ * Walk the AWS-side value against the desired-side value, recording every path
48828
+ * present on the AWS side and absent on the desired side.
48829
+ *
48830
+ * Only plain objects are descended into. An ARRAY is compared wholesale — the
48831
+ * drift comparator itself treats arrays as single values (its paths never
48832
+ * carry an index), so an element-wise walk here would report positions the
48833
+ * rest of the revert path cannot reason about.
48834
+ */
48835
+ function collectMissingPaths(awsValue, desiredValue, path, out) {
48836
+ if (!isPlainRecord(awsValue)) return;
48837
+ if (!isPlainRecord(desiredValue)) {
48838
+ if (desiredValue === void 0) out.add(path);
48839
+ return;
48840
+ }
48841
+ for (const [key, value] of Object.entries(awsValue)) {
48842
+ const childPath = `${path}.${key}`;
48843
+ if (!(key in desiredValue)) {
48844
+ out.add(childPath);
48845
+ continue;
48846
+ }
48847
+ collectMissingPaths(value, desiredValue[key], childPath, out);
48848
+ }
48849
+ }
48850
+ function isPlainRecord(value) {
48851
+ return typeof value === "object" && value !== null && !Array.isArray(value);
48852
+ }
48777
48853
  function buildRevertNewProperties(drifts, desiredProperties, awsProperties) {
48778
48854
  const result = { ...awsProperties };
48779
48855
  for (const d of drifts) {
@@ -48901,6 +48977,16 @@ function printRevertPlan(reports) {
48901
48977
  const word = o.changes.length === 1 ? "property path" : "property paths";
48902
48978
  process.stdout.write(` → provider.update on ${o.logicalId} (${o.resourceType}): revert ${o.changes.length} ${word}\n`);
48903
48979
  for (const change of o.changes) process.stdout.write(` ${change.path}: ${formatScalar(change.awsValue)} -> ${formatScalar(change.stateValue)}\n`);
48980
+ const stateResource = report.state.resources[o.logicalId];
48981
+ if (stateResource && stateResource.observedProperties === void 0) {
48982
+ const dropped = findRevertDroppedAwsKeys(o.changes, stateResource.properties ?? {}, o.awsProperties);
48983
+ if (dropped.length > 0) {
48984
+ const word = dropped.length === 1 ? "value" : "values";
48985
+ process.stdout.write(` ! this resource has no observed-capture baseline, so the revert pushes the raw TEMPLATE and will DROP ${dropped.length} AWS-authored ${word}:\n`);
48986
+ for (const path of dropped) process.stdout.write(` ${path}\n`);
48987
+ process.stdout.write(" Re-deploy the stack first to populate observedProperties if you want these preserved.\n");
48988
+ }
48989
+ }
48904
48990
  }
48905
48991
  }
48906
48992
  }
@@ -65850,7 +65936,7 @@ function createMigrateCommand() {
65850
65936
  */
65851
65937
  function buildProgram() {
65852
65938
  const program = new Command();
65853
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.278.25");
65939
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.278.26");
65854
65940
  program.hook("preAction", (_thisCommand, actionCommand) => {
65855
65941
  const { profile } = actionCommand.optsWithGlobals();
65856
65942
  if (profile !== void 0) process.env["AWS_PROFILE"] = profile;