aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

ALB support from SAM

Open nikhilbhoj opened this issue 6 years ago • 5 comments

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:

  1. 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.

nikhilbhoj avatar Feb 14 '19 04:02 nikhilbhoj

This relates to the SAM Spec supporting this. The issue tracking that is here

jfuss avatar Jun 15 '19 02:06 jfuss

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.

patchu avatar Jul 07 '21 12:07 patchu

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

awerlang avatar Jul 20 '21 14:07 awerlang

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?

turiya-fps avatar Aug 18 '21 12:08 turiya-fps

Hi, is there any progress on this? Would to very useful to have this support, thanks

samlamgithub avatar Jul 01 '22 11:07 samlamgithub

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

jfuss avatar Dec 20 '22 21:12 jfuss

⚠️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.

github-actions[bot] avatar Dec 20 '22 21:12 github-actions[bot]