@go-to-k/cdkd 0.284.53 → 0.284.54

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.
@@ -1,5 +1,5 @@
1
1
  import { a as getLiveRenderer, d as generateResourceNameWithFallback, f as getCurrentStackName, h as withStackName, l as applyDefaultNameForFallback, n as getLogger, p as looksLikeCdkdGeneratedName, u as generateResourceName } from "./logger-zRrlbaQt.js";
2
- import { t as getCdkdVersion } from "./version-CaIqvSUG.js";
2
+ import { t as getCdkdVersion } from "./version-DLRgymoe.js";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { CreateBucketCommand, DeleteObjectCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectsV2Command, NoSuchKey, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutObjectCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
5
5
  import { CloudControlClient, CreateResourceCommand, DeleteResourceCommand, GetResourceCommand, GetResourceRequestStatusCommand, ListResourcesCommand, UpdateResourceCommand } from "@aws-sdk/client-cloudcontrol";
@@ -7672,6 +7672,45 @@ var S3StateBackend = class {
7672
7672
  return keys;
7673
7673
  }
7674
7674
  /**
7675
+ * Raw sidecar-object listing WITH metadata under the state bucket.
7676
+ *
7677
+ * {@link listRawKeys}'s twin, and it exists because an age-guarded sweep
7678
+ * needs `LastModified` and the reclaim plan needs `Size` — neither of which a
7679
+ * key list carries. Used by `cdkd gc`'s custom-resource-response sweep
7680
+ * (issue #2052), where the age is the only thing separating an abandoned
7681
+ * placeholder from one a concurrent run is about to write to.
7682
+ *
7683
+ * `LastModified` / `Size` are omitted from the response only for a key S3
7684
+ * did not return metadata for, which does not happen for `ListObjectsV2`
7685
+ * `Contents` entries; an entry missing either is DROPPED rather than
7686
+ * defaulted, because defaulting the date would either exempt an object from
7687
+ * the age guard forever or expose it immediately, and both are wrong in a
7688
+ * direction the caller cannot see.
7689
+ */
7690
+ async listRawObjects(keyPrefix) {
7691
+ await this.ensureClientForBucket();
7692
+ const objects = [];
7693
+ let continuationToken;
7694
+ do {
7695
+ const response = await this.s3Client.send(new ListObjectsV2Command({
7696
+ Bucket: this.config.bucket,
7697
+ ...await this.ownerParam(),
7698
+ Prefix: keyPrefix,
7699
+ ...continuationToken && { ContinuationToken: continuationToken }
7700
+ }));
7701
+ for (const obj of response.Contents ?? []) {
7702
+ if (obj.Key === void 0 || obj.LastModified === void 0 || obj.Size === void 0) continue;
7703
+ objects.push({
7704
+ key: obj.Key,
7705
+ lastModified: obj.LastModified,
7706
+ size: obj.Size
7707
+ });
7708
+ }
7709
+ continuationToken = response.IsTruncated ? response.NextContinuationToken : void 0;
7710
+ } while (continuationToken);
7711
+ return objects;
7712
+ }
7713
+ /**
7675
7714
  * Raw sidecar-object batch delete under the state bucket. Used by the
7676
7715
  * deployment-events pruner (issue #885) to drop superseded `{runId}.jsonl`
7677
7716
  * streams + their index. Chunked to the 1,000-key `DeleteObjects` ceiling.
@@ -18451,7 +18490,7 @@ var CloudControlProvider = class {
18451
18490
  if (context?.finalSnapshotIdentifier !== void 0) throw new ProvisioningError(`${logicalId} (${resourceType}) requires a final snapshot (DeletionPolicy: Snapshot), but the Cloud Control API delete route has no final-snapshot parameter. Re-run with --skip-final-snapshot after snapshotting manually, or retain the resource.`, resourceType, logicalId, physicalId);
18452
18491
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
18453
18492
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
18454
- const { ASGProvider } = await import("./asg-provider-Ciurx_UV.js").then((n) => n.n);
18493
+ const { ASGProvider } = await import("./asg-provider-BaNTIjU4.js").then((n) => n.n);
18455
18494
  return await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
18456
18495
  }
18457
18496
  const isProtectedEc2Instance = context?.removeProtection === true && resourceType === "AWS::EC2::Instance";
@@ -19396,6 +19435,42 @@ function endCommandInterruptScope() {
19396
19435
  resetInterruptWatchLatch();
19397
19436
  }
19398
19437
 
19438
+ //#endregion
19439
+ //#region src/state/state-prefix.ts
19440
+ /**
19441
+ * The default S3 key prefix for cdkd state.
19442
+ *
19443
+ * Homed in the STATE layer rather than in `src/cli/commands/state-file-keys.ts`
19444
+ * (which re-exports it, so its four existing importers are unchanged) because
19445
+ * `src/state/lock-contention-message.ts` needs it to decide whether a recovery
19446
+ * hint should spell `--state-prefix` at all, and a `src/state/**` module
19447
+ * importing from `src/cli/commands/**` inverts the layering — the CLI sits
19448
+ * ABOVE the state layer in the 7-layer architecture, not below it.
19449
+ *
19450
+ * Note this is only the DEFAULT. Other commands accept `--state-prefix`, so
19451
+ * whole-bucket listings deliberately do not scope to it.
19452
+ */
19453
+ const DEFAULT_STATE_PREFIX = "cdkd";
19454
+ /**
19455
+ * The state-bucket prefix `CustomResourceProvider` PUTs its response
19456
+ * placeholders under, one object per invocation
19457
+ * (`custom-resource-responses/{requestId}.json`).
19458
+ *
19459
+ * Homed here for the same layering reason as {@link DEFAULT_STATE_PREFIX}: the
19460
+ * PRODUCER is `src/provisioning/providers/custom-resource-provider.ts` and the
19461
+ * COLLECTOR is `src/cli/commands/gc.ts`, so a copy in either would be a copy
19462
+ * the other could drift from — and the two spellings would then disagree about
19463
+ * which objects exist, which is the only way a sweeper can miss the family it
19464
+ * was written for (issue #2052). `src/cli/commands/state-file-keys.ts`
19465
+ * re-exports it so gc reads it alongside the other state-key constants.
19466
+ *
19467
+ * Note this is only the DEFAULT: `ProviderRegistry` can be configured with a
19468
+ * different `responsePrefix`, so a sweep scoped to this value is a sweep of the
19469
+ * default layout. gc has no access to a non-default one — nothing persists it —
19470
+ * which is stated at the sweep's own call site rather than implied here.
19471
+ */
19472
+ const CUSTOM_RESOURCE_RESPONSE_PREFIX = "custom-resource-responses";
19473
+
19399
19474
  //#endregion
19400
19475
  //#region src/provisioning/providers/custom-resource-provider.ts
19401
19476
  /**
@@ -29796,5 +29871,5 @@ var DeployEngine = class {
29796
29871
  };
29797
29872
 
29798
29873
  //#endregion
29799
- export { startInterruptWatch as $, AwsClients as $n, shouldRetainResource as $t, renderStatefulReason as A, getLegacyStateBucketName as An, isThrottlingError as Ar, redactSecretsForState as At, exportAliasCollisionScrubWarning as B, CFN_TEMPLATE_BODY_LIMIT as Bn, DiffCalculator as Bt, isFinalSnapshotError as C, runDockerForeground as Cn, SynthesisError as Cr, TEMPLATE_SOURCED_RULES as Ct, extractDeploymentEventError as D, Synthesizer as Dn, withErrorHandling as Dr, isSingleDynamicReferenceToken as Dt, makeCanonicalizePropertiesFn as E, getDockerImageBySourceHash as En, normalizeAwsError as Er, errorCauseChain as Et, green as F, resolveStateBucketWithDefault as Fn, s3BucketDomainName as Ft, collectInlinePolicyNamesManagedBySiblings as G, expectedOwnerParam as Gn, TemplateParser as Gt, secretBearingStateKeyWarning as H, MIGRATE_TMP_PREFIX as Hn, describeTypeWithThrottleRetry as Ht, red as I, resolveStateBucketWithDefaultAndSource as In, s3BucketDualStackDomainName as It, findActionableSilentDrops as J, derivePartitionAndUrlSuffix as Jn, S3StateBackend as Jt, clearOnUpdateRemoval as K, PARTITION_TABLE as Kn, LockManager as Kt, yellow as L, resolveUseCdkBootstrapAssets as Ln, s3BucketRegionalDomainName as Lt, bold as M, resolveAutoAssetStorage as Mn, __exportAll as Mr, classifyReplaySecretRegion as Mt, cyan as N, resolveCaptureObservedState as Nn, producerRegionsFromState as Nt, MULTI_REGION_RECREATE_BLOCKED_TYPES as O, synthesisStatusMessage as On, isMarkedNonRetryable as Or, maskSecretsInError as Ot, gray as P, resolveSkipPrefix as Pn, s3BucketArn as Pt, isInterruptedWaitError as Q, resolveBucketRegion as Qn, importableOutputs as Qt, collectDeclaredOutputNames as R, stateBucketExistenceConfirmed as Rn, s3BucketWebsiteUrl as Rt, createPreDeleteFinalSnapshot as S, partitionSensitiveEnv as Sn, StateError as Sr, STATE_SOURCED_READBACK_RULES as St, unsupportedFinalSnapshotError as T, AssetManifestLoader as Tn, isCdkdError as Tr, dynamicReferenceTokens as Tt, stateKeySecretExposure as U, findLargeInlineResources as Un, withRetry as Ut, isExportAliasCollision as V, CFN_TEMPLATE_URL_LIMIT as Vn, INTRINSIC_KEYS as Vt, IAMRoleProvider as W, uploadCfnTemplate as Wn, DagBuilder as Wt, beginCommandInterruptScope as X, processStackMessages as Xn, exportNamesCarriedFrom as Xt, findSilentDropProperties as Y, AssemblyReader as Yn, rebuildClientForBucketRegion as Yt, endCommandInterruptScope as Z, clearBucketRegionCache as Zn, importableOutputKeys as Zt, computeImplicitDeleteEdges as _, buildDenyExternalAccessPolicy as _n, ProvisioningError as _r, replayWarn as _t, DeploymentEventsStore as a, loadPublishableAssetManifest as an, ConfigError as ar, carriesDynamicReference as at, buildFinalSnapshotIdentifier as b, formatDockerLoginError as bn, StackHasActiveImportsError as br, requireConfigString as bt, replayFailedOperations as c, stripControlChars as cn, DeployCancelledError as cr, refStateLookupFromResource as ct, updatePartialReason as d, ensureAssetStorage as dn, LocalMigrateError as dr, resolveExplicitPhysicalId as dt, AssetPublisher as en, getAwsClients as er, CloudControlProvider as et, UNSPECIFIED_SKIP_REASON as f, getBootstrapMarkerKey as fn, LocalStartServiceError as fr, assertRegionMatch as ft, IMPLICIT_DELETE_DEPENDENCIES as g, validateContainerRepoName as gn, PartialFailureError as gr, readConfigString as gt, maskingRetryLogger as h, validateAssetBucketName as hn, NestedStackChildDirectDestroyError as hr, configStringRefusal as ht, DeploymentEventsReader as i, createAssetRedirectResolver as in, CdkdError as ir, IntrinsicFunctionResolver as it, formatResourceLine as j, resolveApp as jn, markNonRetryable as jr, scrubResourceRecord as jt, isStatefulRecreateTargetSync as k, getDefaultStateBucketName as kn, isRetryableTransientError as kr, maskSecretsInText as kt, replayRollback as l, AssetModeResolver as ln, DynamicReferenceRegionAmbiguousError as lr, WAFv2WebACLProvider as lt, withResourceDeadline as m, readBootstrapMarkerBody as mn, MissingCdkCliError as mr, configBooleanRefusal as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, WorkGraph as nn, setAwsClients as nr, disableInstanceApiTermination as nt, planFailedOps as o, rewriteTemplateAssetReferences as on, CrossAccountSecretRefusalError as or, cfnRefValueFromPhysicalId as ot, deleteSkipReason as p, parseBootstrapMarker as pn, LockError as pr, coerceCfnBoolean as pt, ProviderRegistry as q, canonicalizeRegion as qn, displaySafe as qt, DeployEngine as r, buildAssetRedirectMap as rn, AssetError as rr, isTerminationProtectionPropagationError as rt, planRollback as s, escapeRegExp$1 as sn, DependencyError as sr, getAccountInfo as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, stringifyValue as tn, resetAwsClients as tr, slowCcOperationTimeoutMs as tt, updatePartialMessage as u, BOOTSTRAP_MARKER_PREFIX as un, LocalInvokeBuildError as ur, normalizeAwsTagsToCfn as ut, ATOMIC_FINAL_SNAPSHOT_TYPES as v, buildDockerImage as vn, ResourceTimeoutError as vr, requireConfigArray as vt, refusesFinalSnapshot as w, runDockerStreaming as wn, formatError as wr, createSecretMasker as wt, ccRoutedFinalSnapshotError as x, getDockerCmd as xn, StackTerminationProtectionError as xr, STATE_SOURCED_CROSS_GENERATION_RULES as xt, PRE_DELETE_SNAPSHOT_TYPES as y, dockerSpawnEnvWithSensitive as yn, ResourceUpdateNotSupportedError as yr, requireConfigObject as yt, collectPublishedOutputNames as z, warnDeprecatedNoPrefixCliFlag as zn, applyRoleArnIfSet as zt };
29800
- //# sourceMappingURL=deploy-engine-DOP4V6eK.js.map
29874
+ export { endCommandInterruptScope as $, clearBucketRegionCache as $n, importableOutputKeys as $t, renderStatefulReason as A, synthesisStatusMessage as An, isMarkedNonRetryable as Ar, maskSecretsInError as At, exportAliasCollisionScrubWarning as B, stateBucketExistenceConfirmed as Bn, s3BucketWebsiteUrl as Bt, isFinalSnapshotError as C, getDockerCmd as Cn, StackTerminationProtectionError as Cr, STATE_SOURCED_CROSS_GENERATION_RULES as Ct, extractDeploymentEventError as D, AssetManifestLoader as Dn, isCdkdError as Dr, dynamicReferenceTokens as Dt, makeCanonicalizePropertiesFn as E, runDockerStreaming as En, formatError as Er, createSecretMasker as Et, green as F, resolveCaptureObservedState as Fn, producerRegionsFromState as Ft, collectInlinePolicyNamesManagedBySiblings as G, findLargeInlineResources as Gn, withRetry as Gt, secretBearingStateKeyWarning as H, CFN_TEMPLATE_BODY_LIMIT as Hn, DiffCalculator as Ht, red as I, resolveSkipPrefix as In, s3BucketArn as It, findActionableSilentDrops as J, PARTITION_TABLE as Jn, LockManager as Jt, clearOnUpdateRemoval as K, uploadCfnTemplate as Kn, DagBuilder as Kt, yellow as L, resolveStateBucketWithDefault as Ln, s3BucketDomainName as Lt, bold as M, getLegacyStateBucketName as Mn, isThrottlingError as Mr, redactSecretsForState as Mt, cyan as N, resolveApp as Nn, markNonRetryable as Nr, scrubResourceRecord as Nt, MULTI_REGION_RECREATE_BLOCKED_TYPES as O, getDockerImageBySourceHash as On, normalizeAwsError as Or, errorCauseChain as Ot, gray as P, resolveAutoAssetStorage as Pn, __exportAll as Pr, classifyReplaySecretRegion as Pt, beginCommandInterruptScope as Q, processStackMessages as Qn, exportNamesCarriedFrom as Qt, collectDeclaredOutputNames as R, resolveStateBucketWithDefaultAndSource as Rn, s3BucketDualStackDomainName as Rt, createPreDeleteFinalSnapshot as S, formatDockerLoginError as Sn, StackHasActiveImportsError as Sr, requireConfigString as St, unsupportedFinalSnapshotError as T, runDockerForeground as Tn, SynthesisError as Tr, TEMPLATE_SOURCED_RULES as Tt, stateKeySecretExposure as U, CFN_TEMPLATE_URL_LIMIT as Un, INTRINSIC_KEYS as Ut, isExportAliasCollision as V, warnDeprecatedNoPrefixCliFlag as Vn, applyRoleArnIfSet as Vt, IAMRoleProvider as W, MIGRATE_TMP_PREFIX as Wn, describeTypeWithThrottleRetry as Wt, CUSTOM_RESOURCE_RESPONSE_PREFIX as X, derivePartitionAndUrlSuffix as Xn, S3StateBackend as Xt, findSilentDropProperties as Y, canonicalizeRegion as Yn, displaySafe as Yt, DEFAULT_STATE_PREFIX as Z, AssemblyReader as Zn, rebuildClientForBucketRegion as Zt, computeImplicitDeleteEdges as _, validateAssetBucketName as _n, NestedStackChildDirectDestroyError as _r, configStringRefusal as _t, DeploymentEventsStore as a, buildAssetRedirectMap as an, AssetError as ar, isTerminationProtectionPropagationError as at, buildFinalSnapshotIdentifier as b, buildDockerImage as bn, ResourceTimeoutError as br, requireConfigArray as bt, replayFailedOperations as c, rewriteTemplateAssetReferences as cn, CrossAccountSecretRefusalError as cr, cfnRefValueFromPhysicalId as ct, updatePartialReason as d, AssetModeResolver as dn, DynamicReferenceRegionAmbiguousError as dr, WAFv2WebACLProvider as dt, importableOutputs as en, resolveBucketRegion as er, isInterruptedWaitError as et, UNSPECIFIED_SKIP_REASON as f, BOOTSTRAP_MARKER_PREFIX as fn, LocalInvokeBuildError as fr, normalizeAwsTagsToCfn as ft, IMPLICIT_DELETE_DEPENDENCIES as g, readBootstrapMarkerBody as gn, MissingCdkCliError as gr, configBooleanRefusal as gt, maskingRetryLogger as h, parseBootstrapMarker as hn, LockError as hr, coerceCfnBoolean as ht, DeploymentEventsReader as i, WorkGraph as in, setAwsClients as ir, disableInstanceApiTermination as it, formatResourceLine as j, getDefaultStateBucketName as jn, isRetryableTransientError as jr, maskSecretsInText as jt, isStatefulRecreateTargetSync as k, Synthesizer as kn, withErrorHandling as kr, isSingleDynamicReferenceToken as kt, replayRollback as l, escapeRegExp$1 as ln, DependencyError as lr, getAccountInfo as lt, withResourceDeadline as m, getBootstrapMarkerKey as mn, LocalStartServiceError as mr, assertRegionMatch as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, AssetPublisher as nn, getAwsClients as nr, CloudControlProvider as nt, planFailedOps as o, createAssetRedirectResolver as on, CdkdError as or, IntrinsicFunctionResolver as ot, deleteSkipReason as p, ensureAssetStorage as pn, LocalMigrateError as pr, resolveExplicitPhysicalId as pt, ProviderRegistry as q, expectedOwnerParam as qn, TemplateParser as qt, DeployEngine as r, stringifyValue as rn, resetAwsClients as rr, slowCcOperationTimeoutMs as rt, planRollback as s, loadPublishableAssetManifest as sn, ConfigError as sr, carriesDynamicReference as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, shouldRetainResource as tn, AwsClients as tr, startInterruptWatch as tt, updatePartialMessage as u, stripControlChars as un, DeployCancelledError as ur, refStateLookupFromResource as ut, ATOMIC_FINAL_SNAPSHOT_TYPES as v, validateContainerRepoName as vn, PartialFailureError as vr, readConfigString as vt, refusesFinalSnapshot as w, partitionSensitiveEnv as wn, StateError as wr, STATE_SOURCED_READBACK_RULES as wt, ccRoutedFinalSnapshotError as x, dockerSpawnEnvWithSensitive as xn, ResourceUpdateNotSupportedError as xr, requireConfigObject as xt, PRE_DELETE_SNAPSHOT_TYPES as y, buildDenyExternalAccessPolicy as yn, ProvisioningError as yr, replayWarn as yt, collectPublishedOutputNames as z, resolveUseCdkBootstrapAssets as zn, s3BucketRegionalDomainName as zt };
29875
+ //# sourceMappingURL=deploy-engine-B9SrF2-R.js.map