@Siva Ganesh one use case for Lambda is "serverless" applications, which as the name says does not need a server like ktor (and other people named nice solutions to achieve your goals with other frameworks). In these setups, your lambdas are not running, and they are triggered by something (in this case Api Gateway which handles routing etc.), for these triggers they "wake up or spawn" and handle your request and they "die/go back to sleep
. They are designed to have a short lifespan (as short as possible from the perspective of bills 😄 )
Ktor server is something that usually you want to have running all the time listening for requests and handle them, you dont need Api Gateway because the routes are defined in ktor. You need some computer or virtual machine to be running all the time to host this application, cloud providers have solutions for this use case. In AWS Lightsail, Elastic Beanstalk, EC2, ECS (with EC2 or Fargate) are solutions for this.
https://aws.amazon.com/websites/?nc2=h_ql_sol_use_web