This is a demo project showing some of my tool's features:
- Defining infrastructure using generated
synapse-provider:*modules - Programmatically bundling individual closures into infra
- Calling Zig functions from TypeScript
- Deploying, testing, tearing down
add.zig exports a function adding two arguments plus an environment value.
lambda.ts defines a class for creating Lambda functions from JS closures.
main.ts creates and tests two Lambdas.
- Latest version of Synapse: https://github.com/Cohesible/synapse#installation
- Valid AWS credentials in the usual places (~/.aws/credentials or environment variables)
unzipon Linux
synapse test runs install, compile, and deploy automatically if needed, then executes the tests.
Example output:
Deploying (8/8)
✓ + fn <LambdaFunction> (17s)
✓ + test
aarch64 (EXTRA_VAL: 67) (589ms)
x64 (EXTRA_VAL: 21) (467ms)
On a fresh machine install can take a minute, mostly due to the large AWS Terraform provider.
Subsequent changes to the code will reuse the deployment, updating as little as possible.
synapse destroy tears everything down:
Destroying (8/8)
✓ - test
✓ - fn <LambdaFunction> (1s)