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

docker image in lambda function in amplify gen2 #2386

Open
cookiejest opened this issue Jan 2, 2025 · 1 comment
Open

docker image in lambda function in amplify gen2 #2386

cookiejest opened this issue Jan 2, 2025 · 1 comment
Labels
feature-request New feature or request function Issue pertaining to Amplify Function

Comments

@cookiejest
Copy link

cookiejest commented Jan 2, 2025

Environment information

want to create a lambda function that has larger dependencies than 250mb (the layer limit).

Is there a way to specify a docker image for the lambda function using amplify gen2? I cannot find any information or example of how to do it in the docs.

What is the best way to deal with this scenario within gen2?

Describe the bug

want to use a large dependency within a lambda function

Reproduction steps

want to use a large dependency within a lambda function

@cookiejest cookiejest added the pending-triage Incoming issues that need categorization label Jan 2, 2025
@ykethan
Copy link
Member

ykethan commented Jan 2, 2025

Hey @cookiejest, thank you for reaching out. Amplify currently does not support using docker image on Lambda function. Marking this as feature request.

You may have to create a custom function using the Lambda cdk construct and use the From* to refer to an existing image(for example: Ecr) on the code property as Amplify console currently does not support running docker commands on the build process.

for example:

const imagesr = lambda.DockerImageCode.fromEcr(
      ecr.Repository.fromRepositoryName(this, 'testname', 'test'),
    );

const fn = new lambda.DockerImageFunction(this, "someLambda", {
      code: imagesr,
    });

@ykethan ykethan added feature-request New feature or request function Issue pertaining to Amplify Function and removed pending-triage Incoming issues that need categorization labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request function Issue pertaining to Amplify Function
Projects
None yet
Development

No branches or pull requests

2 participants