@go-to-k/cdkd 0.260.3 → 0.260.4

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
@@ -1901,7 +1901,7 @@ const FLUSH_INTERVAL_MS = 2e3;
1901
1901
  const FLUSH_EVENT_THRESHOLD = 50;
1902
1902
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
1903
1903
  function getCdkdVersion() {
1904
- return "0.260.3";
1904
+ return "0.260.4";
1905
1905
  }
1906
1906
  /**
1907
1907
  * Generate a time-sortable unique run id, e.g.
@@ -21858,6 +21858,15 @@ function convertTags(tags) {
21858
21858
  }));
21859
21859
  }
21860
21860
  /**
21861
+ * `DeploymentConfiguration.LifecycleHooks[].HookDetails` is a free-form JSON
21862
+ * document (SDK `__DocumentType`) whose inner keys are user-supplied hook
21863
+ * payload fields, NOT CloudFormation property names. The recursive
21864
+ * PascalCase->camelCase key flip must therefore copy its value subtree
21865
+ * verbatim (the `HookDetails` key itself is still flipped to `hookDetails`).
21866
+ * See `convertDeploymentConfiguration`.
21867
+ */
21868
+ const DEPLOYMENT_CONFIG_PRESERVE_KEYS = /* @__PURE__ */ new Set(["HookDetails"]);
21869
+ /**
21861
21870
  * AWS ECS Provider
21862
21871
  *
21863
21872
  * Implements resource provisioning for ECS resources:
@@ -21969,8 +21978,8 @@ var ECSProvider = class {
21969
21978
  const cluster = (await client.send(new CreateClusterCommand({
21970
21979
  clusterName,
21971
21980
  capacityProviders: properties["CapacityProviders"],
21972
- defaultCapacityProviderStrategy: properties["DefaultCapacityProviderStrategy"],
21973
- configuration: properties["Configuration"],
21981
+ defaultCapacityProviderStrategy: this.convertCapacityProviderStrategy(properties["DefaultCapacityProviderStrategy"]),
21982
+ configuration: this.convertClusterConfiguration(properties["Configuration"]),
21974
21983
  settings: properties["ClusterSettings"] ? properties["ClusterSettings"].map((s) => ({
21975
21984
  name: s["Name"] || s["name"],
21976
21985
  value: (s["Value"] || s["value"]) ?? void 0
@@ -21997,7 +22006,7 @@ var ECSProvider = class {
21997
22006
  await client.send(new PutClusterCapacityProvidersCommand({
21998
22007
  cluster: physicalId,
21999
22008
  capacityProviders: properties["CapacityProviders"] || [],
22000
- defaultCapacityProviderStrategy: properties["DefaultCapacityProviderStrategy"] || []
22009
+ defaultCapacityProviderStrategy: this.convertCapacityProviderStrategy(properties["DefaultCapacityProviderStrategy"]) || []
22001
22010
  }));
22002
22011
  this.logger.debug(`Updated capacity providers for ECS cluster ${physicalId}`);
22003
22012
  }
@@ -22013,7 +22022,7 @@ var ECSProvider = class {
22013
22022
  await client.send(new UpdateClusterCommand({
22014
22023
  cluster: physicalId,
22015
22024
  ...settingsChanged && { settings: settingsInput },
22016
- ...configChanged && { configuration: properties["Configuration"] },
22025
+ ...configChanged && { configuration: this.convertClusterConfiguration(properties["Configuration"]) },
22017
22026
  ...svcConnectChanged && { serviceConnectDefaults: svcConnectInput }
22018
22027
  }));
22019
22028
  this.logger.debug(`Updated ECS cluster ${physicalId} (settings=${settingsChanged}, config=${configChanged}, svcConnect=${svcConnectChanged})`);
@@ -22068,13 +22077,13 @@ var ECSProvider = class {
22068
22077
  executionRoleArn: properties["ExecutionRoleArn"],
22069
22078
  taskRoleArn: properties["TaskRoleArn"],
22070
22079
  volumes: this.convertVolumes(properties["Volumes"]),
22071
- placementConstraints: properties["PlacementConstraints"],
22080
+ placementConstraints: this.convertTaskDefinitionPlacementConstraints(properties["PlacementConstraints"]),
22072
22081
  tags: convertTags(properties["Tags"]),
22073
- runtimePlatform: properties["RuntimePlatform"],
22074
- proxyConfiguration: properties["ProxyConfiguration"],
22082
+ runtimePlatform: this.convertRuntimePlatform(properties["RuntimePlatform"]),
22083
+ proxyConfiguration: this.convertProxyConfiguration(properties["ProxyConfiguration"]),
22075
22084
  pidMode: properties["PidMode"],
22076
22085
  ipcMode: properties["IpcMode"],
22077
- ephemeralStorage: properties["EphemeralStorage"],
22086
+ ephemeralStorage: this.convertEphemeralStorage(properties["EphemeralStorage"]),
22078
22087
  enableFaultInjection: properties["EnableFaultInjection"]
22079
22088
  }))).taskDefinition;
22080
22089
  if (!taskDef || !taskDef.taskDefinitionArn) throw new Error("RegisterTaskDefinition did not return task definition ARN");
@@ -22128,17 +22137,17 @@ var ECSProvider = class {
22128
22137
  launchType: properties["LaunchType"],
22129
22138
  networkConfiguration: this.convertNetworkConfiguration(properties["NetworkConfiguration"]),
22130
22139
  loadBalancers: this.convertLoadBalancers(properties["LoadBalancers"]),
22131
- capacityProviderStrategy: properties["CapacityProviderStrategy"],
22132
- deploymentConfiguration: properties["DeploymentConfiguration"],
22133
- placementConstraints: properties["PlacementConstraints"],
22134
- placementStrategy: properties["PlacementStrategies"] ?? properties["PlacementStrategy"],
22140
+ capacityProviderStrategy: this.convertCapacityProviderStrategy(properties["CapacityProviderStrategy"]),
22141
+ deploymentConfiguration: this.convertDeploymentConfiguration(properties["DeploymentConfiguration"]),
22142
+ placementConstraints: this.convertPlacementConstraints(properties["PlacementConstraints"]),
22143
+ placementStrategy: this.convertPlacementStrategies(properties["PlacementStrategies"] ?? properties["PlacementStrategy"]),
22135
22144
  platformVersion: properties["PlatformVersion"],
22136
22145
  healthCheckGracePeriodSeconds: properties["HealthCheckGracePeriodSeconds"],
22137
22146
  schedulingStrategy: properties["SchedulingStrategy"],
22138
22147
  enableECSManagedTags: properties["EnableECSManagedTags"],
22139
22148
  propagateTags: properties["PropagateTags"],
22140
22149
  enableExecuteCommand: properties["EnableExecuteCommand"],
22141
- serviceRegistries: properties["ServiceRegistries"],
22150
+ serviceRegistries: this.convertServiceRegistries(properties["ServiceRegistries"]),
22142
22151
  tags: convertTags(properties["Tags"])
22143
22152
  }))).service;
22144
22153
  if (!service || !service.serviceArn) throw new Error("CreateService did not return service ARN");
@@ -22167,10 +22176,10 @@ var ECSProvider = class {
22167
22176
  const serviceRegistriesChanged = JSON.stringify(previousProperties["ServiceRegistries"] ?? null) !== JSON.stringify(properties["ServiceRegistries"] ?? null);
22168
22177
  if (!isEcsController && (loadBalancersChanged || serviceRegistriesChanged)) throw new ProvisioningError(`AWS::ECS::Service '${logicalId}' changes LoadBalancers/ServiceRegistries under the '${deploymentControllerType}' deployment controller, which applies them via a new CodeDeploy deployment / task set rather than UpdateService. cdkd does not support updating these under a non-ECS controller; recreate the service or manage the blue/green deployment out-of-band.`, resourceType, logicalId, physicalId);
22169
22178
  const loadBalancersInput = isEcsController && loadBalancersChanged ? this.convertLoadBalancers(properties["LoadBalancers"]) ?? [] : void 0;
22170
- const serviceRegistriesInput = isEcsController && serviceRegistriesChanged ? properties["ServiceRegistries"] ?? [] : void 0;
22171
- const capacityProviderStrategyInput = this.clearOnUpdateRemoval(properties["CapacityProviderStrategy"], previousProperties["CapacityProviderStrategy"], []);
22172
- const placementConstraintsInput = this.clearOnUpdateRemoval(properties["PlacementConstraints"], previousProperties["PlacementConstraints"], []);
22173
- const placementStrategyInput = this.clearOnUpdateRemoval(properties["PlacementStrategies"] ?? properties["PlacementStrategy"], previousProperties["PlacementStrategies"] ?? previousProperties["PlacementStrategy"], []);
22179
+ const serviceRegistriesInput = isEcsController && serviceRegistriesChanged ? this.convertServiceRegistries(properties["ServiceRegistries"]) ?? [] : void 0;
22180
+ const capacityProviderStrategyInput = this.clearOnUpdateRemoval(this.convertCapacityProviderStrategy(properties["CapacityProviderStrategy"]), previousProperties["CapacityProviderStrategy"], []);
22181
+ const placementConstraintsInput = this.clearOnUpdateRemoval(this.convertPlacementConstraints(properties["PlacementConstraints"]), previousProperties["PlacementConstraints"], []);
22182
+ const placementStrategyInput = this.clearOnUpdateRemoval(this.convertPlacementStrategies(properties["PlacementStrategies"] ?? properties["PlacementStrategy"]), previousProperties["PlacementStrategies"] ?? previousProperties["PlacementStrategy"], []);
22174
22183
  const platformVersionInput = this.clearOnUpdateRemoval(properties["PlatformVersion"], previousProperties["PlatformVersion"], "LATEST");
22175
22184
  const healthCheckGracePeriodSecondsInput = this.clearOnUpdateRemoval(properties["HealthCheckGracePeriodSeconds"], previousProperties["HealthCheckGracePeriodSeconds"], 0);
22176
22185
  const enableECSManagedTagsInput = this.clearOnUpdateRemoval(properties["EnableECSManagedTags"], previousProperties["EnableECSManagedTags"], false);
@@ -22184,7 +22193,7 @@ var ECSProvider = class {
22184
22193
  desiredCount: properties["DesiredCount"],
22185
22194
  networkConfiguration: this.convertNetworkConfiguration(properties["NetworkConfiguration"]),
22186
22195
  capacityProviderStrategy: capacityProviderStrategyInput,
22187
- deploymentConfiguration: properties["DeploymentConfiguration"],
22196
+ deploymentConfiguration: this.convertDeploymentConfiguration(properties["DeploymentConfiguration"]),
22188
22197
  placementConstraints: placementConstraintsInput,
22189
22198
  placementStrategy: placementStrategyInput,
22190
22199
  platformVersion: platformVersionInput,
@@ -22335,7 +22344,7 @@ var ECSProvider = class {
22335
22344
  ulimits: this.convertUlimits(def["Ulimits"]),
22336
22345
  logConfiguration: this.convertLogConfiguration(def["LogConfiguration"]),
22337
22346
  healthCheck: this.convertHealthCheck(def["HealthCheck"]),
22338
- linuxParameters: def["LinuxParameters"],
22347
+ linuxParameters: this.convertLinuxParameters(def["LinuxParameters"]),
22339
22348
  dockerLabels: def["DockerLabels"],
22340
22349
  startTimeout: def["StartTimeout"],
22341
22350
  stopTimeout: def["StopTimeout"],
@@ -22454,7 +22463,7 @@ var ECSProvider = class {
22454
22463
  return {
22455
22464
  logDriver: config["LogDriver"],
22456
22465
  options: config["Options"],
22457
- secretOptions: config["SecretOptions"]
22466
+ secretOptions: this.convertSecrets(config["SecretOptions"])
22458
22467
  };
22459
22468
  }
22460
22469
  /**
@@ -22668,6 +22677,144 @@ var ECSProvider = class {
22668
22677
  loadBalancerName: lb["LoadBalancerName"]
22669
22678
  }));
22670
22679
  }
22680
+ /**
22681
+ * Convert the CFn PascalCase `DeploymentConfiguration` block to the ECS SDK
22682
+ * camelCase input shape (issue #1165). Every field is a pure first-letter
22683
+ * case flip (`MaximumPercent` -> `maximumPercent`, `DeploymentCircuitBreaker`
22684
+ * -> `deploymentCircuitBreaker` with `{Enable, Rollback}` -> `{enable,
22685
+ * rollback}`, `Alarms.AlarmNames` -> `alarms.alarmNames`, and the blue/green
22686
+ * `Strategy` / `BakeTimeInMinutes` / `LifecycleHooks` / `LinearConfiguration`
22687
+ * / `CanaryConfiguration` fields), so the shared recursive key-flip converter
22688
+ * handles the whole subtree — including fields CDK/CFn add later, which avoids
22689
+ * re-introducing the silent-drop this fix closes. The one exception is
22690
+ * `LifecycleHooks[].HookDetails`, a free-form document copied verbatim (see
22691
+ * `DEPLOYMENT_CONFIG_PRESERVE_KEYS`).
22692
+ *
22693
+ * Before this fix the block was passed RAW into the SDK's camelCase
22694
+ * `deploymentConfiguration` field, so the SDK read `.maximumPercent` (absent)
22695
+ * and serialized nothing — a custom `minHealthyPercent` / `maxHealthyPercent`
22696
+ * / circuit breaker / deployment alarms deployed as the AWS defaults, silently
22697
+ * (state recorded the intended value, `cdkd diff` showed "No changes").
22698
+ */
22699
+ convertDeploymentConfiguration(config) {
22700
+ if (!config) return void 0;
22701
+ return pascalToCamelCaseKeys(config, DEPLOYMENT_CONFIG_PRESERVE_KEYS);
22702
+ }
22703
+ /**
22704
+ * Convert the CFn PascalCase `CapacityProviderStrategy` array to the ECS SDK
22705
+ * camelCase input shape (issue #1165). Each element `{CapacityProvider,
22706
+ * Weight, Base}` is a pure first-letter case flip to `{capacityProvider,
22707
+ * weight, base}`.
22708
+ */
22709
+ convertCapacityProviderStrategy(items) {
22710
+ if (!items) return void 0;
22711
+ return pascalToCamelCaseKeys(items);
22712
+ }
22713
+ /**
22714
+ * Convert the CFn PascalCase `PlacementConstraints` array to the ECS SDK
22715
+ * camelCase input shape (issue #1165). Each element `{Type, Expression}` ->
22716
+ * `{type, expression}`.
22717
+ */
22718
+ convertPlacementConstraints(items) {
22719
+ if (!items) return void 0;
22720
+ return pascalToCamelCaseKeys(items);
22721
+ }
22722
+ /**
22723
+ * Convert the CFn PascalCase `PlacementStrategies` array to the ECS SDK
22724
+ * camelCase input shape (issue #1165). Each element `{Type, Field}` ->
22725
+ * `{type, field}`.
22726
+ */
22727
+ convertPlacementStrategies(items) {
22728
+ if (!items) return void 0;
22729
+ return pascalToCamelCaseKeys(items);
22730
+ }
22731
+ /**
22732
+ * Convert the CFn PascalCase `ServiceRegistries` array to the ECS SDK
22733
+ * camelCase input shape (issue #1165). Each element `{RegistryArn, Port,
22734
+ * ContainerName, ContainerPort}` -> `{registryArn, port, containerName,
22735
+ * containerPort}`.
22736
+ */
22737
+ convertServiceRegistries(items) {
22738
+ if (!items) return void 0;
22739
+ return pascalToCamelCaseKeys(items);
22740
+ }
22741
+ /**
22742
+ * Convert the CFn PascalCase `TaskDefinition.RuntimePlatform` to the ECS SDK
22743
+ * camelCase input shape (issue #1165). `{CpuArchitecture,
22744
+ * OperatingSystemFamily}` -> `{cpuArchitecture, operatingSystemFamily}`.
22745
+ *
22746
+ * High-impact: before the fix a `RuntimePlatform: { CpuArchitecture: ARM64 }`
22747
+ * (Graviton Fargate) was passed raw into the SDK's camelCase slot and
22748
+ * silently dropped, so the task definition registered as the default X86_64.
22749
+ */
22750
+ convertRuntimePlatform(config) {
22751
+ if (!config) return void 0;
22752
+ return pascalToCamelCaseKeys(config);
22753
+ }
22754
+ /**
22755
+ * Convert the CFn PascalCase `TaskDefinition.EphemeralStorage` to the ECS SDK
22756
+ * camelCase input shape (issue #1165). `{SizeInGiB}` -> `{sizeInGiB}` — the
22757
+ * value under the wrong-cased key was silently dropped before the fix, so a
22758
+ * custom ephemeral storage size reverted to the AWS default.
22759
+ */
22760
+ convertEphemeralStorage(config) {
22761
+ if (!config) return void 0;
22762
+ return pascalToCamelCaseKeys(config);
22763
+ }
22764
+ /**
22765
+ * Convert the CFn PascalCase `Cluster.Configuration` to the ECS SDK camelCase
22766
+ * input shape (issue #1165). Every key is a pure first-letter flip
22767
+ * (`ExecuteCommandConfiguration` / `ManagedStorageConfiguration` and their
22768
+ * nested `KmsKeyId` / `LogConfiguration` / `CloudWatchLogGroupName` /
22769
+ * `S3BucketName` fields), so the shared recursive converter handles the whole
22770
+ * subtree.
22771
+ */
22772
+ convertClusterConfiguration(config) {
22773
+ if (!config) return void 0;
22774
+ return pascalToCamelCaseKeys(config);
22775
+ }
22776
+ /**
22777
+ * Convert the CFn PascalCase `TaskDefinition.ProxyConfiguration` to the ECS
22778
+ * SDK camelCase input shape (issue #1165). Unlike the other nested fields,
22779
+ * this is NOT a pure first-letter flip: the CFn key
22780
+ * `ProxyConfigurationProperties` maps to the SDK's `properties` field (a
22781
+ * `KeyValuePair[]`), so it needs an explicit remap rather than the recursive
22782
+ * converter.
22783
+ */
22784
+ convertProxyConfiguration(config) {
22785
+ if (!config) return void 0;
22786
+ return {
22787
+ type: config["Type"],
22788
+ containerName: config["ContainerName"],
22789
+ properties: this.convertEnvironment(config["ProxyConfigurationProperties"])
22790
+ };
22791
+ }
22792
+ /**
22793
+ * Convert the CFn PascalCase `TaskDefinition.PlacementConstraints` array to
22794
+ * the ECS SDK camelCase input shape (issue #1165). Each element `{Type,
22795
+ * Expression}` -> `{type, expression}`. Distinct from the Service's
22796
+ * `PlacementConstraints` only in the SDK element type
22797
+ * (`TaskDefinitionPlacementConstraint` vs `PlacementConstraint`); both are a
22798
+ * pure first-letter flip.
22799
+ */
22800
+ convertTaskDefinitionPlacementConstraints(items) {
22801
+ if (!items) return void 0;
22802
+ return pascalToCamelCaseKeys(items);
22803
+ }
22804
+ /**
22805
+ * Convert the CFn PascalCase `ContainerDefinitions[].LinuxParameters` to the
22806
+ * ECS SDK camelCase input shape (issue #1165). Every key is a pure
22807
+ * first-letter flip (`Capabilities.{Add,Drop}`, `Devices[].{HostPath,
22808
+ * ContainerPath,Permissions}`, `Tmpfs[].{ContainerPath,Size,MountOptions}`,
22809
+ * `InitProcessEnabled` / `SharedMemorySize` / `MaxSwap` / `Swappiness`), so
22810
+ * the shared recursive converter handles the whole subtree. Before this fix
22811
+ * the block was passed raw, so a `LinuxParameters.Capabilities` /
22812
+ * `Devices` / `InitProcessEnabled` was silently dropped on register.
22813
+ */
22814
+ convertLinuxParameters(config) {
22815
+ if (!config) return void 0;
22816
+ return pascalToCamelCaseKeys(config);
22817
+ }
22671
22818
  convertNetworkConfiguration(config) {
22672
22819
  if (!config) return void 0;
22673
22820
  const awsvpcConfig = config["AwsvpcConfiguration"];
@@ -61505,7 +61652,7 @@ function createMigrateCommand() {
61505
61652
  */
61506
61653
  function buildProgram() {
61507
61654
  const program = new Command();
61508
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.260.3");
61655
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.260.4");
61509
61656
  program.addCommand(createBootstrapCommand());
61510
61657
  program.addCommand(createSynthCommand());
61511
61658
  program.addCommand(createListCommand());