@go-to-k/cdkd 0.278.24 → 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/{asg-provider-cNZXiMc7.js → asg-provider-DLScqiT2.js} +2 -2
- package/dist/{asg-provider-cNZXiMc7.js.map → asg-provider-DLScqiT2.js.map} +1 -1
- package/dist/cli.js +154 -4
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-DlLaOrHh.js → deploy-engine-BsHkBRtK.js} +4 -3
- package/dist/deploy-engine-BsHkBRtK.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-DlLaOrHh.js.map +0 -1
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-
|
|
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-
|
|
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";
|
|
@@ -29490,6 +29490,17 @@ var NeptuneProvider = class {
|
|
|
29490
29490
|
//#endregion
|
|
29491
29491
|
//#region src/provisioning/providers/route53-provider.ts
|
|
29492
29492
|
/**
|
|
29493
|
+
* True when Route 53 refused a zone mutation because the zone's
|
|
29494
|
+
* AcceleratedRecoveryStatus is mid-transition — the
|
|
29495
|
+
* "HostedZone <id> is marked disabled for mutation" rejection (issue #1467).
|
|
29496
|
+
* Exported for the delete-path retry in this provider and for tests; the
|
|
29497
|
+
* same substring is also in `RETRYABLE_ERROR_MESSAGE_PATTERNS` so the
|
|
29498
|
+
* generic retry net covers the create/update paths.
|
|
29499
|
+
*/
|
|
29500
|
+
function isZoneDisabledForMutationError(error) {
|
|
29501
|
+
return error instanceof Error && error.message.includes("is marked disabled for mutation");
|
|
29502
|
+
}
|
|
29503
|
+
/**
|
|
29493
29504
|
* AWS Route 53 Provider
|
|
29494
29505
|
*
|
|
29495
29506
|
* Implements resource provisioning for Route 53 resources:
|
|
@@ -29831,13 +29842,21 @@ var Route53Provider = class {
|
|
|
29831
29842
|
if (!properties) throw new ProvisioningError(`Properties required to delete record set ${logicalId}`, resourceType, logicalId, physicalId);
|
|
29832
29843
|
try {
|
|
29833
29844
|
const resourceRecordSet = this.buildResourceRecordSet(properties);
|
|
29834
|
-
|
|
29845
|
+
const sendDelete = () => this.getClient().send(new ChangeResourceRecordSetsCommand({
|
|
29835
29846
|
HostedZoneId: hostedZoneId,
|
|
29836
29847
|
ChangeBatch: { Changes: [{
|
|
29837
29848
|
Action: "DELETE",
|
|
29838
29849
|
ResourceRecordSet: resourceRecordSet
|
|
29839
29850
|
}] }
|
|
29840
29851
|
}));
|
|
29852
|
+
try {
|
|
29853
|
+
await sendDelete();
|
|
29854
|
+
} catch (error) {
|
|
29855
|
+
if (!isZoneDisabledForMutationError(error)) throw error;
|
|
29856
|
+
this.logger.info(`Hosted zone ${hostedZoneId} is mid AcceleratedRecovery transition (marked disabled for mutation); waiting for it to settle before retrying delete of record set ${logicalId}`);
|
|
29857
|
+
await this.waitForAcceleratedRecoveryMutable(hostedZoneId, logicalId, resourceType);
|
|
29858
|
+
await sendDelete();
|
|
29859
|
+
}
|
|
29841
29860
|
this.logger.debug(`Successfully deleted record set ${logicalId}`);
|
|
29842
29861
|
} catch (error) {
|
|
29843
29862
|
if (error instanceof Error && (error.name === "InvalidChangeBatch" || error.message.includes("it was not found"))) {
|
|
@@ -29849,11 +29868,56 @@ var Route53Provider = class {
|
|
|
29849
29868
|
this.logger.debug(`Hosted zone for record set ${physicalId} does not exist, skipping deletion`);
|
|
29850
29869
|
return;
|
|
29851
29870
|
}
|
|
29871
|
+
if (error instanceof ProvisioningError) throw error;
|
|
29852
29872
|
const cause = error instanceof Error ? error : void 0;
|
|
29853
29873
|
throw new ProvisioningError(`Failed to delete record set ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
29854
29874
|
}
|
|
29855
29875
|
}
|
|
29856
29876
|
/**
|
|
29877
|
+
* Wait until the hosted zone's AcceleratedRecoveryStatus reaches a state
|
|
29878
|
+
* that ALLOWS mutations again (issue #1467).
|
|
29879
|
+
*
|
|
29880
|
+
* While the feature is transitioning (ENABLING / DISABLING /
|
|
29881
|
+
* *_HOSTED_ZONE_LOCKED) Route 53 marks the zone "disabled for mutation" and
|
|
29882
|
+
* refuses `ChangeResourceRecordSets`. Unlike the zone-delete guard
|
|
29883
|
+
* (`ensureAcceleratedRecoveryDisabledForDelete`) this helper does NOT
|
|
29884
|
+
* disable the feature — a record-set mutation is legal on an ENABLED zone,
|
|
29885
|
+
* and flipping a zone-level setting from a record delete would be a side
|
|
29886
|
+
* effect the template never asked for. It only polls until the status is
|
|
29887
|
+
* terminal-stable (ENABLED / DISABLED / zone gone), throwing on the
|
|
29888
|
+
* `*_FAILED` operator-recovery states and on timeout. Same env-overridable
|
|
29889
|
+
* poll knobs as the zone guard.
|
|
29890
|
+
*/
|
|
29891
|
+
async waitForAcceleratedRecoveryMutable(zoneId, logicalId, resourceType) {
|
|
29892
|
+
const client = this.getClient();
|
|
29893
|
+
const parsedInterval = Number.parseInt(process.env["CDKD_R53_ACCEL_RECOVERY_POLL_INTERVAL_MS"] ?? "15000", 10);
|
|
29894
|
+
const pollIntervalMs = Number.isFinite(parsedInterval) && parsedInterval > 0 ? parsedInterval : 15e3;
|
|
29895
|
+
const parsedTimeout = Number.parseInt(process.env["CDKD_R53_ACCEL_RECOVERY_POLL_TIMEOUT_MS"] ?? "600000", 10);
|
|
29896
|
+
const timeoutMs = Number.isFinite(parsedTimeout) && parsedTimeout > 0 ? parsedTimeout : 6e5;
|
|
29897
|
+
const deadline = Date.now() + timeoutMs;
|
|
29898
|
+
const TERMINAL_FAILED = /* @__PURE__ */ new Set(["ENABLE_FAILED", "DISABLE_FAILED"]);
|
|
29899
|
+
const MUTABLE = /* @__PURE__ */ new Set(["ENABLED", "DISABLED"]);
|
|
29900
|
+
while (Date.now() < deadline) {
|
|
29901
|
+
let status;
|
|
29902
|
+
try {
|
|
29903
|
+
status = (await client.send(new GetHostedZoneCommand({ Id: zoneId }))).HostedZone?.Features?.AcceleratedRecoveryStatus;
|
|
29904
|
+
} catch (err) {
|
|
29905
|
+
if (err instanceof Error && err.name === "NoSuchHostedZone") return;
|
|
29906
|
+
throw err;
|
|
29907
|
+
}
|
|
29908
|
+
if (status === void 0 || MUTABLE.has(status)) return;
|
|
29909
|
+
if (TERMINAL_FAILED.has(status)) throw new ProvisioningError(`Cannot mutate hosted zone ${zoneId}: AcceleratedRecoveryStatus is '${status}' — operator must resolve before the record set ${logicalId} can be deleted`, resourceType, logicalId, zoneId);
|
|
29910
|
+
this.logger.debug(`Polling AcceleratedRecoveryStatus for ${zoneId}: ${status} (waiting for a mutable state, will re-poll in ~${pollIntervalMs}ms)`);
|
|
29911
|
+
const sliceEnd = Math.min(Date.now() + pollIntervalMs, deadline);
|
|
29912
|
+
while (Date.now() < sliceEnd) {
|
|
29913
|
+
const tick = Math.min(1e3, sliceEnd - Date.now());
|
|
29914
|
+
if (tick <= 0) break;
|
|
29915
|
+
await new Promise((resolve) => setTimeout(resolve, tick));
|
|
29916
|
+
}
|
|
29917
|
+
}
|
|
29918
|
+
throw new ProvisioningError(`Timed out after ${timeoutMs}ms waiting for AcceleratedRecoveryStatus to reach a mutable state on hosted zone ${zoneId} (record set ${logicalId}); re-run the destroy once the transition settles`, resourceType, logicalId, zoneId);
|
|
29919
|
+
}
|
|
29920
|
+
/**
|
|
29857
29921
|
* Build a ResourceRecordSet object from CDK properties.
|
|
29858
29922
|
*
|
|
29859
29923
|
* Handles conversion of CDK-style ResourceRecords (array of strings)
|
|
@@ -48710,6 +48774,82 @@ async function runAccept(reports, stateBackend, stateConfig, awsClients, options
|
|
|
48710
48774
|
* parent path — so `path.split('.', 1)` is always safe to extract the
|
|
48711
48775
|
* top-level key.
|
|
48712
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
|
+
}
|
|
48713
48853
|
function buildRevertNewProperties(drifts, desiredProperties, awsProperties) {
|
|
48714
48854
|
const result = { ...awsProperties };
|
|
48715
48855
|
for (const d of drifts) {
|
|
@@ -48837,6 +48977,16 @@ function printRevertPlan(reports) {
|
|
|
48837
48977
|
const word = o.changes.length === 1 ? "property path" : "property paths";
|
|
48838
48978
|
process.stdout.write(` → provider.update on ${o.logicalId} (${o.resourceType}): revert ${o.changes.length} ${word}\n`);
|
|
48839
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
|
+
}
|
|
48840
48990
|
}
|
|
48841
48991
|
}
|
|
48842
48992
|
}
|
|
@@ -65786,7 +65936,7 @@ function createMigrateCommand() {
|
|
|
65786
65936
|
*/
|
|
65787
65937
|
function buildProgram() {
|
|
65788
65938
|
const program = new Command();
|
|
65789
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.278.
|
|
65939
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.278.26");
|
|
65790
65940
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
65791
65941
|
const { profile } = actionCommand.optsWithGlobals();
|
|
65792
65942
|
if (profile !== void 0) process.env["AWS_PROFILE"] = profile;
|