https://github.com/kessler/aws-sls-docker-deployer
deploy serverless lambdas to aws using aws linux containers
https://github.com/kessler/aws-sls-docker-deployer
aws aws-lambda docker serverless serverless-framework
Last synced: about 2 months ago
JSON representation
deploy serverless lambdas to aws using aws linux containers
- Host: GitHub
- URL: https://github.com/kessler/aws-sls-docker-deployer
- Owner: kessler
- Created: 2024-01-02T05:52:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-07T12:26:42.000Z (over 1 year ago)
- Last Synced: 2025-03-08T08:12:39.907Z (about 2 months ago)
- Topics: aws, aws-lambda, docker, serverless, serverless-framework
- Language: Shell
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# aws-sls-docker-deployer
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
## building the images
make sure you have docker installed then `./build-node.sh` or `./build-python.sh`
## using the images
The images accept the source via mounting to a preset directory (/app). To use the image, run it:
```bash
docker run --env-file .awsenv -v `pwd`:/app sls-node-deployer --stage=dev
```
1. the ```.awsenv``` file should contain the environment variables:```ini
AWS_ACCESS_KEY_ID=id here
AWS_SECRET_ACCESS_KEY=secret here
```if using aws sso, then this file can be generated via:
```bash
aws configure export-credentials --profile --format env-no-export > .awsenv
```2. ```-v \`pwd\`:/app``` mounts the current directory to /app dir inside the container, this is where the lambda's code should be.
3. all the arguments after `sls-node-deployer` are passed "as is" to `sls deploy` command, in this example ```--stage=dev``` is passed
## TODO
1. complete python implementation
2. fix code replication between node/python related files