@go-to-k/cdkd 0.278.24 → 0.278.25
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-BRlawK4H.js} +2 -2
- package/dist/{asg-provider-cNZXiMc7.js.map → asg-provider-BRlawK4H.js.map} +1 -1
- package/dist/cli.js +68 -4
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-DlLaOrHh.js → deploy-engine-B65VTlrZ.js} +4 -3
- package/dist/deploy-engine-B65VTlrZ.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-B65VTlrZ.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-BRlawK4H.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)
|
|
@@ -65786,7 +65850,7 @@ function createMigrateCommand() {
|
|
|
65786
65850
|
*/
|
|
65787
65851
|
function buildProgram() {
|
|
65788
65852
|
const program = new Command();
|
|
65789
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.278.
|
|
65853
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.278.25");
|
|
65790
65854
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
65791
65855
|
const { profile } = actionCommand.optsWithGlobals();
|
|
65792
65856
|
if (profile !== void 0) process.env["AWS_PROFILE"] = profile;
|