Lambda Annotations - make it easier to work with configured api gateways
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start with Libraries/src/Amazon.Lambda.Annotations/APIGateway/RestApiAttribute.cs and trace how its annotations become events in template.json or template.yaml. Verify how an existing API resource is identified, then confirm that the generated event includes a RestApiId reference to it; add or update focused tests if the repository provides coverage for this generation path.
Written by the indexing model from the issue text.
Description
Describe the feature
Add possibility to reference existing APIs on functions through annotations rather than today where manual template changes are needed.
Use Case
When using lambda annotations with multiple functions under the same gateway (for auth purposes, certificates, domains etc) it's tiresome and possibly error-prone to manually handle template changes.
Proposed Solution
On the lambda functions, add functionality to reference an existing API. An example usage could look like this:
[LambdaFunction(Name = "UpdateStatus")]
[RestApi(LambdaHttpMethod.Post, "/{x}/{y}/endpoint-path", "OrdersApiGateway")]
public APIGatewayProxyResponse Execute() {
}
where the new addition is to the "RestApi" path, where a new parameter (RestApiId) is configurable. In the example the value "OrdersApiGateway" is used.
This will then in the template.json|yaml add
{
"....": "....",
"RestApiId": {
"Ref": "OrdersApiGateway"
}
}
to the events part of the template which should be a reference to a resource in the template which has the API Gateway configured.
If the usage looks OK it will be added to REST API attribute here
https://github.com/aws/aws-lambda-dotnet/blob/master/Libraries/src/Amazon.Lambda.Annotations/APIGateway/RestApiAttribute.cs
Other Information
No response
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
Amazon.Lambda.Annotations
Targeted .NET Platform
.NET 6
Operating System and version
MacOS Ventura
- Dominant language
- C#
- Stars
- 1.7k
- Forks
- 503
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 21
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-lambda-dotnet
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
aws/aws-lambda-dotnet#2571 · 1 comment ·
-
bug module/aspnetcore-support p2 queued
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aws/aws-lambda-dotnet#1123 · 4 comments · 1 reaction ·
-
feature-request
Difficulty 4/5 3-5 days Newbie friendliness 68/100
aws/aws-lambda-dotnet#2572 · 1 comment ·
-
feature-request needs-triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
aws/aws-lambda-dotnet#2551 · 1 comment ·
-
feature-request needs-review
Difficulty 5/5 Over a week Newbie friendliness 35/100
aws/aws-lambda-dotnet#2519 ·
All issues in aws/aws-lambda-dotnet
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·