-
Notifications
You must be signed in to change notification settings - Fork 45
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
Runtime lambda_provided forces function-app main class to default MicronautLambdaRuntime implementation #820
Comments
@miguelaferreira If you want to deploy a JAR file to a AWS Lambda Java runtime, you should use |
@sdelamo Thanks for getting back to me. I don't want to deploy a jar, I want to deploy as a container image. Specifying If there was a way to let me define my own main class, that would solve my problem. |
we don't have any runtime tailored to deploy as a container image. why do you want to do that instead of native executable to custom runtime or java runtime? |
Isn't the custom runtime deployed as a container as well? I've always assumed custom runtime is deployed as a container. Next to that, the MicronautLambdaRuntime class seems wired for API Gateway, and my lambda function isn't integrated with that. Therefore I want to implement my own class and have that wired as the main class of my application. |
It seems that all lambdas I run face this problem now after upgrading to Micronaut 4. For one I was running Micronaut As I mentioned before, not all lambdas are integrated with ApiGateway, in my case they are triggered directly form S3 events. I now get errors like this:
The workaround I've used in other functions is to not use gradle to build the docker containers for the function. That means I have to create and maintain my own Dockerfile and scripts around it, for example like this. Imposing an implementation for the main class of any lambda function seems overly restrictive from Micronaut. |
I was reading the Micronaut docs again to make sure I didn't miss anything. Please correct me if I'm wrong, but what I understand from it is that we should be able to use custom runtimes and still define our own main class.
Then it goes on saying that Microanut ships 3 already implemented main classes for functions that respond to HTTP triggers. But maybe the custom runtimes are related to setting |
Expected Behavior
Changing the runtime to
lambda_provided
should not affect the defined main class for the application, or at least respect that value when explicitly set.Actual Behaviour
Setting the runtime to
lambda_provided
, changes the main class defined in the manifest of the built JARs toio.micronaut.function.aws.runtime.MicronautLambdaRuntime
.Steps To Reproduce
build.gradle
to setlambda_provided
runtime and a different docker container base imageio.micronaut.function.aws.runtime.MicronautLambdaRuntime
Environment Information
Example Application
No response
Version
4.1.0
The text was updated successfully, but these errors were encountered: