Arvind Kumar
Arvind Kumar

Reputation: 21

Reg. Docker Image of microservices in AWS Lambda

I developed a spring boot-microservices application in which each microservice is packaged into a separate docker container. The databases for these services are also in separate docker containers. Currently, all these are hosted and running in AWS ECS. If I need to migrate to Lambda, can I reuse the same docker containers as such? (of course, I will add the AWS serverless dependency in all the pom.xml files) and do repackaging. Kindly let me know if I can run the modified docker images as such in Lambda?

Thank You

Upvotes: 1

Views: 365

Answers (1)

samtoddler
samtoddler

Reputation: 9625

I think you can't use share the same docker image between your ECS task and Lambda. Because they differ in few aspects and some of them are very specific to lambda, how we write the handler as well as package them.

New for AWS Lambda – Container Image Support

Your wording too is a bit confusing

can I reuse the same docker containers as such?

and then you say

can run the modified docker images as such in Lambda?

Example task definitions

For Spring Boot Application specifically, you can take a look here:

Running APIs Written in Java on AWS Lambda

Java AWS Lambda Container Image Support (Complete Guide)

Upvotes: 2

Related Questions