aws-sam-cli
aws-sam-cli copied to clipboard
ALB support from SAM
Describe your idea/feature/enhancement
Provide a clear description. Ex. I wish SAM CLI would [...]
I would be see the option of testing and deploying Lambda functions for ALB ( Application load balancer )
Proposal
Add details of how to add this to the product.
Right now API gateway is support for local testing and deployment using sam local start-api.
Similarly there should be sam local start-load-balancer command and the events to test it.
In the SAM Template need to have Events: ALB: Type: ALB which is as above are only for API Gateway enabled and not for ALB.
Things to consider:
- Will this require any updates to the SAM Spec
Additional Details
Further the Cloud formation currently does not support Target group to be exposed as Lambada target
as the protocol and port are required in the current cloudformation template for ALB are mandatory but for exposing Lambda as ALB target it is not.
This relates to the SAM Spec supporting this. The issue tracking that is here
Any progress on this? It would be useful for local testing of Lambda functions placed behind ALBs. It wouldn't be that hard -- you take the input headers, modify them before sending them on to the Lambda function, then when you get the response from Lambda you change it again and send it back to the original caller.
At this time sam local start-api
supports emulating lambdas for ALB but ALB behaves differently in a couple aspects:
- Doesn't automatically url-decodes query string parameters;
- Fails when Boolean
true
exist as a response header value
At this time
sam local start-api
supports emulating lambdas for ALB
Would you be able to elaborate on exactly how you have achieved this?
Hi, is there any progress on this? Would to very useful to have this support, thanks
Thank you for the interest. We are still exploring a Plugin based solution for local development to allow the community to enable/extend features like this. Give that, we are closing this in favor of the Plugins tracking issue: https://github.com/aws/aws-sam-cli/issues/3265
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.