serverless
serverless copied to clipboard
the-big-fan npm run deploy result in error
Steps: On cloud9 git clone https://github.com/cdk-patterns/serverless.git cd the-big-hit npm run build npm run deploy
9:08:16 PM | CREATE_FAILED | AWS::Lambda::Function | SQSCreatedStatusSu...bdaHandler0467DB95
Resource handler returned message: "Uploaded file must be a non-empty zip (Service: Lambda, Status Code: 400, Request ID: b2f597b6-3556-4df6-8d90-3541ed3ed7c0)" (RequestToken: b2579
b25-26d2-662e-ff4b-28fb634df493, HandlerErrorCode: InvalidRequest)
new Function (/home/ec2-user/environment/serverless/the-big-fan/typescript/node_modules/@aws-cdk/aws-lambda/lib/function.ts:608:35)
\_ new TheBigFanStack (/home/ec2-user/environment/serverless/the-big-fan/typescript/lib/the-big-fan-stack.ts:65:45)
\_ Object.<anonymous> (/home/ec2-user/environment/serverless/the-big-fan/typescript/bin/the-big-fan.ts:7:1)
\_ Module._compile (node:internal/modules/cjs/loader:1126:14)
\_ Module.m._compile (/home/ec2-user/environment/serverless/the-big-fan/typescript/node_modules/ts-node/src/index.ts:1056:23)
\_ Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
\_ Object.require.extensions.<computed> [as .ts] (/home/ec2-user/environment/serverless/the-big-fan/typescript/node_modules/ts-node/src/index.ts:1059:12)
\_ Module.load (node:internal/modules/cjs/loader:1004:32)
\_ Function.Module._load (node:internal/modules/cjs/loader:839:12)
Same issue with the-scalable-webhook
I ran into the same issue but with the-eventbridge-etl. The issue seemed to be caused by the fact that I had previously deployed a template using v2 of the CDK, and these templates are using v1.
To resolve the issue, I followed these steps:
- Created a new CDK project, using
cdk init app --language=typescript
in a new directory - Copied over the code and replaced the "aws-cdk" entries with "aws-cdk-lib" entries (basically switching from v1 to v2 of the CDK)
- (Optional) added
platform: Platform.LINUX_AMD64
inContainerImage.fromAsset
as I am runningcdk deploy
from a Mac with M1 chip and the Fargate task running the docker container was throwingexec format error
. I also updated the Makefile for the container at the stage wheredocker build
is called, to use--platform=linux/amd64
.
After making these changes, I was able to deploy and run the-eventbridge-etl pattern successfully. Hopefully these steps will help.