Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

symopsio/lambda-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sym Lambda Templates

Sym's serverless integrations let you use Sym workflows to manage resources that the Sym platform does not directly integrate with. Sym invokes your custom function with the appropriate metadata and then your function implementation updates your backend systems.

For full documentation, check out the AWS Lambda Access Strategy Docs.

Quickstart

Check out our AWS Lambda Strategy Example to see Sym's Lambda Strategy in action!

Schema

The schema of Sym's requests to you can be found here, with example payloads in the test directory.

Deploying

Each template includes a build.sh that you can use to package your AWS Lambda function for deployment. Once your function is packaged, you can upload it to S3 or use the update-function-code API:

$ aws lambda update-function-code \
  --function-name ${FUNCTION_NAME} \
  --zip-file fileb://handler.zip

Python

Lambda Configuration

You can try the template out by starting with this Terraform snippet or the equivalent in another deployment tool:

resource "aws_lambda_function" "this" {
  ...
  s3_bucket = "sym-releases"
  s3_key = "lambda-templates/python.zip"
  handler = "handler.handle"
  runtime = "python3.9"
  ...
}

Local Testing

handler.py lets you run the handler locally using:

$ pip install -r requirements.txt
$ # -e for an escalate payload, -d for a deescalate payload
$ python handler.py [-e | -d]

Packaging

build.sh builds a handler.zip that is appropriate for deploying to an AWS Lambda function.

TypeScript

Lambda Configuration

You can try the template out by starting with this Terraform snippet or the equivalent in another deployment tool:

resource "aws_lambda_function" "this" {
  ...
  s3_bucket = "sym-releases"
  s3_key = "lambda-templates/typescript.zip"
  handler  = "index.handler"
  runtime  = "nodejs14.x"
  ...
}

Local Testing

index.ts lets you run the handler locally using:

$ npm install
$ # -e for an escalate payload, -d for a deescalate payload
$ npx ts-node src/index.ts [-e | -d]

Packaging

build.sh builds a handler.zip that is appropriate for deploying to an AWS Lambda function.

Go

Lambda Configuration

You can try the template out by starting with this Terraform snippet or the equivalent in another deployment tool:

resource "aws_lambda_function" "this" {
  ...
  s3_bucket = "sym-releases"
  s3_key = "lambda-templates/go.zip"
  handler  = "bin/handler"
  runtime  = "go1.x"
  ...
}

Local Testing

cmd/local lets you run the handler locally using:

$ cd cmd/local
$ # -e for an escalate payload, -d for a deescalate payload
$ go run . [-e | -d]

Packaging

Makefile builds a handler.zip that is appropriate for deploying to an AWS Lambda function.

Get in touch

Please reach out with any questions on this example or help getting started.