Skip to content

Commit 23be532

Browse files
fix
1 parent 215c355 commit 23be532

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/cloudFormation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ async function getLambdasInStack(
145145
lambdaName: string;
146146
logicalId: string;
147147
stackName: string;
148+
stackLogicalId: string;
148149
}>
149150
> {
150151
const response = await getCloudFormationResources(
@@ -165,7 +166,8 @@ async function getLambdasInStack(
165166
return {
166167
lambdaName: resource.PhysicalResourceId!,
167168
logicalId: resource.LogicalResourceId!,
168-
stackName: stackLogicalId ?? stackName,
169+
stackName: stackName,
170+
stackLogicalId: stackLogicalId ?? stackName,
169171
};
170172
}) ?? [];
171173

src/frameworks/samFramework.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,11 @@ export class SamFramework implements IFramework {
118118
awsConfiguration,
119119
);
120120

121-
const stackAndNestedStackNames = [
122-
...new Set(lambdasInStack.map((l) => l.stackName)),
123-
];
124-
125121
Logger.verbose(
126122
`[SAM] Found Lambdas in stack ${stackName}:`,
127123
JSON.stringify(lambdasInStack, null, 2),
128124
);
129125

130-
Logger.verbose(
131-
`[SAM] Found the following stacks and nested stacks: ${stackAndNestedStackNames.join(', ')}`,
132-
);
133-
134126
// get tags for each Lambda
135127
for (const func of lambdas) {
136128
const handlerFull = path.join(func.codeUri ?? '', func.handler);
@@ -139,7 +131,8 @@ export class SamFramework implements IFramework {
139131

140132
const functionName = lambdasInStack.find(
141133
(lambda) =>
142-
lambda.logicalId === func.name && lambda.stackName === func.stackName,
134+
lambda.logicalId === func.name &&
135+
lambda.stackLogicalId === func.stackName,
143136
)?.lambdaName;
144137

145138
if (!functionName) {

0 commit comments

Comments
 (0)