0

Im using serverless framework to try to implement AWS Step functions. I have the Lambda functions running correctly. These are packaged in a .jar and I've manually uploaded to AWS s3.

I then have point to this .jar path on s3 in my serverless.yaml file:

service: serverless-card-issue

package:
  artifact: https://s3.amazonaws.com/integration-builds/serverless/HelloWorldFunction-1.0-SNAPSHOT.jar

I run:

sls deploy --stage integration-beta

This then takes 10-15 minutes to complete - far too long. In the logs I see:

Serverless: Running "serverless" installed locally (in service node_modules)
Serverless: Packaging service...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service HelloWorldFunction-1.0-SNAPSHOT.jar file to S3 (72.14 MB)...

Firstly, I have no idea how it's locating the HelloWorldFunction-1.0-SNAPSHOT.jar file locally - it's in a completely different directory.

Secondly, I do NOT want serverless to upload any .jar - it's already on s3.

How can I do this?

Mark
  • 4,544
  • 10
  • 46
  • 89
  • I have already written 2 lambdas functions and uploaded to s3 in a jar. Now using serverless to create a step function workflow, and trigger the lambda functions within the jar... – Mark Mar 31 '21 at 18:51
  • It is working perfect locally, so now I want to try on AWS – Mark Mar 31 '21 at 19:23

1 Answers1

-1

The deploy target automatically executes the package target in the background, i.e. it creates the JAR file automatically, and doesn't use any locally existing JAR. Additionally, the deploy target also automatically deploys the artifact to S3, so if you want to skip that part, add the parameter --noDeploy to your command. See also https://www.serverless.com/framework/docs/providers/aws/cli-reference/deploy/

dunni
  • 38,210
  • 8
  • 94
  • 96