aws / aws/aws-lambda-dotnet

Ability to assign Lambda Layers on the function

Open
#1,721 1 comment 0 reactions 0 assignees View on GitHub
annotations feature-request p2 queued
Dominant language
C#
Stars
1.7k
Forks
503
Avg merge
1d 5h
Merged PRs (30d)
18

Description

### Describe the feature

Similar to how we can already assign a Role or ResourceName to a Lambda function using the LambdaFunctionAttribute, we would like to be able to assign a Layer(s) to a Lambda function and also to have it update the CF template's serverless.template file.

### Use Case

We have multiple stages that we deploy our Lambda functions to currently, and we have the ability to dynamically change the Role by using conditional build directives in C#, but only because the LambdaFunctionAttribute already exists. Unfortunately we have to manually edit the layer(s) for a given function directly in the serverless.template prior to deploying our Lambdas.

### Proposed Solution

Ideally it would be implemented as an attribute, like the LambdaFunctionAttribute is done. If it would be more appropriate to add a Layers property to the existing LambdaFunctionAttribute, that would be acceptable too.

### Other Information

The only alternative we've considered is using a PowerShell script to make the change for us when building the project.

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS .NET SDK and/or Package version used

AWSSDK.Core 3.7.302.20, AWSSDK.Lambda 3.7.303.37

### Targeted .NET Platform

.Net 6+

### Operating System and version

Any

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.