Sls for packaging only

is it possible to use SLS to just package your function? For example, assume I’ve already used Terrraform to create a lambda and the lambda’s source is in an S3 bucket. Using the CLI I could push a new zip file into S3 and “refresh” my lambda. I would like to use SLS simply to build this zip file that I need to push. I don’t need to “deploy” anything or set up any infrastructure.

I want my Jenkins build to

  • checkout my repo
  • run “npm -i --only=prod”
  • run “npm run package” (this will be where I use SLS, and the results are “dist/”, for example)
  • scp dist/ <nexus | artifactory | s3>

I want my Jenkins deploy to

would something like that be possible???

Hello @jasonrberk and welcome to the forum!

I am not sure if the pipeline you described is possible, but to answer your first question, you can look at the package command.

It will package your application into a zip file located in the .serverless directory (along with other files). It is also possible to package functions individually as indicated the Serverless AWS Packaging Guide, which is a good resource to go through.

Hope this helps! :slight_smile: