Search code examples
amazon-web-servicesspring-bootaws-lambdaaws-codestar

How does AWS CodeStar SpringBoot Lambda app work?


Can someone please help me understand how the Hello World Java SpringBoot sample created by AWS CodeStar works when its deployed to lambda ?

What I cannot seem to understand is :-

There is a @SpringBootApplication annotation in the Main Application class, but how does this link to the handler/HelloWorldHandler.java ?

There seems to be no annotation in the HelloWorldHandler class which would indicate that it needs to be invoked when called by AWS Lambda.


Solution

  • From the AWS Lambda console, find and open the Lambda function you created with AWS CodeStar. Then click the Configuration tab and you'll see the Handler property has specified the package containing the handler method:

    com.aws.codestar.projecttemplates.handler.HelloWorldHandler
    

    That's how AWS Lambda knows what to execute.