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

Lambda functions as Docker Container Images #8120

Open
1 of 2 tasks
ababushkin opened this issue Sep 7, 2021 · 10 comments
Open
1 of 2 tasks

Lambda functions as Docker Container Images #8120

ababushkin opened this issue Sep 7, 2021 · 10 comments
Labels
feature-request Request a new feature functions Issues tied to the functions category p4

Comments

@ababushkin
Copy link

ababushkin commented Sep 7, 2021

Is this related to a new or existing Amplify category?

function

Is this related to another service?

ECS, Docker

Describe the feature you'd like to request

As an engineer,
I want to create a Lambda function that is deployed in the form of a Docker container rather than in a dedicated runtime,
so that I have more flexibility, control, and fewer restrictions on the type of code that my function executes

More information on Lambda containers: https://docs.aws.amazon.com/lambda/latest/dg/images-create.html

Fewer restrictions

  • File size limitations. 250MB seems like a pretty generous limit, however, when doing image processing you typically need to use dependencies that easily exceed this limit. Even basic NodeJS projects creep up to 100MB very quickly because of the various modules that one installs.

Lambdas using containers can be up to 10GB in size!

  • Run time limitations. Some libraries need to be installed inside a specific runtime. Because I use MacOS these get installed with the wrong binaries causing my Lambda to fail when it starts up.

Lambdas using containers get around this problem since all packages will be installed using the same runtime that will execute the application.

Describe the solution you'd like

When running amplify add function I'd like another option (i.e. provider) that lets me choose "Container Image". This will then create the right CF template with a basic Dockerfile and /src folder that I can then use to do what I need to do.

When running amplify push it will build the image, upload it to ECS with the correct tags and deploy the CF template using the new image tag.

When running amplify remove it will delete all assets locally, along with the ECS images and CF template.

Describe alternatives you've considered

I'm investigating what it would take to build a custom function provider plugin based on how the python/nodeJS ones work. I can do this but will need some guidance/pointers from the Amplify team.

I've also looked at building something custom outside my amplify app, with a custom build pipeline, etc. This is NOT ideal since it's extra work - given I'm a 1 man team.

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@ababushkin ababushkin added the feature-request Request a new feature label Sep 7, 2021
@hoan-pham-duy
Copy link

Thanks so much for raising it. I also hope to have this feature in amplify!

@teezeit
Copy link

teezeit commented Jan 13, 2022

Thanks! This is a very important feature for us.

@danitul
Copy link

danitul commented Jan 13, 2022

Thanks a lot for this. Would be great to have it ! It is indeed a very important feature and doesn't seem there's another way around this in amplify right now.

@hoan-pham-duy
Copy link

I tried to customize lambda cloudformation file to image type but then after doing amplify push, the cloudformation file is reset to code .zip file type.

@tarasowski
Copy link

Hey folks, any news on that? Are there any strategies how to do it right now?

@josefaidt josefaidt added functions Issues tied to the functions category p4 labels Feb 22, 2022
@harakiro
Copy link

I agree this would be very useful!

@tarasowski
Copy link

@harakiro btw. you can include amplify into CDK
https://www.youtube.com/watch?v=rjiiNpJzOYk

@ahtashamabbasse
Copy link

That what I'm searching, I'm facing similar problem wrong binary is getting installed in lambda. Other people are also facing this issue.

chunyenHuang/hummusRecipe#196

@shaneh2
Copy link

shaneh2 commented Jul 5, 2022

I tried to customize lambda cloudformation file to image type but then after doing amplify push, the cloudformation file is reset to code .zip file type.

@hoan-pham-duy Is it possible to try using the CloudFormation code using tools other than the Amplify Command Line Interface?

@hoan-pham-duy
Copy link

hoan-pham-duy commented Oct 18, 2022

I tried to customize lambda cloudformation file to image type but then after doing amplify push, the cloudformation file is reset to code .zip file type.

@hoan-pham-duy Is it possible to try using the CloudFormation code using tools other than the Amplify Command Line Interface?

Currently, I need to set up some Lambda Container Images in "out_of_amplify" folder and then try to link with "Amplify Resources".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature functions Issues tied to the functions category p4
Projects
None yet
Development

No branches or pull requests

9 participants