Skip to content

Commit

Permalink
[ADD] find functions with all layer versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ktx-mega committed Apr 29, 2024
1 parent 08b28e9 commit 811588e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ exports.listLambdaFunctionsWithLayer = async ({
nextMarker = nextPageMarker;
} while (nextMarker);

const matchinFunctions = allFunctions.filter((func) => func.Layers && func.Layers.some((layer) => layer.Arn === layerARN))
const layerARNWithoutVersion = layerARN.split(':').slice(0, -1).join(':')
const matchinFunctions = allFunctions.filter((func) => func.Layers && func.Layers.some((layer) => layer.Arn === layerARNWithoutVersion))
const functionNames = matchinFunctions.map((func) => func.FunctionName);
return functionNames;
} catch (error) {
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const {
...creds,
layerARN: layerResponse.LayerVersionArn,
})
console.log('The following functions will be updated :', foundFunctionNames)
// trigger functions update
await refreshLambdaLayerVersion({
...creds,
Expand Down

0 comments on commit 811588e

Please sign in to comment.