This project demonstrates how to run a warpgrapher service on an AWS Lambda serverless function.
- OpenSSL lib for MUSL
- Runing CosmosDB database
- AWS Lambda Function with CosmosDB environment variables:
export WG_CYPHER_HOST=127.0.0.1
export WG_CYPHER_READ_REPLICAS=127.0.0.1
export WG_CYPHER_PORT=443
export WG_CYPHER_USER=
export WG_CYPHER_PASS=Rust MUSL toolchain:
rustup target add x86_64-unknown-linux-muslexport FUNC_NAME=my-lambda-func
export BOOTSTRAP_ZIP=bootstrap.zipBuild the AWS Lambda serverless bootstrap binary and package it in a zip:
cargo build --release --target x86_64-unknown-linux-musl
zip -j ${BOOTSTRAP_ZIP} ./target/x86_64-unknown-linux-musl/release/bootstrapDeploy packaged function to AWS lambda:
aws lambda update-function-code \
--function-name ${FUNC_NAME} \
--zip-file fileb://${BOOTSTRAP_ZIP}