cdk-real-drift 0.12.0 → 0.12.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.
package/dist/cli.js CHANGED
@@ -6584,6 +6584,19 @@ function parentRefMatches(declaredValue, ...candidates) {
6584
6584
  if (declaredValue === UNRESOLVED || hasUnresolved(declaredValue)) return true;
6585
6585
  return candidates.some((c) => c !== void 0 && declaredValue === c);
6586
6586
  }
6587
+ function unqualifiedFunctionRef(ref) {
6588
+ if (typeof ref !== "string") return ref;
6589
+ if (ref.startsWith("arn:")) {
6590
+ const seg = ref.split(":");
6591
+ if (seg.length >= 8 && seg[5] === "function") return seg.slice(0, 7).join(":");
6592
+ return ref;
6593
+ }
6594
+ const i = ref.indexOf(":");
6595
+ return i === -1 ? ref : ref.slice(0, i);
6596
+ }
6597
+ function lambdaFunctionRefMatches(declaredValue, ...candidates) {
6598
+ return parentRefMatches(unqualifiedFunctionRef(declaredValue), ...candidates.map((c) => c === void 0 ? void 0 : unqualifiedFunctionRef(c)));
6599
+ }
6587
6600
  const CHILD_ENUMERATORS = {
6588
6601
  "AWS::ApiGateway::RestApi": enumerateRestApiChildren,
6589
6602
  "AWS::ApiGatewayV2::Api": enumerateHttpApiChildren,
@@ -7292,7 +7305,7 @@ async function enumerateLambdaFunctionChildren(ctx) {
7292
7305
  for (const r of desired.resources) {
7293
7306
  if (r.resourceType !== "AWS::Lambda::EventSourceMapping" || !r.physicalId) continue;
7294
7307
  const fn = r.declared.FunctionName;
7295
- if (parentRefMatches(fn, functionName, fnArn)) declaredMappingIds.push(r.physicalId);
7308
+ if (lambdaFunctionRefMatches(fn, functionName, fnArn)) declaredMappingIds.push(r.physicalId);
7296
7309
  }
7297
7310
  const declaredUrlArns = [];
7298
7311
  for (const r of desired.resources) {
@@ -7311,7 +7324,7 @@ async function enumerateLambdaFunctionChildren(ctx) {
7311
7324
  const declaredVersionArns = [];
7312
7325
  for (const r of desired.resources) {
7313
7326
  if (r.resourceType !== "AWS::Lambda::Version" || !r.physicalId) continue;
7314
- if (parentRefMatches(r.declared.FunctionName, functionName, fnArn)) declaredVersionArns.push(r.physicalId);
7327
+ if (lambdaFunctionRefMatches(r.declared.FunctionName, functionName, fnArn)) declaredVersionArns.push(r.physicalId);
7315
7328
  }
7316
7329
  const client = new LambdaClient({
7317
7330
  region,