Skip to content

Latest commit

 

History

History
executable file
·
50 lines (36 loc) · 1.48 KB

File metadata and controls

executable file
·
50 lines (36 loc) · 1.48 KB

Warpgrapher + AWS Lambda

Build Status

This project demonstrates how to run a warpgrapher service on an AWS Lambda serverless function.

External Requirements

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=

Dependencies

Rust MUSL toolchain:

rustup target add x86_64-unknown-linux-musl

Build

export FUNC_NAME=my-lambda-func
export BOOTSTRAP_ZIP=bootstrap.zip

Build 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/bootstrap

Deploy

Deploy packaged function to AWS lambda:

aws lambda update-function-code \
    --function-name ${FUNC_NAME} \
    --zip-file fileb://${BOOTSTRAP_ZIP}