@go-to-k/cdkd 0.230.20 → 0.230.21
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.
|
@@ -6048,6 +6048,43 @@ const REF_RETURNS_SEGMENT_AFTER_PIPE = new Set([
|
|
|
6048
6048
|
"AWS::AppConfig::Deployment"
|
|
6049
6049
|
]);
|
|
6050
6050
|
/**
|
|
6051
|
+
* SDK-provisioned types whose provider stores the resource ARN as the physical
|
|
6052
|
+
* id (their delete / update paths need the ARN), while CloudFormation's `Ref`
|
|
6053
|
+
* returns the CFn physical resource id — which for these types is NOT the ARN:
|
|
6054
|
+
* - `AWS::Events::Rule` → the rule name (`arn:…:rule/<name>`), or
|
|
6055
|
+
* `<busName>|<ruleName>` for a custom-bus rule
|
|
6056
|
+
* (`arn:…:rule/<busName>/<ruleName>`) — the physical id CloudFormation
|
|
6057
|
+
* reports for such rules. The ARN stays reachable via `Fn::GetAtt Arn`.
|
|
6058
|
+
* - `AWS::CloudTrail::Trail` → the trail name (`arn:…:trail/<name>`).
|
|
6059
|
+
* Value: the ARN resource-type marker after which the CFn `Ref` value starts.
|
|
6060
|
+
*/
|
|
6061
|
+
const REF_RETURNS_NAME_FROM_ARN = new Map([["AWS::Events::Rule", ":rule/"], ["AWS::CloudTrail::Trail", ":trail/"]]);
|
|
6062
|
+
/**
|
|
6063
|
+
* Resolve the value CloudFormation's `Ref` returns for a resource, given its
|
|
6064
|
+
* type and cdkd-stored physical id. Pure function shared by the deploy-time
|
|
6065
|
+
* resolver ({@link IntrinsicFunctionResolver.resolveRefValue}) and the
|
|
6066
|
+
* `cdkd orphan` rewriter's `{Ref: <orphan>}` substitution, so both derive
|
|
6067
|
+
* identical CFn `Ref` semantics (after-pipe compound-id extraction and
|
|
6068
|
+
* name-from-ARN extraction included).
|
|
6069
|
+
*/
|
|
6070
|
+
function cfnRefValueFromPhysicalId(resourceType, physicalId) {
|
|
6071
|
+
const nameMarker = REF_RETURNS_NAME_FROM_ARN.get(resourceType);
|
|
6072
|
+
if (nameMarker && physicalId.startsWith("arn:")) {
|
|
6073
|
+
const markerIdx = physicalId.indexOf(nameMarker);
|
|
6074
|
+
if (markerIdx >= 0) {
|
|
6075
|
+
const segment = physicalId.substring(markerIdx + nameMarker.length);
|
|
6076
|
+
const slashIdx = segment.lastIndexOf("/");
|
|
6077
|
+
if (slashIdx >= 0) return `${segment.substring(0, slashIdx)}|${segment.substring(slashIdx + 1)}`;
|
|
6078
|
+
return segment;
|
|
6079
|
+
}
|
|
6080
|
+
}
|
|
6081
|
+
if (REF_RETURNS_SEGMENT_AFTER_PIPE.has(resourceType)) {
|
|
6082
|
+
const pipeIdx = physicalId.lastIndexOf("|");
|
|
6083
|
+
if (pipeIdx >= 0) return physicalId.substring(pipeIdx + 1);
|
|
6084
|
+
}
|
|
6085
|
+
return physicalId;
|
|
6086
|
+
}
|
|
6087
|
+
/**
|
|
6051
6088
|
* Intrinsic-function keys the resolver knows how to handle.
|
|
6052
6089
|
*
|
|
6053
6090
|
* A CloudFormation intrinsic is ALWAYS a single-key object — `{ "Ref": ... }`
|
|
@@ -6374,14 +6411,17 @@ var IntrinsicFunctionResolver = class {
|
|
|
6374
6411
|
* compound id, which fails the `[\w+]+` client-id validation.
|
|
6375
6412
|
* In every case the `Ref` value is the segment after the pipe (the parent id
|
|
6376
6413
|
* is the first identifier component).
|
|
6414
|
+
*
|
|
6415
|
+
* The {@link REF_RETURNS_NAME_FROM_ARN} types are SDK-provisioned with the
|
|
6416
|
+
* resource ARN stored as the physical id, while CFn's `Ref` returns the
|
|
6417
|
+
* resource NAME (the CFn physical resource id) — e.g. `AWS::Events::Rule`
|
|
6418
|
+
* (`Ref` is the rule name such as `mystack-ScheduledRule-ABC`; a consumer
|
|
6419
|
+
* calling `events:*` APIs by name or composing the name into another string
|
|
6420
|
+
* would otherwise get the full ARN) and `AWS::CloudTrail::Trail` (`Ref` is
|
|
6421
|
+
* the trail name). The name is extracted from the stored ARN.
|
|
6377
6422
|
*/
|
|
6378
6423
|
resolveRefValue(resource) {
|
|
6379
|
-
|
|
6380
|
-
if (REF_RETURNS_SEGMENT_AFTER_PIPE.has(resource.resourceType)) {
|
|
6381
|
-
const pipeIdx = physicalId.lastIndexOf("|");
|
|
6382
|
-
if (pipeIdx >= 0) return physicalId.substring(pipeIdx + 1);
|
|
6383
|
-
}
|
|
6384
|
-
return physicalId;
|
|
6424
|
+
return cfnRefValueFromPhysicalId(resource.resourceType, resource.physicalId);
|
|
6385
6425
|
}
|
|
6386
6426
|
/**
|
|
6387
6427
|
* Resolve Fn::GetAtt intrinsic function
|
|
@@ -6514,6 +6554,7 @@ var IntrinsicFunctionResolver = class {
|
|
|
6514
6554
|
}
|
|
6515
6555
|
if (resourceType === "AWS::Events::Rule") switch (attributeName) {
|
|
6516
6556
|
case "Arn": {
|
|
6557
|
+
if (physicalId.startsWith("arn:")) return physicalId;
|
|
6517
6558
|
const busRaw = resource.properties?.["EventBusName"];
|
|
6518
6559
|
const bus = typeof busRaw === "string" && busRaw && busRaw !== "default" ? busRaw : "";
|
|
6519
6560
|
const busName = bus.startsWith("arn:") ? bus.split("/").pop() || "" : bus;
|
|
@@ -6540,7 +6581,9 @@ var IntrinsicFunctionResolver = class {
|
|
|
6540
6581
|
default: return physicalId;
|
|
6541
6582
|
}
|
|
6542
6583
|
if (resourceType === "AWS::CloudTrail::Trail") switch (attributeName) {
|
|
6543
|
-
case "Arn":
|
|
6584
|
+
case "Arn":
|
|
6585
|
+
if (physicalId.startsWith("arn:")) return physicalId;
|
|
6586
|
+
return `arn:${partition}:cloudtrail:${region}:${accountId}:trail/${physicalId}`;
|
|
6544
6587
|
default: return physicalId;
|
|
6545
6588
|
}
|
|
6546
6589
|
if (resourceType === "AWS::AppSync::GraphQLApi") switch (attributeName) {
|
|
@@ -14176,5 +14219,5 @@ var DeployEngine = class {
|
|
|
14176
14219
|
};
|
|
14177
14220
|
|
|
14178
14221
|
//#endregion
|
|
14179
|
-
export {
|
|
14180
|
-
//# sourceMappingURL=deploy-engine-
|
|
14222
|
+
export { resolveStateBucketWithDefaultAndSource as $, TemplateParser as A, getDockerCmd as B, findActionableSilentDrops as C, applyRoleArnIfSet as D, cfnRefValueFromPhysicalId as E, AssetPublisher as F, Synthesizer as G, runDockerStreaming as H, stringifyValue as I, getLegacyStateBucketName as J, synthesisStatusMessage as K, WorkGraph as L, S3StateBackend as M, rebuildClientForBucketRegion as N, DiffCalculator as O, shouldRetainResource as P, resolveStateBucketWithDefault as Q, buildDockerImage as R, ProviderRegistry as S, IntrinsicFunctionResolver as T, AssetManifestLoader as U, runDockerForeground as V, getDockerImageBySourceHash as W, resolveCaptureObservedState as X, resolveApp as Y, resolveSkipPrefix as Z, green as _, withRetry as a, uploadCfnTemplate as at, IAMRoleProvider as b, computeImplicitDeleteEdges as c, resolveBucketRegion as ct, isStatefulRecreateTargetSync as d, warnDeprecatedNoPrefixCliFlag as et, renderStatefulReason as f, gray as g, cyan as h, withResourceDeadline as i, findLargeInlineResources as it, LockManager as j, DagBuilder as k, extractDeploymentEventError as l, bold as m, DEFAULT_RESOURCE_WARN_AFTER_MS as n, CFN_TEMPLATE_URL_LIMIT as nt, isRetryableTransientError as o, AssemblyReader as ot, formatResourceLine as p, getDefaultStateBucketName as q, DeployEngine as r, MIGRATE_TMP_PREFIX as rt, IMPLICIT_DELETE_DEPENDENCIES as s, clearBucketRegionCache as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, CFN_TEMPLATE_BODY_LIMIT as tt, MULTI_REGION_RECREATE_BLOCKED_TYPES as u, red as v, CloudControlProvider as w, collectInlinePolicyNamesManagedBySiblings as x, yellow as y, formatDockerLoginError as z };
|
|
14223
|
+
//# sourceMappingURL=deploy-engine-C92fYX-D.js.map
|