@go-to-k/cdkd 0.103.0 → 0.103.1

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.
@@ -24,6 +24,7 @@ import { promisify } from "node:util";
24
24
  import { DescribeImagesCommand as DescribeImagesCommand$1, ECRClient, GetAuthorizationTokenCommand } from "@aws-sdk/client-ecr";
25
25
  import { hostname } from "os";
26
26
  import graphlib from "graphlib";
27
+ import { DescribeDBClustersCommand, RDSClient } from "@aws-sdk/client-rds";
27
28
  import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
28
29
 
29
30
  //#region src/provisioning/resource-name.ts
@@ -5361,10 +5362,25 @@ var IntrinsicFunctionResolver = class {
5361
5362
  }
5362
5363
  const resource = context.resources[logicalId];
5363
5364
  if (!resource) throw new Error(`Resource ${logicalId} not found for Fn::GetAtt`);
5364
- if (!(resource.resourceType === "AWS::EC2::VPC" && attributeName === "Ipv6CidrBlocks") && resource.attributes?.[attributeName] !== void 0) {
5365
- const value = resource.attributes[attributeName];
5366
- this.logger.debug(`Resolved Fn::GetAtt from attributes: ${logicalId}.${attributeName} -> ${stringifyValue(value)}`);
5367
- return value;
5365
+ if (!(resource.resourceType === "AWS::EC2::VPC" && attributeName === "Ipv6CidrBlocks") && resource.attributes !== void 0) {
5366
+ const flatValue = resource.attributes[attributeName];
5367
+ if (flatValue !== void 0) {
5368
+ this.logger.debug(`Resolved Fn::GetAtt from attributes: ${logicalId}.${attributeName} -> ${stringifyValue(flatValue)}`);
5369
+ return flatValue;
5370
+ }
5371
+ if (attributeName.includes(".")) {
5372
+ const parts = attributeName.split(".");
5373
+ let cursor = resource.attributes;
5374
+ for (const part of parts) if (cursor && typeof cursor === "object" && part in cursor) cursor = cursor[part];
5375
+ else {
5376
+ cursor = void 0;
5377
+ break;
5378
+ }
5379
+ if (cursor !== void 0) {
5380
+ this.logger.debug(`Resolved Fn::GetAtt from nested attributes: ${logicalId}.${attributeName} -> ${stringifyValue(cursor)}`);
5381
+ return cursor;
5382
+ }
5383
+ }
5368
5384
  }
5369
5385
  const value = await this.constructAttribute(resource, attributeName, context);
5370
5386
  this.logger.debug(`Resolved Fn::GetAtt: ${logicalId}.${attributeName} -> ${stringifyValue(value)}`);
@@ -6531,6 +6547,21 @@ var CloudControlProvider = class {
6531
6547
  case "AWS::S3::Bucket":
6532
6548
  if (!enriched["Arn"]) enriched["Arn"] = `arn:aws:s3:::${physicalId}`;
6533
6549
  break;
6550
+ case "AWS::RDS::DBCluster":
6551
+ try {
6552
+ const cluster = (await new RDSClient({}).send(new DescribeDBClustersCommand({ DBClusterIdentifier: physicalId }))).DBClusters?.[0];
6553
+ if (cluster) {
6554
+ if (cluster.Endpoint) enriched["Endpoint.Address"] = cluster.Endpoint;
6555
+ if (cluster.Port !== void 0) enriched["Endpoint.Port"] = String(cluster.Port);
6556
+ if (cluster.ReaderEndpoint) enriched["ReadEndpoint.Address"] = cluster.ReaderEndpoint;
6557
+ if (cluster.DBClusterArn) enriched["Arn"] = cluster.DBClusterArn;
6558
+ if (cluster.DbClusterResourceId) enriched["DBClusterResourceId"] = cluster.DbClusterResourceId;
6559
+ this.logger.debug(`Enriched RDS DBCluster ${physicalId} with Endpoint/Port/Arn from DescribeDBClusters`);
6560
+ }
6561
+ } catch (error) {
6562
+ this.logger.debug(`Failed to enrich RDS DBCluster ${physicalId}: ${error instanceof Error ? error.message : String(error)}`);
6563
+ }
6564
+ break;
6534
6565
  case "AWS::DynamoDB::Table":
6535
6566
  if (!enriched["StreamArn"]) try {
6536
6567
  const latestStreamArn = (await getAwsClients().dynamoDB.send(new DescribeTableCommand({ TableName: physicalId }))).Table?.LatestStreamArn;
@@ -9546,4 +9577,4 @@ var DeployEngine = class {
9546
9577
 
9547
9578
  //#endregion
9548
9579
  export { SynthesisError as $, resolveApp as A, CdkdError as B, AssetPublisher as C, Synthesizer as D, buildDockerImage as E, warnDeprecatedNoPrefixCliFlag as F, PartialFailureError as G, DependencyError as H, AssemblyReader as I, ResourceUpdateNotSupportedError as J, ProvisioningError as K, clearBucketRegionCache as L, resolveSkipPrefix as M, resolveStateBucketWithDefault as N, getDefaultStateBucketName as O, resolveStateBucketWithDefaultAndSource as P, StateError as Q, resolveBucketRegion as R, shouldRetainResource as S, WorkGraph as T, LocalInvokeBuildError as U, ConfigError as V, LockError as W, StackHasActiveImportsError as X, RouteDiscoveryError as Y, StackTerminationProtectionError as Z, DiffCalculator as _, withRetry as a, getLogger as at, LockManager as b, collectInlinePolicyNamesManagedBySiblings as c, getLiveRenderer as ct, normalizeAwsTagsToCfn as d, generateResourceName as dt, formatError as et, resolveExplicitPhysicalId as f, generateResourceNameWithFallback as ft, IntrinsicFunctionResolver as g, assertRegionMatch as h, withResourceDeadline as i, ConsoleLogger as it, resolveCaptureObservedState as j, getLegacyStateBucketName as k, CDK_PATH_TAG as l, PATTERN_B_NAME_PROPERTIES as lt, CloudControlProvider as m, withStackName as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, normalizeAwsError as nt, IMPLICIT_DELETE_DEPENDENCIES as o, setLogger as ot, ProviderRegistry as p, withSkipPrefix as pt, ResourceTimeoutError as q, DeployEngine as r, withErrorHandling as rt, IAMRoleProvider as s, runStackBuffered as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, isCdkdError as tt, matchesCdkPath as u, PATTERN_B_RESOURCE_TYPES as ut, DagBuilder as v, stringifyValue as w, S3StateBackend as x, TemplateParser as y, AssetError as z };
9549
- //# sourceMappingURL=deploy-engine-DGKtcKF6.js.map
9580
+ //# sourceMappingURL=deploy-engine-D6nbHjNM.js.map