Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for running AWS Lambdas under ALB #1733

Closed
johncurrier opened this issue Apr 26, 2023 · 4 comments · Fixed by #1786
Closed

Support for running AWS Lambdas under ALB #1733

johncurrier opened this issue Apr 26, 2023 · 4 comments · Fixed by #1786
Assignees

Comments

@johncurrier
Copy link

I'm attempting to convert my RESTful AWS Lambda from API Gateway to Elastic Load Balancer (ELB). I got it somewhat working, then realized that the responses were always coming back with a content type of application/octet-stream. In trying to figure out why I discovered that the Lambda is returning responses that are transformed to match API Gateway requirements.

There doesn't seem to be a mechanism available to disable that API Gateway-specific transformation of responses. This ticket is to request a Lambda handler that doesn't do that transformation. Ideally it'd support single-value headers.

Steps to Reproduce

Documented at https://github.com/johncurrier/micronautLambdaUnderAlb.

Expected Behaviour

A standard RESTful response with the headers set by a controller returned to clients.

Actual Behaviour

AWS API Gateway-based responses are returned instead. Things like content type come back as their default application/octet-stream.

Environment Information

  • Operating System: N/A
  • Micronaut Version: 3.9.0
  • JDK Version: 11

Example Application

@sdelamo sdelamo transferred this issue from micronaut-projects/micronaut-core May 27, 2023
@sdelamo
Copy link
Contributor

sdelamo commented Jun 28, 2023

@johncurrier we added in Micronaut Framework 4 a handler for ALB. Can you try johncurrier/micronautLambdaUnderAlb#1 and confirm this is solved?

@sdelamo sdelamo linked a pull request Jun 28, 2023 that will close this issue
@johncurrier
Copy link
Author

@sdelamo it all looks promising, but I've given up on Micronaut for the set of projects that I'm working on.

@sdelamo
Copy link
Contributor

sdelamo commented Jul 7, 2023

@sdelamo it all looks promising, but I've given up on Micronaut for the set of projects that I'm working on.

due to us not supporting alb event?

@johncurrier
Copy link
Author

@sdelamo it's just too difficult to try to figure out how to work around the various flaws in how it all works. Some of the fundamental pieces seem to be singletons, so having a Lambda that interacts with multiple external services requires way too much knowledge (and hacks) related to the underpinnings. I also ran into period connection failures that all disappeared when I moved to a different container.

I've always loved Micronaut, but it's just too difficult to get anything beyond simple things working.

@sdelamo sdelamo closed this as completed Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants