Skip to content

Commit

Permalink
feat(aws-lambda): Add lambda:ListLayerVersions permission to layer (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiborza authored Dec 11, 2024
1 parent c7d33a1 commit ab21495
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ npm-debug.log
.Trashes
*.env
.eslintcache
.idea
7 changes: 7 additions & 0 deletions src/utils/awsLambdaLayerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ export class AwsLambdaLayerManager {
Action: 'lambda:GetLayerVersion',
Principal: '*',
});
await lambda.addLayerVersionPermission({
LayerName: this.layerName,
VersionNumber: publishedLayer.Version,
StatementId: 'public',
Action: 'lambda:ListLayerVersions',
Principal: '*',
});

if (this.verboseInfo) {
logger.info(`Published layer in ${region} for ${this.runtime.name}:
Expand Down

0 comments on commit ab21495

Please sign in to comment.