Creates docker images to deploy serverless lambdas to aws linux. This is good for when you have native deps that need to be compiled to aws linux before they are used.
Basically, runs npm install
/ pipenv install
inside the container and then runs serverless deploy
There are two "flavors" one for nodejs and one for python.
The nodejs one is set on node v18 while the python is set for v3.9
make sure you have docker installed then ./build-node.sh
or ./build-python.sh
The images accept the source via mounting to a preset directory (/app). To use the image, run it:
docker run --env-file .awsenv -v `pwd`:/app sls-node-deployer --stage=dev
- the
.awsenv
file should contain the environment variables:
AWS_ACCESS_KEY_ID=id here
AWS_SECRET_ACCESS_KEY=secret here
if using aws sso, then this file can be generated via:
aws configure export-credentials --profile <your profile name here> --format env-no-export > .awsenv
-
-v \`pwd\`:/app
mounts the current directory to /app dir inside the container, this is where the lambda's code should be. -
all the arguments after
sls-node-deployer
are passed "as is" tosls deploy
command, in this example--stage=dev
is passed
- complete python implementation
- fix code replication between node/python related files