@nrfcloud/package-lambda
v3.3.1
Published
Package a lambda function and upload it to S3
Downloads
61
Readme
package-lambda
Package a lambda function and upload it to S3
NPM
Usage:
npx @nrfcloud/package-lambda npm <S3 Bucket> <NPM Package>
Example:
% npx @nrfcloud/package-lambda npm cf-lambda-sourcecode @nrfcloud/api-persistence-event-reducer-lambda
npx: installed 129 in 7.202s
Temp dir: /tmp/tmp-6832cnu8vLNSuGuu
running: rm -r /tmp/tmp-6832cnu8vLNSuGuu/@nrfcloud ...
@nrfcloud/api-persistence-event-reducer-lambda 1.0.2
running: npm ci --ignore-scripts --only=prod ...
added 28 packages in 0.605s
running: zip -r -q /tmp/tmp-6832cnu8vLNSuGuu/api-persistence-event-reducer-lambda-1.0.2.zip ./ ...
running: aws s3 cp /tmp/tmp-6832cnu8vLNSuGuu/api-persistence-event-reducer-lambda-1.0.2.zip s3://cf-lambda-sourcecode/api-persistence-event-reducer-lambda-1.0.2.zip ...
upload: ../../../../../tmp/tmp-6832cnu8vLNSuGuu/api-persistence-event-reducer-lambda-1.0.2.zip to s3://cf-lambda-sourcecode/api-persistence-event-reducer-lambda-1.0.2.zip
Local
You can also publish from a local folder.
This command expects:
package.json
package-lock.json
dist/
in the local folder.
Usage:
npx @nrfcloud/package-lambda local <S3 Bucket>
Example:
% npx @nrfcloud/package-lambda local cf-lambda-sourcecode
Temp dir: /tmp/tmp-206396JvbFs6flXBz
running: rm -r /tmp/tmp-206396JvbFs6flXBz/@nrfcloud ...
@nrfcloud/api-persistence-event-reducer-lambda 1.1.2
running: npm ci --ignore-scripts --only=prod ...
added 28 packages in 0.734s
running: zip -r -q /tmp/tmp-206396JvbFs6flXBz/api-persistence-event-reducer-lambda-1.1.2.zip ./ ...
running: aws s3 cp /tmp/tmp-206396JvbFs6flXBz/api-persistence-event-reducer-lambda-1.1.2.zip s3://cf-lambda-sourcecode/api-persistence-event-reducer-lambda-1.1.2.zip ...
upload: ../../../../../tmp/tmp-206396JvbFs6flXBz/api-persistence-event-reducer-lambda-1.1.2.zip to s3://cf-lambda-sourcecode/api-persistence-event-reducer-lambda-1.1.2.zip