@go-to-k/cdkd 0.109.1 → 0.110.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
@@ -30,7 +30,7 @@ import { CreateAliasCommand, CreateKeyCommand, DeleteAliasCommand, DescribeKeyCo
30
30
  import { promisify } from "node:util";
31
31
  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";
32
32
  import graphlib from "graphlib";
33
- import { AddTagsToResourceCommand as AddTagsToResourceCommand$1, CreateDBClusterCommand, CreateDBInstanceCommand, CreateDBProxyCommand, CreateDBProxyEndpointCommand, CreateDBSubnetGroupCommand, DBProxyEndpointNotFoundFault, DBProxyNotFoundFault, DBProxyTargetGroupNotFoundFault, DBProxyTargetNotFoundFault, DeleteDBClusterCommand, DeleteDBInstanceCommand, DeleteDBProxyCommand, DeleteDBProxyEndpointCommand, DeleteDBSubnetGroupCommand, DeregisterDBProxyTargetsCommand, DescribeDBClustersCommand, DescribeDBInstancesCommand, DescribeDBProxiesCommand, DescribeDBProxyEndpointsCommand, DescribeDBProxyTargetGroupsCommand, DescribeDBSubnetGroupsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$8, ModifyDBClusterCommand, ModifyDBInstanceCommand, ModifyDBProxyCommand, ModifyDBProxyEndpointCommand, ModifyDBProxyTargetGroupCommand, ModifyDBSubnetGroupCommand, RDSClient, RegisterDBProxyTargetsCommand, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$1 } from "@aws-sdk/client-rds";
33
+ import { AddTagsToResourceCommand as AddTagsToResourceCommand$1, CreateDBClusterCommand, CreateDBInstanceCommand, CreateDBProxyCommand, CreateDBProxyEndpointCommand, CreateDBSubnetGroupCommand, DBProxyEndpointNotFoundFault, DBProxyNotFoundFault, DBProxyTargetGroupNotFoundFault, DBProxyTargetNotFoundFault, DeleteDBClusterCommand, DeleteDBInstanceCommand, DeleteDBProxyCommand, DeleteDBProxyEndpointCommand, DeleteDBSubnetGroupCommand, DeregisterDBProxyTargetsCommand, DescribeDBClustersCommand, DescribeDBInstancesCommand, DescribeDBProxiesCommand, DescribeDBProxyEndpointsCommand, DescribeDBProxyTargetGroupsCommand, DescribeDBProxyTargetsCommand, DescribeDBSubnetGroupsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$8, ModifyDBClusterCommand, ModifyDBInstanceCommand, ModifyDBProxyCommand, ModifyDBProxyEndpointCommand, ModifyDBProxyTargetGroupCommand, ModifyDBSubnetGroupCommand, RDSClient, RegisterDBProxyTargetsCommand, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$1 } from "@aws-sdk/client-rds";
34
34
  import { Command, Option } from "commander";
35
35
  import { writeFileSync as writeFileSync$1 } from "fs";
36
36
  import { join as join$1 } from "path";
@@ -19472,6 +19472,66 @@ var RDSDBProxyTargetGroupProvider = class {
19472
19472
  };
19473
19473
  return null;
19474
19474
  }
19475
+ /**
19476
+ * Read the AWS-current configuration as CFn property shape. Used by
19477
+ * `cdkd drift` for the SDK-provider path (without it the comparator
19478
+ * falls back to CC API, which is broken on this type — Issue #385 the
19479
+ * SDK provider was added to fix in the first place).
19480
+ *
19481
+ * Maps:
19482
+ * - `DescribeDBProxyTargetGroups` → `ConnectionPoolConfigurationInfo`
19483
+ * (the connection pool config CFn template carries).
19484
+ * - `DescribeDBProxyTargets` → `DBClusterIdentifiers` /
19485
+ * `DBInstanceIdentifiers` reverse-mapped from the AWS-side target
19486
+ * list via `Type` discriminator. The full target list also carries
19487
+ * per-target Endpoint / Port / TargetHealth but those are read-only
19488
+ * AWS-managed fields, intentionally not surfaced.
19489
+ *
19490
+ * Best-effort: a missing parent DBProxyName (state corruption) or any
19491
+ * AWS API failure surfaces as `undefined` (drift comparator skips the
19492
+ * resource), not a crash.
19493
+ */
19494
+ async readCurrentState(_physicalId, _logicalId, _resourceType, properties) {
19495
+ const dbProxyName = properties["DBProxyName"];
19496
+ const targetGroupName = properties["TargetGroupName"] ?? "default";
19497
+ if (!dbProxyName) return;
19498
+ const client = this.getClient();
19499
+ let connectionPoolConfig;
19500
+ try {
19501
+ connectionPoolConfig = ((await client.send(new DescribeDBProxyTargetGroupsCommand({
19502
+ DBProxyName: dbProxyName,
19503
+ TargetGroupName: targetGroupName
19504
+ }))).TargetGroups?.[0])?.ConnectionPoolConfig;
19505
+ } catch (error) {
19506
+ if (error instanceof DBProxyNotFoundFault || error instanceof DBProxyTargetGroupNotFoundFault) return;
19507
+ throw error;
19508
+ }
19509
+ const dbClusterIdentifiers = [];
19510
+ const dbInstanceIdentifiers = [];
19511
+ try {
19512
+ const targetsResp = await client.send(new DescribeDBProxyTargetsCommand({
19513
+ DBProxyName: dbProxyName,
19514
+ TargetGroupName: targetGroupName
19515
+ }));
19516
+ for (const target of targetsResp.Targets ?? []) {
19517
+ const id = target.RdsResourceId;
19518
+ if (!id) continue;
19519
+ if (target.Type === "TRACKED_CLUSTER") dbClusterIdentifiers.push(id);
19520
+ else if (target.Type === "RDS_INSTANCE") dbInstanceIdentifiers.push(id);
19521
+ }
19522
+ } catch (error) {
19523
+ if (error instanceof DBProxyNotFoundFault || error instanceof DBProxyTargetGroupNotFoundFault || error instanceof DBProxyTargetNotFoundFault) return;
19524
+ throw error;
19525
+ }
19526
+ const result = {
19527
+ DBProxyName: dbProxyName,
19528
+ TargetGroupName: targetGroupName,
19529
+ DBClusterIdentifiers: dbClusterIdentifiers,
19530
+ DBInstanceIdentifiers: dbInstanceIdentifiers
19531
+ };
19532
+ if (connectionPoolConfig !== void 0) result["ConnectionPoolConfigurationInfo"] = connectionPoolConfig;
19533
+ return result;
19534
+ }
19475
19535
  wrapError(error, op, resourceType, logicalId, physicalId) {
19476
19536
  const message = error instanceof Error ? error.message : String(error);
19477
19537
  const cause = error instanceof Error ? error : void 0;
@@ -45186,7 +45246,7 @@ function reorderArgs(argv) {
45186
45246
  */
45187
45247
  async function main() {
45188
45248
  const program = new Command();
45189
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.109.1");
45249
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.110.0");
45190
45250
  program.addCommand(createBootstrapCommand());
45191
45251
  program.addCommand(createSynthCommand());
45192
45252
  program.addCommand(createListCommand());