@go-to-k/cdkd 0.103.0 → 0.103.2

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 { a as setAwsClients, i as resetAwsClients, r as getAwsClients, t as AwsClients } from "./aws-clients-CuHRHcyW.js";
3
- import { A as resolveApp, B as CdkdError, C as AssetPublisher, D as Synthesizer, E as buildDockerImage, F as warnDeprecatedNoPrefixCliFlag, G as PartialFailureError, I as AssemblyReader, J as ResourceUpdateNotSupportedError, K as ProvisioningError, M as resolveSkipPrefix, N as resolveStateBucketWithDefault, O as getDefaultStateBucketName, P as resolveStateBucketWithDefaultAndSource, R as resolveBucketRegion, S as shouldRetainResource, T as WorkGraph, U as LocalInvokeBuildError, X as StackHasActiveImportsError, Y as RouteDiscoveryError, Z as StackTerminationProtectionError, _ as DiffCalculator, a as withRetry, at as getLogger, b as LockManager, c as collectInlinePolicyNamesManagedBySiblings, ct as getLiveRenderer, d as normalizeAwsTagsToCfn, dt as generateResourceName, f as resolveExplicitPhysicalId, ft as generateResourceNameWithFallback, g as IntrinsicFunctionResolver, h as assertRegionMatch, i as withResourceDeadline, j as resolveCaptureObservedState, k as getLegacyStateBucketName, l as CDK_PATH_TAG, lt as PATTERN_B_NAME_PROPERTIES, m as CloudControlProvider, mt as withStackName, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as normalizeAwsError, o as IMPLICIT_DELETE_DEPENDENCIES, p as ProviderRegistry, pt as withSkipPrefix, q as ResourceTimeoutError, r as DeployEngine, rt as withErrorHandling, s as IAMRoleProvider, st as runStackBuffered, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as matchesCdkPath, ut as PATTERN_B_RESOURCE_TYPES, v as DagBuilder, w as stringifyValue, x as S3StateBackend, y as TemplateParser } from "./deploy-engine-DGKtcKF6.js";
3
+ import { A as resolveApp, B as CdkdError, C as AssetPublisher, D as Synthesizer, E as buildDockerImage, F as warnDeprecatedNoPrefixCliFlag, G as PartialFailureError, I as AssemblyReader, J as ResourceUpdateNotSupportedError, K as ProvisioningError, M as resolveSkipPrefix, N as resolveStateBucketWithDefault, O as getDefaultStateBucketName, P as resolveStateBucketWithDefaultAndSource, R as resolveBucketRegion, S as shouldRetainResource, T as WorkGraph, U as LocalInvokeBuildError, X as StackHasActiveImportsError, Y as RouteDiscoveryError, Z as StackTerminationProtectionError, _ as DiffCalculator, a as withRetry, at as getLogger, b as LockManager, c as collectInlinePolicyNamesManagedBySiblings, ct as getLiveRenderer, d as normalizeAwsTagsToCfn, dt as generateResourceName, f as resolveExplicitPhysicalId, ft as generateResourceNameWithFallback, g as IntrinsicFunctionResolver, h as assertRegionMatch, i as withResourceDeadline, j as resolveCaptureObservedState, k as getLegacyStateBucketName, l as CDK_PATH_TAG, lt as PATTERN_B_NAME_PROPERTIES, m as CloudControlProvider, mt as withStackName, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as normalizeAwsError, o as IMPLICIT_DELETE_DEPENDENCIES, p as ProviderRegistry, pt as withSkipPrefix, q as ResourceTimeoutError, r as DeployEngine, rt as withErrorHandling, s as IAMRoleProvider, st as runStackBuffered, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as matchesCdkPath, ut as PATTERN_B_RESOURCE_TYPES, v as DagBuilder, w as stringifyValue, x as S3StateBackend, y as TemplateParser } from "./deploy-engine-D6nbHjNM.js";
4
4
  import { createHash, createPublicKey, createVerify, randomBytes, randomUUID } from "node:crypto";
5
5
  import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListBucketsCommand, ListDirectoryBucketsCommand, 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";
6
6
  import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachUserPolicyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachUserPolicyCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetRolePolicyCommand, GetUserCommand, GetUserPolicyCommand, IAMClient, ListAccessKeysCommand, ListAttachedGroupPoliciesCommand, ListAttachedUserPoliciesCommand, ListGroupPoliciesCommand, ListGroupsForUserCommand, ListInstanceProfilesCommand, ListUserPoliciesCommand, ListUserTagsCommand, ListUsersCommand, NoSuchEntityException, PutGroupPolicyCommand, PutRolePolicyCommand, PutUserPermissionsBoundaryCommand, PutUserPolicyCommand, RemoveRoleFromInstanceProfileCommand, RemoveUserFromGroupCommand, TagUserCommand, UntagUserCommand, UpdateLoginProfileCommand } from "@aws-sdk/client-iam";
@@ -30,14 +30,14 @@ 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, CreateDBSubnetGroupCommand, DBProxyNotFoundFault, DBProxyTargetGroupNotFoundFault, DBProxyTargetNotFoundFault, DeleteDBClusterCommand, DeleteDBInstanceCommand, DeleteDBSubnetGroupCommand, DeregisterDBProxyTargetsCommand, DescribeDBClustersCommand, DescribeDBInstancesCommand, DescribeDBProxyTargetGroupsCommand, DescribeDBSubnetGroupsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$8, ModifyDBClusterCommand, ModifyDBInstanceCommand, ModifyDBProxyTargetGroupCommand, ModifyDBSubnetGroupCommand, RDSClient, RegisterDBProxyTargetsCommand, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$1 } from "@aws-sdk/client-rds";
33
34
  import { Command, Option } from "commander";
34
35
  import { writeFileSync as writeFileSync$1 } from "fs";
35
36
  import { join as join$1 } from "path";
36
37
  import * as zlib from "node:zlib";
37
38
  import { ApiGatewayV2Client, CreateApiCommand, CreateAuthorizerCommand as CreateAuthorizerCommand$1, CreateIntegrationCommand, CreateRouteCommand as CreateRouteCommand$1, CreateStageCommand as CreateStageCommand$1, DeleteApiCommand, DeleteAuthorizerCommand as DeleteAuthorizerCommand$1, DeleteIntegrationCommand, DeleteRouteCommand as DeleteRouteCommand$1, DeleteStageCommand as DeleteStageCommand$1, GetApiCommand, GetApisCommand, GetAuthorizerCommand as GetAuthorizerCommand$1, GetIntegrationCommand, GetRouteCommand, GetStageCommand as GetStageCommand$1, NotFoundException as NotFoundException$3, UpdateApiCommand, UpdateAuthorizerCommand as UpdateAuthorizerCommand$1, UpdateIntegrationCommand, UpdateRouteCommand, UpdateStageCommand as UpdateStageCommand$1 } from "@aws-sdk/client-apigatewayv2";
38
- import { CreateStateMachineCommand, DeleteStateMachineCommand, DescribeStateMachineCommand, ListStateMachinesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$8, SFNClient, StateMachineDoesNotExist, TagResourceCommand as TagResourceCommand$10, UntagResourceCommand as UntagResourceCommand$9, UpdateStateMachineCommand } from "@aws-sdk/client-sfn";
39
- import { CreateClusterCommand, CreateServiceCommand, DeleteClusterCommand, DeleteServiceCommand, DeregisterTaskDefinitionCommand, DescribeClustersCommand, DescribeServicesCommand, DescribeTaskDefinitionCommand, ECSClient, ListClustersCommand, ListServicesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$9, PutClusterCapacityProvidersCommand, RegisterTaskDefinitionCommand, TagResourceCommand as TagResourceCommand$11, UntagResourceCommand as UntagResourceCommand$10, UpdateClusterCommand, UpdateServiceCommand } from "@aws-sdk/client-ecs";
40
- import { AddTagsToResourceCommand as AddTagsToResourceCommand$1, CreateDBClusterCommand, CreateDBInstanceCommand, CreateDBSubnetGroupCommand, DeleteDBClusterCommand, DeleteDBInstanceCommand, DeleteDBSubnetGroupCommand, DescribeDBClustersCommand, DescribeDBInstancesCommand, DescribeDBSubnetGroupsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$10, ModifyDBClusterCommand, ModifyDBInstanceCommand, ModifyDBSubnetGroupCommand, RDSClient, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$1 } from "@aws-sdk/client-rds";
39
+ import { CreateStateMachineCommand, DeleteStateMachineCommand, DescribeStateMachineCommand, ListStateMachinesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$9, SFNClient, StateMachineDoesNotExist, TagResourceCommand as TagResourceCommand$10, UntagResourceCommand as UntagResourceCommand$9, UpdateStateMachineCommand } from "@aws-sdk/client-sfn";
40
+ import { CreateClusterCommand, CreateServiceCommand, DeleteClusterCommand, DeleteServiceCommand, DeregisterTaskDefinitionCommand, DescribeClustersCommand, DescribeServicesCommand, DescribeTaskDefinitionCommand, ECSClient, ListClustersCommand, ListServicesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$10, PutClusterCapacityProvidersCommand, RegisterTaskDefinitionCommand, TagResourceCommand as TagResourceCommand$11, UntagResourceCommand as UntagResourceCommand$10, UpdateClusterCommand, UpdateServiceCommand } from "@aws-sdk/client-ecs";
41
41
  import { AddTagsToResourceCommand as AddTagsToResourceCommand$2, CreateDBClusterCommand as CreateDBClusterCommand$1, CreateDBInstanceCommand as CreateDBInstanceCommand$1, CreateDBSubnetGroupCommand as CreateDBSubnetGroupCommand$1, DeleteDBClusterCommand as DeleteDBClusterCommand$1, DeleteDBInstanceCommand as DeleteDBInstanceCommand$1, DeleteDBSubnetGroupCommand as DeleteDBSubnetGroupCommand$1, DescribeDBClustersCommand as DescribeDBClustersCommand$1, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DescribeDBSubnetGroupsCommand as DescribeDBSubnetGroupsCommand$1, DocDBClient, ListTagsForResourceCommand as ListTagsForResourceCommand$11, ModifyDBClusterCommand as ModifyDBClusterCommand$1, ModifyDBInstanceCommand as ModifyDBInstanceCommand$1, ModifyDBSubnetGroupCommand as ModifyDBSubnetGroupCommand$1, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$2 } from "@aws-sdk/client-docdb";
42
42
  import { AddTagsToResourceCommand as AddTagsToResourceCommand$3, CreateDBClusterCommand as CreateDBClusterCommand$2, CreateDBInstanceCommand as CreateDBInstanceCommand$2, CreateDBSubnetGroupCommand as CreateDBSubnetGroupCommand$2, DeleteDBClusterCommand as DeleteDBClusterCommand$2, DeleteDBInstanceCommand as DeleteDBInstanceCommand$2, DeleteDBSubnetGroupCommand as DeleteDBSubnetGroupCommand$2, DescribeDBClustersCommand as DescribeDBClustersCommand$2, DescribeDBInstancesCommand as DescribeDBInstancesCommand$2, DescribeDBSubnetGroupsCommand as DescribeDBSubnetGroupsCommand$2, ListTagsForResourceCommand as ListTagsForResourceCommand$12, ModifyDBClusterCommand as ModifyDBClusterCommand$2, ModifyDBInstanceCommand as ModifyDBInstanceCommand$2, ModifyDBSubnetGroupCommand as ModifyDBSubnetGroupCommand$2, NeptuneClient, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$3 } from "@aws-sdk/client-neptune";
43
43
  import { CreateWebACLCommand, DeleteWebACLCommand, GetWebACLCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$13, ListWebACLsCommand, TagResourceCommand as TagResourceCommand$12, UntagResourceCommand as UntagResourceCommand$11, UpdateWebACLCommand, WAFNonexistentItemException, WAFV2Client } from "@aws-sdk/client-wafv2";
@@ -15330,7 +15330,7 @@ var StepFunctionsProvider = class {
15330
15330
  result["EncryptionConfiguration"] = ec;
15331
15331
  }
15332
15332
  try {
15333
- result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$8({ resourceArn: physicalId }))).tags);
15333
+ result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$9({ resourceArn: physicalId }))).tags);
15334
15334
  } catch (err) {
15335
15335
  if (!(err instanceof StateMachineDoesNotExist)) throw err;
15336
15336
  }
@@ -15368,7 +15368,7 @@ var StepFunctionsProvider = class {
15368
15368
  const list = await this.getClient().send(new ListStateMachinesCommand({ ...nextToken && { nextToken } }));
15369
15369
  for (const sm of list.stateMachines ?? []) {
15370
15370
  if (!sm.stateMachineArn) continue;
15371
- const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$8({ resourceArn: sm.stateMachineArn }));
15371
+ const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$9({ resourceArn: sm.stateMachineArn }));
15372
15372
  if (this.tagsMatchCdkPath(tagsResp.tags, input.cdkPath)) return {
15373
15373
  physicalId: sm.stateMachineArn,
15374
15374
  attributes: {}
@@ -16304,7 +16304,7 @@ var ECSProvider = class {
16304
16304
  do {
16305
16305
  const list = await this.getClient().send(new ListClustersCommand({ ...nextToken && { nextToken } }));
16306
16306
  for (const arn of list.clusterArns ?? []) {
16307
- const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$9({ resourceArn: arn }));
16307
+ const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$10({ resourceArn: arn }));
16308
16308
  if (this.tagsMatchCdkPath(tagsResp.tags, input.cdkPath)) return {
16309
16309
  physicalId: arn.substring(arn.lastIndexOf("/") + 1),
16310
16310
  attributes: {}
@@ -16331,7 +16331,7 @@ var ECSProvider = class {
16331
16331
  ...svcToken && { nextToken: svcToken }
16332
16332
  }));
16333
16333
  for (const svcArn of svcList.serviceArns ?? []) {
16334
- const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$9({ resourceArn: svcArn }));
16334
+ const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$10({ resourceArn: svcArn }));
16335
16335
  if (this.tagsMatchCdkPath(tagsResp.tags, input.cdkPath)) return {
16336
16336
  physicalId: `${clusterArn}|${svcArn.substring(svcArn.lastIndexOf("/") + 1)}`,
16337
16337
  attributes: {}
@@ -17660,7 +17660,7 @@ var RDSProvider = class {
17660
17660
  */
17661
17661
  async attachTags(result, arn) {
17662
17662
  try {
17663
- result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$10({ ResourceName: arn }))).TagList);
17663
+ result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$8({ ResourceName: arn }))).TagList);
17664
17664
  } catch (err) {
17665
17665
  this.logger.debug(`RDS ListTagsForResource(${arn}) failed: ${err instanceof Error ? err.message : String(err)}`);
17666
17666
  }
@@ -17683,7 +17683,7 @@ var RDSProvider = class {
17683
17683
  const list = await this.getClient().send(new DescribeDBInstancesCommand({ ...marker && { Marker: marker } }));
17684
17684
  for (const inst of list.DBInstances ?? []) {
17685
17685
  if (!inst.DBInstanceIdentifier || !inst.DBInstanceArn) continue;
17686
- if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$10({ ResourceName: inst.DBInstanceArn }))).TagList, input.cdkPath)) return {
17686
+ if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$8({ ResourceName: inst.DBInstanceArn }))).TagList, input.cdkPath)) return {
17687
17687
  physicalId: inst.DBInstanceIdentifier,
17688
17688
  attributes: {}
17689
17689
  };
@@ -17710,7 +17710,7 @@ var RDSProvider = class {
17710
17710
  const list = await this.getClient().send(new DescribeDBClustersCommand({ ...marker && { Marker: marker } }));
17711
17711
  for (const c of list.DBClusters ?? []) {
17712
17712
  if (!c.DBClusterIdentifier || !c.DBClusterArn) continue;
17713
- if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$10({ ResourceName: c.DBClusterArn }))).TagList, input.cdkPath)) return {
17713
+ if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$8({ ResourceName: c.DBClusterArn }))).TagList, input.cdkPath)) return {
17714
17714
  physicalId: c.DBClusterIdentifier,
17715
17715
  attributes: {}
17716
17716
  };
@@ -17737,7 +17737,7 @@ var RDSProvider = class {
17737
17737
  const list = await this.getClient().send(new DescribeDBSubnetGroupsCommand({ ...marker && { Marker: marker } }));
17738
17738
  for (const sg of list.DBSubnetGroups ?? []) {
17739
17739
  if (!sg.DBSubnetGroupName || !sg.DBSubnetGroupArn) continue;
17740
- if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$10({ ResourceName: sg.DBSubnetGroupArn }))).TagList, input.cdkPath)) return {
17740
+ if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$8({ ResourceName: sg.DBSubnetGroupArn }))).TagList, input.cdkPath)) return {
17741
17741
  physicalId: sg.DBSubnetGroupName,
17742
17742
  attributes: {}
17743
17743
  };
@@ -17748,6 +17748,178 @@ var RDSProvider = class {
17748
17748
  }
17749
17749
  };
17750
17750
 
17751
+ //#endregion
17752
+ //#region src/provisioning/providers/rds-dbproxy-targetgroup-provider.ts
17753
+ /**
17754
+ * AWS RDS DBProxyTargetGroup Provider
17755
+ *
17756
+ * Implements resource provisioning for `AWS::RDS::DBProxyTargetGroup`.
17757
+ *
17758
+ * **Why a dedicated SDK provider** (per `feedback_dedicated_provider_over_special_case.md`):
17759
+ * pre-PR this type went through Cloud Control API, but CC API's resource
17760
+ * handler for `AWS::RDS::DBProxyTargetGroup` fails the delete path with
17761
+ * `Value null at 'dBProxyName' failed to satisfy constraint`. The handler
17762
+ * cannot derive `DBProxyName` from the TargetGroup ARN (the primary
17763
+ * identifier), so the underlying RDS API call goes out with
17764
+ * `DBProxyName: null` and AWS rejects it (Issue #385).
17765
+ *
17766
+ * **What this resource actually does on AWS**: a CFn
17767
+ * `AWS::RDS::DBProxyTargetGroup` is a wiring resource — every DBProxy gets
17768
+ * a default TargetGroup (`TargetGroupName: 'default'`) auto-created by AWS;
17769
+ * the CFn resource only manages target REGISTRATIONS
17770
+ * (`RegisterDBProxyTargets` / `DeregisterDBProxyTargets`) and the
17771
+ * connection pool config (`ModifyDBProxyTargetGroup`). The TargetGroup
17772
+ * object itself is not deleted on resource delete — it lives and dies with
17773
+ * the parent DBProxy.
17774
+ *
17775
+ * **Lifecycle**:
17776
+ * - `create`: optionally `ModifyDBProxyTargetGroup` (connection pool), then
17777
+ * `RegisterDBProxyTargets` (cluster IDs and / or instance IDs), then
17778
+ * `DescribeDBProxyTargetGroups` to recover the TargetGroupArn for state.
17779
+ * - `update`: rejected via `ResourceUpdateNotSupportedError` in MVP. The
17780
+ * per-property update surface (add/remove targets, pool config rewrites)
17781
+ * is a follow-up.
17782
+ * - `delete`: `DeregisterDBProxyTargets` for every registered target.
17783
+ * `DBProxyNotFoundFault` / `DBProxyTargetGroupNotFoundFault` /
17784
+ * `DBProxyTargetNotFoundFault` are treated as idempotent success
17785
+ * (region-match-gated) — the parent DBProxy may already have been
17786
+ * deleted by a sibling cdkd delete or by AWS CASCADE.
17787
+ * - `getAttribute`: `TargetGroupArn` returns the physicalId; `TargetGroupName`
17788
+ * returns `'default'`.
17789
+ *
17790
+ * **physicalId** = TargetGroupArn (matches the CFn `primaryIdentifier`).
17791
+ */
17792
+ var RDSDBProxyTargetGroupProvider = class {
17793
+ rdsClient;
17794
+ providerRegion = process.env["AWS_REGION"];
17795
+ logger = getLogger().child("RDSDBProxyTargetGroupProvider");
17796
+ handledProperties = new Map([["AWS::RDS::DBProxyTargetGroup", new Set([
17797
+ "DBProxyName",
17798
+ "TargetGroupName",
17799
+ "DBClusterIdentifiers",
17800
+ "DBInstanceIdentifiers",
17801
+ "ConnectionPoolConfigurationInfo"
17802
+ ])]]);
17803
+ getClient() {
17804
+ if (!this.rdsClient) this.rdsClient = new RDSClient(this.providerRegion ? { region: this.providerRegion } : {});
17805
+ return this.rdsClient;
17806
+ }
17807
+ async create(logicalId, resourceType, properties) {
17808
+ const dbProxyName = properties["DBProxyName"];
17809
+ if (!dbProxyName) throw new ProvisioningError(`DBProxyName is required for AWS::RDS::DBProxyTargetGroup ${logicalId}`, resourceType, logicalId);
17810
+ const targetGroupName = properties["TargetGroupName"] ?? "default";
17811
+ const dbClusterIdentifiers = properties["DBClusterIdentifiers"];
17812
+ const dbInstanceIdentifiers = properties["DBInstanceIdentifiers"];
17813
+ const connectionPoolConfig = properties["ConnectionPoolConfigurationInfo"];
17814
+ const client = this.getClient();
17815
+ if (connectionPoolConfig) {
17816
+ this.logger.debug(`Applying connection pool config to ${dbProxyName}/${targetGroupName}`);
17817
+ try {
17818
+ await client.send(new ModifyDBProxyTargetGroupCommand({
17819
+ DBProxyName: dbProxyName,
17820
+ TargetGroupName: targetGroupName,
17821
+ ConnectionPoolConfig: connectionPoolConfig
17822
+ }));
17823
+ } catch (error) {
17824
+ throw this.wrapError(error, "CREATE (pool config)", resourceType, logicalId, void 0);
17825
+ }
17826
+ }
17827
+ if (dbClusterIdentifiers && dbClusterIdentifiers.length > 0 || dbInstanceIdentifiers && dbInstanceIdentifiers.length > 0) {
17828
+ this.logger.debug(`Registering targets for ${dbProxyName}/${targetGroupName}: clusters=[${dbClusterIdentifiers?.join(",") ?? ""}], instances=[${dbInstanceIdentifiers?.join(",") ?? ""}]`);
17829
+ try {
17830
+ await client.send(new RegisterDBProxyTargetsCommand({
17831
+ DBProxyName: dbProxyName,
17832
+ TargetGroupName: targetGroupName,
17833
+ DBClusterIdentifiers: dbClusterIdentifiers,
17834
+ DBInstanceIdentifiers: dbInstanceIdentifiers
17835
+ }));
17836
+ } catch (error) {
17837
+ throw this.wrapError(error, "CREATE (register targets)", resourceType, logicalId, void 0);
17838
+ }
17839
+ }
17840
+ let targetGroupArn;
17841
+ try {
17842
+ targetGroupArn = (await client.send(new DescribeDBProxyTargetGroupsCommand({
17843
+ DBProxyName: dbProxyName,
17844
+ TargetGroupName: targetGroupName
17845
+ }))).TargetGroups?.[0]?.TargetGroupArn;
17846
+ } catch (error) {
17847
+ throw this.wrapError(error, "CREATE (describe)", resourceType, logicalId, void 0);
17848
+ }
17849
+ if (!targetGroupArn) throw new ProvisioningError(`Failed to recover TargetGroupArn for ${dbProxyName}/${targetGroupName} after create`, resourceType, logicalId);
17850
+ return {
17851
+ physicalId: targetGroupArn,
17852
+ attributes: {
17853
+ TargetGroupArn: targetGroupArn,
17854
+ TargetGroupName: targetGroupName
17855
+ }
17856
+ };
17857
+ }
17858
+ async update(logicalId, _physicalId, resourceType, _oldProperties, _newProperties) {
17859
+ throw new ResourceUpdateNotSupportedError(resourceType, logicalId, "destroy + redeploy; in-place updates of registered targets / connection pool config are not yet supported");
17860
+ }
17861
+ async delete(logicalId, physicalId, resourceType, properties, context) {
17862
+ const props = properties ?? {};
17863
+ const dbProxyName = props["DBProxyName"];
17864
+ const targetGroupName = props["TargetGroupName"] ?? "default";
17865
+ const dbClusterIdentifiers = props["DBClusterIdentifiers"];
17866
+ const dbInstanceIdentifiers = props["DBInstanceIdentifiers"];
17867
+ if (!dbProxyName) throw new ProvisioningError(`DBProxyName missing from state.properties for AWS::RDS::DBProxyTargetGroup ${logicalId}; cannot deregister targets. Manually run: aws rds deregister-db-proxy-targets --db-proxy-name <proxy-name> --target-group-name ${targetGroupName} ...`, resourceType, logicalId, physicalId);
17868
+ if (!(dbClusterIdentifiers && dbClusterIdentifiers.length > 0 || dbInstanceIdentifiers && dbInstanceIdentifiers.length > 0)) {
17869
+ this.logger.debug(`No targets registered for ${dbProxyName}/${targetGroupName}; nothing to deregister`);
17870
+ return;
17871
+ }
17872
+ this.logger.debug(`Deregistering targets from ${dbProxyName}/${targetGroupName}: clusters=[${dbClusterIdentifiers?.join(",") ?? ""}], instances=[${dbInstanceIdentifiers?.join(",") ?? ""}]`);
17873
+ try {
17874
+ await this.getClient().send(new DeregisterDBProxyTargetsCommand({
17875
+ DBProxyName: dbProxyName,
17876
+ TargetGroupName: targetGroupName,
17877
+ DBClusterIdentifiers: dbClusterIdentifiers,
17878
+ DBInstanceIdentifiers: dbInstanceIdentifiers
17879
+ }));
17880
+ } catch (error) {
17881
+ if (error instanceof DBProxyNotFoundFault || error instanceof DBProxyTargetGroupNotFoundFault || error instanceof DBProxyTargetNotFoundFault) {
17882
+ assertRegionMatch(await this.getClient().config.region(), context?.expectedRegion, resourceType, logicalId, physicalId);
17883
+ this.logger.debug(`${dbProxyName}/${targetGroupName} or its target is already gone, treating as success`);
17884
+ return;
17885
+ }
17886
+ throw this.wrapError(error, "DELETE", resourceType, logicalId, physicalId);
17887
+ }
17888
+ }
17889
+ async getAttribute(physicalId, _resourceType, attributeName) {
17890
+ switch (attributeName) {
17891
+ case "TargetGroupArn": return physicalId;
17892
+ case "TargetGroupName": return "default";
17893
+ default:
17894
+ this.logger.warn(`Unknown attribute ${attributeName} for AWS::RDS::DBProxyTargetGroup, returning undefined`);
17895
+ return;
17896
+ }
17897
+ }
17898
+ /**
17899
+ * Adopt an existing DBProxyTargetGroup into cdkd state.
17900
+ *
17901
+ * **Explicit override only.** The TargetGroup itself has no tags
17902
+ * (the parent DBProxy carries the cdkd path tag, not the wiring child),
17903
+ * so there is no `aws:cdk:path`-based auto-lookup. Users must pass
17904
+ * `--resource <logicalId>=<TargetGroupArn>`.
17905
+ */
17906
+ async import(input) {
17907
+ if (input.knownPhysicalId) return {
17908
+ physicalId: input.knownPhysicalId,
17909
+ attributes: {
17910
+ TargetGroupArn: input.knownPhysicalId,
17911
+ TargetGroupName: "default"
17912
+ }
17913
+ };
17914
+ return null;
17915
+ }
17916
+ wrapError(error, op, resourceType, logicalId, physicalId) {
17917
+ const message = error instanceof Error ? error.message : String(error);
17918
+ const cause = error instanceof Error ? error : void 0;
17919
+ return new ProvisioningError(`${op} failed for ${logicalId}: ${message}`, resourceType, logicalId, physicalId, cause);
17920
+ }
17921
+ };
17922
+
17751
17923
  //#endregion
17752
17924
  //#region src/provisioning/providers/docdb-provider.ts
17753
17925
  /**
@@ -28473,6 +28645,7 @@ function registerAllProviders(registry) {
28473
28645
  registry.register("AWS::RDS::DBSubnetGroup", rdsProvider);
28474
28646
  registry.register("AWS::RDS::DBCluster", rdsProvider);
28475
28647
  registry.register("AWS::RDS::DBInstance", rdsProvider);
28648
+ registry.register("AWS::RDS::DBProxyTargetGroup", new RDSDBProxyTargetGroupProvider());
28476
28649
  const docdbProvider = new DocDBProvider();
28477
28650
  registry.register("AWS::DocDB::DBSubnetGroup", docdbProvider);
28478
28651
  registry.register("AWS::DocDB::DBCluster", docdbProvider);
@@ -43452,7 +43625,7 @@ function reorderArgs(argv) {
43452
43625
  */
43453
43626
  async function main() {
43454
43627
  const program = new Command();
43455
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.103.0");
43628
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.103.2");
43456
43629
  program.addCommand(createBootstrapCommand());
43457
43630
  program.addCommand(createSynthCommand());
43458
43631
  program.addCommand(createListCommand());