tnc-ca-geo / animl-api

Backend for https://animl.camera
4 stars 0 forks source link

Rm docker based lambda in favor of node lambda runtime #180

Closed alukach closed 2 months ago

alukach commented 2 months ago

I successfully deployed #176 once removing the Lambda Docker tooling. Given that @jue-henry is also working on some tooling that depends on the removal of the Lambda Docker, I believe it may be wise to get that done separately in hopes of minimizing merge conflicts.

[!IMPORTANT]
A note regarding deploying this code: AWS can not change the type of a Lambda function from Docker-based to code-based. If you attempt to do a simple sls deploy, you will receive the following error:

Error:
UPDATE_FAILED: TaskLambdaFunction (AWS::Lambda::Function)
Resource handler returned message: "Invalid request provided: Updating PackageType is not supported" (RequestToken: 3d99584b-c459-d51b-4d46-8e19b83cd139, HandlerErrorCode: InvalidRequest)

Instead, you must deploy this change in two steps:

  1. Rename the lambda resources (e.g. append -tmp to each function, so that graphql: becomes graphql-tmp:), deploy.
  2. Revert rename of the lambda resources, deploy.

This will delete and recreate the lambda functions. It's a bit of a painful process but is necessary to get around this limitation.

alukach commented 2 months ago

Closed in favor of #182