@go-to-k/cdkd 0.192.0 → 0.194.0
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,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { _ as withSkipPrefix, a as runDockerStreaming, c as getLogger, d as getLiveRenderer, f as PATTERN_B_NAME_PROPERTIES, g as generateResourceNameWithFallback, h as generateResourceName, i as runDockerForeground, n as formatDockerLoginError, p as PATTERN_B_RESOURCE_TYPES, r as getDockerCmd, u as runStackBuffered, v as withStackName } from "./docker-cmd-iDMcWcre.js";
|
|
3
|
-
import { A as S3StateBackend, B as resolveCaptureObservedState, C as assertRegionMatch, D as DagBuilder, E as DiffCalculator, F as buildDockerImage, G as CFN_TEMPLATE_BODY_LIMIT, H as resolveStateBucketWithDefault, I as Synthesizer, J as findLargeInlineResources, K as CFN_TEMPLATE_URL_LIMIT, L as getDefaultStateBucketName, M as AssetPublisher, N as stringifyValue, O as TemplateParser, P as WorkGraph, Q as resolveBucketRegion, R as getLegacyStateBucketName, S as CloudControlProvider, T as applyRoleArnIfSet, U as resolveStateBucketWithDefaultAndSource, V as resolveSkipPrefix, W as warnDeprecatedNoPrefixCliFlag, X as AssemblyReader, Y as uploadCfnTemplate, _ as matchesCdkPath, a as withRetry, at as LocalStartServiceError, b as ProviderRegistry, bt as withErrorHandling, c as bold, ct as NestedStackChildDirectDestroyError, d as green, dt as ResourceTimeoutError, et as CdkdError, f as red, ft as ResourceUpdateNotSupportedError, g as CDK_PATH_TAG, h as collectInlinePolicyNamesManagedBySiblings, i as withResourceDeadline, it as LocalMigrateError, j as shouldRetainResource, k as LockManager, l as cyan, lt as PartialFailureError, m as IAMRoleProvider, mt as StackTerminationProtectionError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as IMPLICIT_DELETE_DEPENDENCIES, p as yellow, pt as StackHasActiveImportsError, q as MIGRATE_TMP_PREFIX, r as DeployEngine, rt as LocalInvokeBuildError$1, s as formatResourceLine, st as MissingCdkCliError, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as gray, ut as ProvisioningError, v as normalizeAwsTagsToCfn, w as IntrinsicFunctionResolver, x as findActionableSilentDrops, y as resolveExplicitPhysicalId, yt as normalizeAwsError, z as resolveApp } from "./deploy-engine-
|
|
3
|
+
import { A as S3StateBackend, B as resolveCaptureObservedState, C as assertRegionMatch, D as DagBuilder, E as DiffCalculator, F as buildDockerImage, G as CFN_TEMPLATE_BODY_LIMIT, H as resolveStateBucketWithDefault, I as Synthesizer, J as findLargeInlineResources, K as CFN_TEMPLATE_URL_LIMIT, L as getDefaultStateBucketName, M as AssetPublisher, N as stringifyValue, O as TemplateParser, P as WorkGraph, Q as resolveBucketRegion, R as getLegacyStateBucketName, S as CloudControlProvider, T as applyRoleArnIfSet, U as resolveStateBucketWithDefaultAndSource, V as resolveSkipPrefix, W as warnDeprecatedNoPrefixCliFlag, X as AssemblyReader, Y as uploadCfnTemplate, _ as matchesCdkPath, a as withRetry, at as LocalStartServiceError, b as ProviderRegistry, bt as withErrorHandling, c as bold, ct as NestedStackChildDirectDestroyError, d as green, dt as ResourceTimeoutError, et as CdkdError, f as red, ft as ResourceUpdateNotSupportedError, g as CDK_PATH_TAG, h as collectInlinePolicyNamesManagedBySiblings, i as withResourceDeadline, it as LocalMigrateError, j as shouldRetainResource, k as LockManager, l as cyan, lt as PartialFailureError, m as IAMRoleProvider, mt as StackTerminationProtectionError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as IMPLICIT_DELETE_DEPENDENCIES, p as yellow, pt as StackHasActiveImportsError, q as MIGRATE_TMP_PREFIX, r as DeployEngine, rt as LocalInvokeBuildError$1, s as formatResourceLine, st as MissingCdkCliError, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as gray, ut as ProvisioningError, v as normalizeAwsTagsToCfn, w as IntrinsicFunctionResolver, x as findActionableSilentDrops, y as resolveExplicitPhysicalId, yt as normalizeAwsError, z as resolveApp } from "./deploy-engine-BDmJX4ss.js";
|
|
4
4
|
import { a as setAwsClients, i as resetAwsClients, r as getAwsClients, t as AwsClients } from "./aws-clients-B15NAPbL.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -28,7 +28,7 @@ import * as path from "node:path";
|
|
|
28
28
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
29
29
|
import { execFile, spawn } from "node:child_process";
|
|
30
30
|
import { tmpdir } from "node:os";
|
|
31
|
-
import { AssociateVPCWithHostedZoneCommand, ChangeResourceRecordSetsCommand, ChangeTagsForResourceCommand, CreateHostedZoneCommand, CreateQueryLoggingConfigCommand, DeleteHostedZoneCommand, DeleteQueryLoggingConfigCommand, DisassociateVPCFromHostedZoneCommand, GetHostedZoneCommand, ListHostedZonesByNameCommand, ListHostedZonesCommand, ListQueryLoggingConfigsCommand, ListResourceRecordSetsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$6, Route53Client, UpdateHostedZoneCommentCommand } from "@aws-sdk/client-route-53";
|
|
31
|
+
import { AssociateVPCWithHostedZoneCommand, ChangeResourceRecordSetsCommand, ChangeTagsForResourceCommand, CreateHostedZoneCommand, CreateQueryLoggingConfigCommand, DeleteHostedZoneCommand, DeleteQueryLoggingConfigCommand, DisassociateVPCFromHostedZoneCommand, GetHostedZoneCommand, ListHostedZonesByNameCommand, ListHostedZonesCommand, ListQueryLoggingConfigsCommand, ListResourceRecordSetsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$6, Route53Client, UpdateHostedZoneCommentCommand, UpdateHostedZoneFeaturesCommand } from "@aws-sdk/client-route-53";
|
|
32
32
|
import { AddTagsCommand, CreateListenerCommand, CreateLoadBalancerCommand, CreateTargetGroupCommand, DeleteListenerCommand, DeleteLoadBalancerCommand, DeleteTargetGroupCommand, DescribeListenersCommand, DescribeLoadBalancerAttributesCommand, DescribeLoadBalancersCommand, DescribeTagsCommand, DescribeTargetGroupsCommand, ElasticLoadBalancingV2Client, ModifyListenerCommand, ModifyLoadBalancerAttributesCommand, ModifyTargetGroupCommand, RemoveTagsCommand, SetIpAddressTypeCommand, SetSecurityGroupsCommand, SetSubnetsCommand } from "@aws-sdk/client-elastic-load-balancing-v2";
|
|
33
33
|
import { CreateAliasCommand, CreateKeyCommand, DeleteAliasCommand, DescribeKeyCommand, DisableKeyCommand, DisableKeyRotationCommand, EnableKeyCommand, EnableKeyRotationCommand, GetKeyPolicyCommand, GetKeyRotationStatusCommand, KMSClient, ListAliasesCommand, ListKeysCommand, ListResourceTagsCommand, NotFoundException as NotFoundException$2, PutKeyPolicyCommand, ScheduleKeyDeletionCommand, TagResourceCommand as TagResourceCommand$8, UntagResourceCommand as UntagResourceCommand$8, UpdateAliasCommand, UpdateKeyDescriptionCommand } from "@aws-sdk/client-kms";
|
|
34
34
|
import { CreateRepositoryCommand, DeleteLifecyclePolicyCommand, DeleteRepositoryCommand, DeleteRepositoryPolicyCommand, DescribeRepositoriesCommand, ECRClient, GetAuthorizationTokenCommand, GetLifecyclePolicyCommand, LifecyclePolicyNotFoundException, ListTagsForResourceCommand as ListTagsForResourceCommand$7, PutImageScanningConfigurationCommand, PutImageTagMutabilityCommand, PutLifecyclePolicyCommand, RepositoryNotFoundException, SetRepositoryPolicyCommand, TagResourceCommand as TagResourceCommand$9 } from "@aws-sdk/client-ecr";
|
|
@@ -18080,6 +18080,7 @@ var ECSProvider = class {
|
|
|
18080
18080
|
"DefaultCapacityProviderStrategy",
|
|
18081
18081
|
"Configuration",
|
|
18082
18082
|
"ClusterSettings",
|
|
18083
|
+
"ServiceConnectDefaults",
|
|
18083
18084
|
"Tags"
|
|
18084
18085
|
])],
|
|
18085
18086
|
["AWS::ECS::TaskDefinition", new Set([
|
|
@@ -18174,6 +18175,7 @@ var ECSProvider = class {
|
|
|
18174
18175
|
name: s["Name"] || s["name"],
|
|
18175
18176
|
value: (s["Value"] || s["value"]) ?? void 0
|
|
18176
18177
|
})) : void 0,
|
|
18178
|
+
serviceConnectDefaults: properties["ServiceConnectDefaults"] ? { namespace: properties["ServiceConnectDefaults"]["Namespace"] } : void 0,
|
|
18177
18179
|
tags: convertTags(properties["Tags"])
|
|
18178
18180
|
}))).cluster;
|
|
18179
18181
|
if (!cluster || !cluster.clusterArn) throw new Error("CreateCluster did not return cluster ARN");
|
|
@@ -18201,17 +18203,20 @@ var ECSProvider = class {
|
|
|
18201
18203
|
}
|
|
18202
18204
|
const settingsChanged = JSON.stringify(previousProperties["ClusterSettings"] ?? null) !== JSON.stringify(properties["ClusterSettings"] ?? null);
|
|
18203
18205
|
const configChanged = JSON.stringify(previousProperties["Configuration"] ?? null) !== JSON.stringify(properties["Configuration"] ?? null);
|
|
18204
|
-
|
|
18206
|
+
const svcConnectChanged = JSON.stringify(previousProperties["ServiceConnectDefaults"] ?? null) !== JSON.stringify(properties["ServiceConnectDefaults"] ?? null);
|
|
18207
|
+
if (settingsChanged || configChanged || svcConnectChanged) {
|
|
18205
18208
|
const settingsInput = settingsChanged ? (properties["ClusterSettings"] ?? []).map((s) => ({
|
|
18206
18209
|
name: s["Name"] || s["name"],
|
|
18207
18210
|
value: (s["Value"] || s["value"]) ?? void 0
|
|
18208
18211
|
})) : void 0;
|
|
18212
|
+
const svcConnectInput = svcConnectChanged ? properties["ServiceConnectDefaults"] ? { namespace: properties["ServiceConnectDefaults"]["Namespace"] } : { namespace: "" } : void 0;
|
|
18209
18213
|
await client.send(new UpdateClusterCommand({
|
|
18210
18214
|
cluster: physicalId,
|
|
18211
18215
|
...settingsChanged && { settings: settingsInput },
|
|
18212
|
-
...configChanged && { configuration: properties["Configuration"] }
|
|
18216
|
+
...configChanged && { configuration: properties["Configuration"] },
|
|
18217
|
+
...svcConnectChanged && { serviceConnectDefaults: svcConnectInput }
|
|
18213
18218
|
}));
|
|
18214
|
-
this.logger.debug(`Updated ECS cluster ${physicalId} (settings=${settingsChanged}, config=${configChanged})`);
|
|
18219
|
+
this.logger.debug(`Updated ECS cluster ${physicalId} (settings=${settingsChanged}, config=${configChanged}, svcConnect=${svcConnectChanged})`);
|
|
18215
18220
|
}
|
|
18216
18221
|
const cluster = (await client.send(new DescribeClustersCommand({ clusters: [physicalId] }))).clusters?.[0];
|
|
18217
18222
|
if (cluster?.clusterArn) await this.applyTagDiff(cluster.clusterArn, previousProperties["Tags"], properties["Tags"]);
|
|
@@ -18737,6 +18742,7 @@ var ECSProvider = class {
|
|
|
18737
18742
|
Name: s.name,
|
|
18738
18743
|
Value: s.value
|
|
18739
18744
|
}));
|
|
18745
|
+
if (c.serviceConnectDefaults?.namespace !== void 0) result["ServiceConnectDefaults"] = { Namespace: c.serviceConnectDefaults.namespace };
|
|
18740
18746
|
result["Tags"] = normalizeAwsTagsToCfn(c.tags);
|
|
18741
18747
|
return result;
|
|
18742
18748
|
}
|
|
@@ -22644,7 +22650,8 @@ var Route53Provider = class {
|
|
|
22644
22650
|
"HostedZoneConfig",
|
|
22645
22651
|
"HostedZoneTags",
|
|
22646
22652
|
"VPCs",
|
|
22647
|
-
"QueryLoggingConfig"
|
|
22653
|
+
"QueryLoggingConfig",
|
|
22654
|
+
"HostedZoneFeatures"
|
|
22648
22655
|
])], ["AWS::Route53::RecordSet", new Set([
|
|
22649
22656
|
"HostedZoneId",
|
|
22650
22657
|
"HostedZoneName",
|
|
@@ -22675,9 +22682,9 @@ var Route53Provider = class {
|
|
|
22675
22682
|
default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId);
|
|
22676
22683
|
}
|
|
22677
22684
|
}
|
|
22678
|
-
async update(logicalId, physicalId, resourceType, properties,
|
|
22685
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
22679
22686
|
switch (resourceType) {
|
|
22680
|
-
case "AWS::Route53::HostedZone": return this.updateHostedZone(logicalId, physicalId, resourceType, properties);
|
|
22687
|
+
case "AWS::Route53::HostedZone": return this.updateHostedZone(logicalId, physicalId, resourceType, properties, previousProperties);
|
|
22681
22688
|
case "AWS::Route53::RecordSet": return this.updateRecordSet(logicalId, physicalId, resourceType, properties);
|
|
22682
22689
|
default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
|
|
22683
22690
|
}
|
|
@@ -22731,6 +22738,22 @@ var Route53Provider = class {
|
|
|
22731
22738
|
}
|
|
22732
22739
|
await this.applyHostedZoneTags(zoneId, properties, logicalId);
|
|
22733
22740
|
await this.applyQueryLoggingConfig(zoneId, properties, logicalId);
|
|
22741
|
+
if (properties["HostedZoneFeatures"]?.["AcceleratedRecoveryStatus"] === "ENABLED") try {
|
|
22742
|
+
await this.getClient().send(new UpdateHostedZoneFeaturesCommand({
|
|
22743
|
+
HostedZoneId: zoneId,
|
|
22744
|
+
EnableAcceleratedRecovery: true
|
|
22745
|
+
}));
|
|
22746
|
+
} catch (uhfError) {
|
|
22747
|
+
this.logger.error(`UpdateHostedZoneFeatures failed for ${zoneId} after CreateHostedZone — rolling back the hosted zone to keep deploy retry idempotent`);
|
|
22748
|
+
try {
|
|
22749
|
+
await this.deleteQueryLoggingConfigForZone(zoneId, logicalId);
|
|
22750
|
+
await this.getClient().send(new DeleteHostedZoneCommand({ Id: zoneId }));
|
|
22751
|
+
} catch (deleteError) {
|
|
22752
|
+
this.logger.warn(`Best-effort rollback DeleteHostedZone for ${zoneId} also failed: ${deleteError instanceof Error ? deleteError.message : String(deleteError)} — operator may need to clean up the orphan zone`);
|
|
22753
|
+
}
|
|
22754
|
+
const cause = uhfError instanceof Error ? uhfError : void 0;
|
|
22755
|
+
throw new ProvisioningError(`Failed to enable Accelerated Recovery on hosted zone ${logicalId} (${zoneId}): ${uhfError instanceof Error ? uhfError.message : String(uhfError)}`, resourceType, logicalId, zoneId, cause);
|
|
22756
|
+
}
|
|
22734
22757
|
const nameServers = response.DelegationSet?.NameServers ?? [];
|
|
22735
22758
|
this.logger.debug(`Successfully created hosted zone ${logicalId}: ${zoneId}`);
|
|
22736
22759
|
return {
|
|
@@ -22746,7 +22769,7 @@ var Route53Provider = class {
|
|
|
22746
22769
|
throw new ProvisioningError(`Failed to create hosted zone ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
|
|
22747
22770
|
}
|
|
22748
22771
|
}
|
|
22749
|
-
async updateHostedZone(logicalId, physicalId, resourceType, properties) {
|
|
22772
|
+
async updateHostedZone(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
22750
22773
|
this.logger.debug(`Updating Route 53 hosted zone ${logicalId}: ${physicalId}`);
|
|
22751
22774
|
try {
|
|
22752
22775
|
const comment = properties["HostedZoneConfig"]?.["Comment"] ?? "";
|
|
@@ -22757,6 +22780,12 @@ var Route53Provider = class {
|
|
|
22757
22780
|
await this.applyHostedZoneTags(physicalId, properties, logicalId);
|
|
22758
22781
|
await this.applyQueryLoggingConfig(physicalId, properties, logicalId);
|
|
22759
22782
|
await this.syncVPCAssociations(physicalId, properties, logicalId);
|
|
22783
|
+
const prevEnabled = previousProperties["HostedZoneFeatures"]?.["AcceleratedRecoveryStatus"] === "ENABLED";
|
|
22784
|
+
const nextEnabled = properties["HostedZoneFeatures"]?.["AcceleratedRecoveryStatus"] === "ENABLED";
|
|
22785
|
+
if (prevEnabled !== nextEnabled) await this.getClient().send(new UpdateHostedZoneFeaturesCommand({
|
|
22786
|
+
HostedZoneId: physicalId,
|
|
22787
|
+
EnableAcceleratedRecovery: nextEnabled
|
|
22788
|
+
}));
|
|
22760
22789
|
const nameServers = (await this.getClient().send(new GetHostedZoneCommand({ Id: physicalId }))).DelegationSet?.NameServers ?? [];
|
|
22761
22790
|
this.logger.debug(`Successfully updated hosted zone ${logicalId}`);
|
|
22762
22791
|
return {
|
|
@@ -22776,6 +22805,7 @@ var Route53Provider = class {
|
|
|
22776
22805
|
this.logger.debug(`Deleting Route 53 hosted zone ${logicalId}: ${physicalId}`);
|
|
22777
22806
|
try {
|
|
22778
22807
|
await this.deleteQueryLoggingConfigForZone(physicalId, logicalId);
|
|
22808
|
+
await this.ensureAcceleratedRecoveryDisabledForDelete(physicalId, logicalId);
|
|
22779
22809
|
await this.getClient().send(new DeleteHostedZoneCommand({ Id: physicalId }));
|
|
22780
22810
|
this.logger.debug(`Successfully deleted hosted zone ${logicalId}`);
|
|
22781
22811
|
} catch (error) {
|
|
@@ -22784,10 +22814,86 @@ var Route53Provider = class {
|
|
|
22784
22814
|
this.logger.debug(`Hosted zone ${physicalId} does not exist, skipping deletion`);
|
|
22785
22815
|
return;
|
|
22786
22816
|
}
|
|
22817
|
+
if (error instanceof ProvisioningError) throw error;
|
|
22787
22818
|
const cause = error instanceof Error ? error : void 0;
|
|
22788
22819
|
throw new ProvisioningError(`Failed to delete hosted zone ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
22789
22820
|
}
|
|
22790
22821
|
}
|
|
22822
|
+
/**
|
|
22823
|
+
* Pre-delete guard for `AWS::Route53::HostedZone:HostedZoneFeatures`.
|
|
22824
|
+
*
|
|
22825
|
+
* AWS rejects `DeleteHostedZone` while AcceleratedRecovery is anything
|
|
22826
|
+
* other than DISABLED (the feature uses an async control plane API —
|
|
22827
|
+
* `UpdateHostedZoneFeatures` — and AWS won't tear down a zone whose
|
|
22828
|
+
* feature state is still in flight). This helper:
|
|
22829
|
+
*
|
|
22830
|
+
* 1. Reads the current `HostedZone.Features.AcceleratedRecoveryStatus`.
|
|
22831
|
+
* DISABLED / undefined / NoSuchHostedZone → return early (nothing
|
|
22832
|
+
* to do, the delete will proceed normally or hit the existing
|
|
22833
|
+
* NoSuchHostedZone short-circuit).
|
|
22834
|
+
* 2. ENABLING / ENABLED → issue `UpdateHostedZoneFeatures(false)` then
|
|
22835
|
+
* poll `GetHostedZone` until the status settles to DISABLED.
|
|
22836
|
+
* 3. DISABLING → poll without re-issuing the toggle.
|
|
22837
|
+
* 4. *_FAILED / *_HOSTED_ZONE_LOCKED → surface the AWS error to the
|
|
22838
|
+
* operator (out of scope for cdkd to recover automatically).
|
|
22839
|
+
*
|
|
22840
|
+
* Poll budget: env-overridable timeout (default 10 min) + interval
|
|
22841
|
+
* (default 15s; tests override via env to keep runs fast). Failure to
|
|
22842
|
+
* settle within the budget throws — the operator can either re-run
|
|
22843
|
+
* `cdkd state destroy` (poll resets) or disable manually.
|
|
22844
|
+
*/
|
|
22845
|
+
async ensureAcceleratedRecoveryDisabledForDelete(physicalId, logicalId) {
|
|
22846
|
+
const client = this.getClient();
|
|
22847
|
+
const pollIntervalMs = Number.parseInt(process.env["CDKD_R53_ACCEL_RECOVERY_POLL_INTERVAL_MS"] ?? "15000", 10);
|
|
22848
|
+
const timeoutMs = Number.parseInt(process.env["CDKD_R53_ACCEL_RECOVERY_POLL_TIMEOUT_MS"] ?? "600000", 10);
|
|
22849
|
+
const readStatus = async () => {
|
|
22850
|
+
try {
|
|
22851
|
+
return (await client.send(new GetHostedZoneCommand({ Id: physicalId }))).HostedZone?.Features?.AcceleratedRecoveryStatus;
|
|
22852
|
+
} catch (err) {
|
|
22853
|
+
if (err instanceof Error && err.name === "NoSuchHostedZone") return void 0;
|
|
22854
|
+
throw err;
|
|
22855
|
+
}
|
|
22856
|
+
};
|
|
22857
|
+
const deadline = Date.now() + timeoutMs;
|
|
22858
|
+
const TERMINAL_FAILED = new Set([
|
|
22859
|
+
"ENABLE_FAILED",
|
|
22860
|
+
"DISABLE_FAILED",
|
|
22861
|
+
"ENABLING_HOSTED_ZONE_LOCKED",
|
|
22862
|
+
"DISABLING_HOSTED_ZONE_LOCKED"
|
|
22863
|
+
]);
|
|
22864
|
+
const waitFor = async (targets, label) => {
|
|
22865
|
+
while (Date.now() < deadline) {
|
|
22866
|
+
const status = await readStatus();
|
|
22867
|
+
if (status === void 0 || targets.has(status)) return status;
|
|
22868
|
+
if (TERMINAL_FAILED.has(status)) throw new ProvisioningError(`Cannot delete hosted zone ${logicalId} (${physicalId}): AcceleratedRecoveryStatus transitioned to '${status}' while waiting for ${label} — operator must resolve before destroy can proceed`, "AWS::Route53::HostedZone", logicalId, physicalId);
|
|
22869
|
+
this.logger.debug(`Polling AcceleratedRecoveryStatus for ${physicalId}: ${status} (waiting for ${label}, will re-poll in ~${pollIntervalMs}ms)`);
|
|
22870
|
+
const sliceEnd = Math.min(Date.now() + pollIntervalMs, deadline);
|
|
22871
|
+
while (Date.now() < sliceEnd) {
|
|
22872
|
+
const tick = Math.min(1e3, sliceEnd - Date.now());
|
|
22873
|
+
if (tick <= 0) break;
|
|
22874
|
+
await new Promise((resolve) => setTimeout(resolve, tick));
|
|
22875
|
+
}
|
|
22876
|
+
}
|
|
22877
|
+
throw new ProvisioningError(`Timed out after ${timeoutMs}ms waiting for AcceleratedRecoveryStatus to reach ${label} on hosted zone ${logicalId} (${physicalId}); re-run \`cdkd state destroy\` or disable manually via \`aws route53 update-hosted-zone-features --hosted-zone-id ${physicalId} --no-enable-accelerated-recovery\``, "AWS::Route53::HostedZone", logicalId, physicalId);
|
|
22878
|
+
};
|
|
22879
|
+
let current = await readStatus();
|
|
22880
|
+
if (current === void 0 || current === "DISABLED") return;
|
|
22881
|
+
if (TERMINAL_FAILED.has(current)) throw new ProvisioningError(`Cannot delete hosted zone ${logicalId} (${physicalId}): AcceleratedRecoveryStatus is '${current}' — operator must resolve before destroy can proceed`, "AWS::Route53::HostedZone", logicalId, physicalId);
|
|
22882
|
+
if (current === "ENABLING") {
|
|
22883
|
+
this.logger.debug(`Hosted zone ${physicalId} is ENABLING; waiting for it to settle before issuing disable`);
|
|
22884
|
+
current = await waitFor(new Set(["ENABLED", "DISABLED"]), "ENABLED or DISABLED");
|
|
22885
|
+
if (current === void 0 || current === "DISABLED") return;
|
|
22886
|
+
}
|
|
22887
|
+
if (current === "ENABLED") {
|
|
22888
|
+
this.logger.debug(`Hosted zone ${physicalId} is ENABLED; issuing UpdateHostedZoneFeatures(false) before delete`);
|
|
22889
|
+
await client.send(new UpdateHostedZoneFeaturesCommand({
|
|
22890
|
+
HostedZoneId: physicalId,
|
|
22891
|
+
EnableAcceleratedRecovery: false
|
|
22892
|
+
}));
|
|
22893
|
+
} else if (current === "DISABLING") this.logger.debug(`Hosted zone ${physicalId} AcceleratedRecovery is already DISABLING; waiting for settle`);
|
|
22894
|
+
const settled = await waitFor(new Set(["DISABLED"]), "DISABLED");
|
|
22895
|
+
this.logger.debug(`Hosted zone ${physicalId} AcceleratedRecoveryStatus settled to ${settled ?? "undefined (zone gone)"}`);
|
|
22896
|
+
}
|
|
22791
22897
|
async getHostedZoneAttribute(physicalId, attributeName) {
|
|
22792
22898
|
switch (attributeName) {
|
|
22793
22899
|
case "Id": return physicalId;
|
|
@@ -23125,6 +23231,7 @@ var Route53Provider = class {
|
|
|
23125
23231
|
if (resp.HostedZone.Config?.PrivateZone !== void 0) cfg["PrivateZone"] = resp.HostedZone.Config.PrivateZone;
|
|
23126
23232
|
result["HostedZoneConfig"] = cfg;
|
|
23127
23233
|
}
|
|
23234
|
+
if (resp.HostedZone.Features?.AcceleratedRecoveryStatus !== void 0) result["HostedZoneFeatures"] = { AcceleratedRecoveryStatus: resp.HostedZone.Features.AcceleratedRecoveryStatus };
|
|
23128
23235
|
if (resp.HostedZone.Config?.PrivateZone === true) result["VPCs"] = (resp.VPCs ?? []).map((v) => {
|
|
23129
23236
|
const out = {};
|
|
23130
23237
|
if (v.VPCId !== void 0) out["VPCId"] = v.VPCId;
|
|
@@ -52445,7 +52552,7 @@ function reorderArgs(argv) {
|
|
|
52445
52552
|
*/
|
|
52446
52553
|
async function main() {
|
|
52447
52554
|
const program = new Command();
|
|
52448
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
52555
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.194.0");
|
|
52449
52556
|
program.addCommand(createBootstrapCommand());
|
|
52450
52557
|
program.addCommand(createSynthCommand());
|
|
52451
52558
|
program.addCommand(createListCommand());
|