@go-to-k/cdkd 0.278.8 → 0.278.10

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 DagBuilder, A as red, At as resolveApp, B as isTerminationProtectionPropagationError, Bt as CFN_TEMPLATE_URL_LIMIT, C as isStatefulRecreateTargetSync, Ct as runDockerStreaming, D as cyan, Dt as synthesisStatusMessage, E as bold, Et as Synthesizer, F as ProviderRegistry, Ft as resolveStateBucketWithDefaultAndSource, G as normalizeAwsTagsToCfn, Gt as AssemblyReader, H as cfnRefValueFromPhysicalId, Ht as findLargeInlineResources, I as findActionableSilentDrops, It as resolveUseCdkBootstrapAssets, J as applyRoleArnIfSet, Jt as resolveBucketRegion, K as resolveExplicitPhysicalId, Kt as processStackMessages, L as CloudControlProvider, Lt as stateBucketExistenceConfirmed, M as IAMRoleProvider, Mt as resolveCaptureObservedState, N as collectInlinePolicyNamesManagedBySiblings, Nt as resolveSkipPrefix, O as gray, Ot as getDefaultStateBucketName, P as clearOnUpdateRemoval, Pt as resolveStateBucketWithDefault, Q as isRetryableTransientError, Qt as setAwsClients, R as slowCcOperationTimeoutMs, Rt as warnDeprecatedNoPrefixCliFlag, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, St as runDockerForeground, T as formatResourceLine, Tt as getDockerImageBySourceHash, U as refStateLookupFromResource, Ut as uploadCfnTemplate, V as IntrinsicFunctionResolver, Vt as MIGRATE_TMP_PREFIX, W as WAFv2WebACLProvider, Wt as expectedOwnerParam, X as describeTypeWithThrottleRetry, Xt as getAwsClients, Y as DiffCalculator, Yt as AwsClients, Z as withRetry, Zt as resetAwsClients, _ as createPreDeleteFinalSnapshot, _t as validateAssetBucketName, a as DeploymentEventsStore, an as LocalMigrateError, at as AssetPublisher, b as unsupportedFinalSnapshotError, bn as normalizeAwsError, bt as formatDockerLoginError, c as replayFailedOperations, cn as MissingCdkCliError, ct as buildAssetRedirectMap, d as IMPLICIT_DELETE_DEPENDENCIES, dn as ProvisioningError, dt as rewriteTemplateAssetReferences, en as CdkdError, et as TemplateParser, f as computeImplicitDeleteEdges, fn as ResourceTimeoutError, ft as AssetModeResolver, g as ccRoutedFinalSnapshotError, gt as parseBootstrapMarker, h as buildFinalSnapshotIdentifier, hn as StackTerminationProtectionError, ht as getBootstrapMarkerKey, i as DeploymentEventsReader, in as LocalInvokeBuildError$1, it as shouldRetainResource, j as yellow, jt as resolveAutoAssetStorage, k as green, kt as getLegacyStateBucketName, l as replayRollback, ln as NestedStackChildDirectDestroyError, lt as createAssetRedirectResolver, m as PRE_DELETE_SNAPSHOT_TYPES, mn as StackHasActiveImportsError, mt as ensureAssetStorage, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as S3StateBackend, o as planFailedOps, on as LocalStartServiceError, ot as stringifyValue, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as ResourceUpdateNotSupportedError, pt as BOOTSTRAP_MARKER_PREFIX, q as assertRegionMatch, r as DeployEngine, rn as DeployCancelledError, rt as rebuildClientForBucketRegion, s as planRollback, st as WorkGraph, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as LockManager, u as withResourceDeadline, un as PartialFailureError, ut as loadPublishableAssetManifest, v as isFinalSnapshotError, vt as validateContainerRepoName, w as renderStatefulReason, wt as AssetManifestLoader, x as extractDeploymentEventError, xn as withErrorHandling, xt as getDockerCmd, y as refusesFinalSnapshot, yt as buildDockerImage, z as disableInstanceApiTermination, zt as CFN_TEMPLATE_BODY_LIMIT } from "./deploy-engine-HAlYSktR.js";
2
+ import { $ as DagBuilder, A as red, At as resolveApp, B as isTerminationProtectionPropagationError, Bt as CFN_TEMPLATE_URL_LIMIT, C as isStatefulRecreateTargetSync, Ct as runDockerStreaming, D as cyan, Dt as synthesisStatusMessage, E as bold, Et as Synthesizer, F as ProviderRegistry, Ft as resolveStateBucketWithDefaultAndSource, G as normalizeAwsTagsToCfn, Gt as AssemblyReader, H as cfnRefValueFromPhysicalId, Ht as findLargeInlineResources, I as findActionableSilentDrops, It as resolveUseCdkBootstrapAssets, J as applyRoleArnIfSet, Jt as resolveBucketRegion, K as resolveExplicitPhysicalId, Kt as processStackMessages, L as CloudControlProvider, Lt as stateBucketExistenceConfirmed, M as IAMRoleProvider, Mt as resolveCaptureObservedState, N as collectInlinePolicyNamesManagedBySiblings, Nt as resolveSkipPrefix, O as gray, Ot as getDefaultStateBucketName, P as clearOnUpdateRemoval, Pt as resolveStateBucketWithDefault, Q as isRetryableTransientError, Qt as setAwsClients, R as slowCcOperationTimeoutMs, Rt as warnDeprecatedNoPrefixCliFlag, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, St as runDockerForeground, T as formatResourceLine, Tt as getDockerImageBySourceHash, U as refStateLookupFromResource, Ut as uploadCfnTemplate, V as IntrinsicFunctionResolver, Vt as MIGRATE_TMP_PREFIX, W as WAFv2WebACLProvider, Wt as expectedOwnerParam, X as describeTypeWithThrottleRetry, Xt as getAwsClients, Y as DiffCalculator, Yt as AwsClients, Z as withRetry, Zt as resetAwsClients, _ as createPreDeleteFinalSnapshot, _t as validateAssetBucketName, a as DeploymentEventsStore, an as LocalMigrateError, at as AssetPublisher, b as unsupportedFinalSnapshotError, bn as normalizeAwsError, bt as formatDockerLoginError, c as replayFailedOperations, cn as MissingCdkCliError, ct as buildAssetRedirectMap, d as IMPLICIT_DELETE_DEPENDENCIES, dn as ProvisioningError, dt as rewriteTemplateAssetReferences, en as CdkdError, et as TemplateParser, f as computeImplicitDeleteEdges, fn as ResourceTimeoutError, ft as AssetModeResolver, g as ccRoutedFinalSnapshotError, gt as parseBootstrapMarker, h as buildFinalSnapshotIdentifier, hn as StackTerminationProtectionError, ht as getBootstrapMarkerKey, i as DeploymentEventsReader, in as LocalInvokeBuildError$1, it as shouldRetainResource, j as yellow, jt as resolveAutoAssetStorage, k as green, kt as getLegacyStateBucketName, l as replayRollback, ln as NestedStackChildDirectDestroyError, lt as createAssetRedirectResolver, m as PRE_DELETE_SNAPSHOT_TYPES, mn as StackHasActiveImportsError, mt as ensureAssetStorage, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as S3StateBackend, o as planFailedOps, on as LocalStartServiceError, ot as stringifyValue, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as ResourceUpdateNotSupportedError, pt as BOOTSTRAP_MARKER_PREFIX, q as assertRegionMatch, r as DeployEngine, rn as DeployCancelledError, rt as rebuildClientForBucketRegion, s as planRollback, st as WorkGraph, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as LockManager, u as withResourceDeadline, un as PartialFailureError, ut as loadPublishableAssetManifest, v as isFinalSnapshotError, vt as validateContainerRepoName, w as renderStatefulReason, wt as AssetManifestLoader, x as extractDeploymentEventError, xn as withErrorHandling, xt as getDockerCmd, y as refusesFinalSnapshot, yt as buildDockerImage, z as disableInstanceApiTermination, zt as CFN_TEMPLATE_BODY_LIMIT } from "./deploy-engine-BFUaBWTW.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-De5hpQWP.js";
4
+ import { t as ASGProvider } from "./asg-provider-BlBwcSG-.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, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, 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";
@@ -38577,7 +38577,7 @@ var EMRInstanceGroupConfigProvider = class {
38577
38577
  ...jobFlowId && { ClusterId: jobFlowId },
38578
38578
  InstanceGroups: [{
38579
38579
  InstanceGroupId: physicalId,
38580
- InstanceCount: toNumber$1(properties["InstanceCount"])
38580
+ InstanceCount: toNumber$1(properties["InstanceCount"]) ?? 0
38581
38581
  }]
38582
38582
  }));
38583
38583
  if (jobFlowId) await this.waitForGroupReady(jobFlowId, physicalId, logicalId, resourceType, toNumber$1(properties["InstanceCount"]) ?? 0, true);
@@ -38837,7 +38837,10 @@ var EMRInstanceFleetConfigProvider = class {
38837
38837
  InstanceFleet: fleet
38838
38838
  }))).InstanceFleetId;
38839
38839
  if (!fleetId) throw new ProvisioningError(`EMR AddInstanceFleet for ${logicalId} returned no instance fleet id`, resourceType, logicalId);
38840
- await this.waitForFleetReady(clusterId, fleetId, logicalId, resourceType, this.targetCapacity(properties), true);
38840
+ await this.waitForFleetReady(clusterId, fleetId, logicalId, resourceType, this.targetCapacities(properties), {
38841
+ onDemand: 0,
38842
+ spot: 0
38843
+ });
38841
38844
  this.logger.debug(`Successfully added EMR instance fleet ${logicalId}: ${fleetId}`);
38842
38845
  return {
38843
38846
  physicalId: fleetId,
@@ -38888,8 +38891,8 @@ var EMRInstanceFleetConfigProvider = class {
38888
38891
  try {
38889
38892
  const modify = {
38890
38893
  InstanceFleetId: physicalId,
38891
- TargetOnDemandCapacity: toNumber(properties["TargetOnDemandCapacity"]),
38892
- TargetSpotCapacity: toNumber(properties["TargetSpotCapacity"]),
38894
+ TargetOnDemandCapacity: toNumber(properties["TargetOnDemandCapacity"]) ?? 0,
38895
+ TargetSpotCapacity: toNumber(properties["TargetSpotCapacity"]) ?? 0,
38893
38896
  ResizeSpecifications: properties["ResizeSpecifications"],
38894
38897
  InstanceTypeConfigs: toSdkInstanceTypeConfigs(properties["InstanceTypeConfigs"])
38895
38898
  };
@@ -38897,9 +38900,7 @@ var EMRInstanceFleetConfigProvider = class {
38897
38900
  ClusterId: clusterId,
38898
38901
  InstanceFleet: modify
38899
38902
  }));
38900
- const newTarget = this.targetCapacity(properties);
38901
- const prevTarget = this.targetCapacity(previousProperties);
38902
- await this.waitForFleetReady(clusterId, physicalId, logicalId, resourceType, newTarget, newTarget >= prevTarget, true);
38903
+ await this.waitForFleetReady(clusterId, physicalId, logicalId, resourceType, this.targetCapacities(properties), this.targetCapacities(previousProperties), true);
38903
38904
  this.logger.debug(`Successfully updated EMR instance fleet ${logicalId}`);
38904
38905
  return {
38905
38906
  physicalId,
@@ -38939,9 +38940,21 @@ var EMRInstanceFleetConfigProvider = class {
38939
38940
  async getAttribute(physicalId, _resourceType, attributeName) {
38940
38941
  if (attributeName === "Id") return physicalId;
38941
38942
  }
38942
- /** Total target capacity (On-Demand + Spot) requested for the fleet. */
38943
- targetCapacity(properties) {
38944
- return (toNumber(properties["TargetOnDemandCapacity"]) ?? 0) + (toNumber(properties["TargetSpotCapacity"]) ?? 0);
38943
+ /**
38944
+ * Per-dimension target capacities.
38945
+ *
38946
+ * Deliberately NOT summed into a single total: the settle check must compare
38947
+ * EACH dimension against its own provisioned counterpart. A template that
38948
+ * swaps 2 Spot units for 2 On-Demand units leaves the TOTAL unchanged, so a
38949
+ * summed comparison is satisfied by the stale pre-resize reading on the very
38950
+ * first poll and the deploy reports success while EMR is still swapping
38951
+ * instances.
38952
+ */
38953
+ targetCapacities(properties) {
38954
+ return {
38955
+ onDemand: toNumber(properties["TargetOnDemandCapacity"]) ?? 0,
38956
+ spot: toNumber(properties["TargetSpotCapacity"]) ?? 0
38957
+ };
38945
38958
  }
38946
38959
  /**
38947
38960
  * Poll until the fleet is `RUNNING` AND its provisioned capacity
@@ -38950,15 +38963,26 @@ var EMRInstanceFleetConfigProvider = class {
38950
38963
  * still in the PRE-resize `RUNNING` state, so a State-only wait would return
38951
38964
  * before the resize even starts.
38952
38965
  *
38953
- * `atLeast` selects the settle direction:
38954
- * - `true` (create / scale-UP): ready when `provisioned >= targetCapacity`
38955
- * (`>=`, not `==`, because a weighted-capacity allocation may overshoot).
38956
- * - `false` (scale-DOWN): ready when `provisioned <= targetCapacity` — the
38957
- * stale pre-resize provisioned capacity is ABOVE the new lower target, so
38958
- * an `>=` check would return instantly before instances drain.
38959
- *
38960
- * A `targetCapacity` of 0 on the up path (never valid for a real create —
38961
- * at least one target must be > 0) degrades to a State-only wait.
38966
+ * Both dimensions are compared SEPARATELY against their own provisioned
38967
+ * counterpart, with their own direction derived from `previous` -> `target`:
38968
+ * - scale-UP (`target >= previous`, and every create, whose `previous` is
38969
+ * `{0, 0}`): ready when `provisioned >= target` (`>=`, not `==`, because a
38970
+ * weighted-capacity allocation may overshoot).
38971
+ * - scale-DOWN: ready when `provisioned <= target` — the stale pre-resize
38972
+ * provisioned capacity is ABOVE the new lower target, so a `>=` check
38973
+ * would return instantly before instances drain.
38974
+ *
38975
+ * Summing the two dimensions instead would make the check vacuous whenever a
38976
+ * template swaps capacity between them at a constant total (`{Spot: 2}` ->
38977
+ * `{OnDemand: 2}`): the summed target equals the summed previous, so the
38978
+ * direction reads as UP and the stale pre-resize sum satisfies it on the very
38979
+ * first poll, reporting success while EMR is still swapping instances. That
38980
+ * shape only became reachable once `update()` started sending both members
38981
+ * (it previously died at `ModifyInstanceFleet`), so the per-dimension
38982
+ * comparison ships with it.
38983
+ *
38984
+ * A target of 0 on the up path (never valid for a real create — at least one
38985
+ * target must be > 0) is trivially satisfied, degrading to a State-only wait.
38962
38986
  *
38963
38987
  * `toleratesStaleFailedState` MUST be true on the resize path and false on
38964
38988
  * create. It exists for the RECOVERY case: `SUSPENDED` (a resize that could
@@ -38980,16 +39004,19 @@ var EMRInstanceFleetConfigProvider = class {
38980
39004
  * pre-resize `RUNNING` is harmless because the capacity check keeps the loop
38981
39005
  * polling. A stale `SUSPENDED` is terminal.
38982
39006
  */
38983
- async waitForFleetReady(clusterId, fleetId, logicalId, resourceType, targetCapacity, atLeast, toleratesStaleFailedState = false) {
39007
+ async waitForFleetReady(clusterId, fleetId, logicalId, resourceType, target, previous, toleratesStaleFailedState = false) {
38984
39008
  const startTime = Date.now();
38985
39009
  const transientState = { count: 0 };
38986
39010
  let initialState;
38987
39011
  let hasLeftInitialState = false;
39012
+ const settled = (provisioned, want, had) => want >= had ? provisioned >= want : provisioned <= want;
38988
39013
  while (Date.now() - startTime < this.maxWaitMs) {
38989
39014
  const fleet = await this.findFleetForPoll(clusterId, fleetId, transientState);
38990
39015
  const state = fleet?.Status?.State;
38991
- const provisioned = (fleet?.ProvisionedOnDemandCapacity ?? 0) + (fleet?.ProvisionedSpotCapacity ?? 0);
38992
- const capacityReady = atLeast ? provisioned >= targetCapacity : provisioned <= targetCapacity;
39016
+ const onDemand = fleet?.ProvisionedOnDemandCapacity ?? 0;
39017
+ const spot = fleet?.ProvisionedSpotCapacity ?? 0;
39018
+ const provisioned = onDemand + spot;
39019
+ const capacityReady = settled(onDemand, target.onDemand, previous.onDemand) && settled(spot, target.spot, previous.spot);
38993
39020
  if (state) {
38994
39021
  if (initialState === void 0) initialState = state;
38995
39022
  else if (state !== initialState) hasLeftInitialState = true;
@@ -38998,10 +39025,10 @@ var EMRInstanceFleetConfigProvider = class {
38998
39025
  const enforceFailedStates = !toleratesStaleFailedState || hasLeftInitialState;
38999
39026
  if (state && enforceFailedStates && FAILED_STATES.has(state)) throw new ProvisioningError(`EMR instance fleet ${fleetId} entered failed state ${state}: ${fleet?.Status?.StateChangeReason?.Message ?? "no state-change reason reported"}`, resourceType, logicalId, fleetId);
39000
39027
  if (state && !enforceFailedStates && FAILED_STATES.has(state)) this.logger.debug(`EMR instance fleet ${fleetId} still reads ${state} from before the resize; waiting for it to leave that state before treating it as failed`);
39001
- this.logger.debug(`EMR instance fleet ${fleetId} state: ${state ?? "unknown"}, provisioned ${provisioned}/${targetCapacity}, waiting...`);
39028
+ this.logger.debug(`EMR instance fleet ${fleetId} state: ${state ?? "unknown"}, provisioned ${onDemand}/${target.onDemand} on-demand + ${spot}/${target.spot} spot (${provisioned} total), waiting...`);
39002
39029
  await new Promise((resolve) => setTimeout(resolve, this.pollIntervalMs));
39003
39030
  }
39004
- throw new ProvisioningError(`Timed out waiting for EMR instance fleet ${fleetId} to reach RUNNING with capacity ${targetCapacity} (${Math.round(this.maxWaitMs / 6e4)} min)`, resourceType, logicalId, fleetId);
39031
+ throw new ProvisioningError(`Timed out waiting for EMR instance fleet ${fleetId} to reach RUNNING with capacity ${target.onDemand} on-demand / ${target.spot} spot (${Math.round(this.maxWaitMs / 6e4)} min)`, resourceType, logicalId, fleetId);
39005
39032
  }
39006
39033
  /**
39007
39034
  * `ListInstanceFleets` (paginated) for the cluster, returning the single
@@ -64569,7 +64596,7 @@ function createMigrateCommand() {
64569
64596
  */
64570
64597
  function buildProgram() {
64571
64598
  const program = new Command();
64572
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.278.8");
64599
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.278.10");
64573
64600
  program.hook("preAction", (_thisCommand, actionCommand) => {
64574
64601
  const { profile } = actionCommand.optsWithGlobals();
64575
64602
  if (profile !== void 0) process.env["AWS_PROFILE"] = profile;