Skip to content

Cloud Deployment

ZinTrust is designed to run on multiple cloud targets, from serverless request runtimes such as Cloudflare Workers and AWS Lambda to traditional VPS and container deployments.

Terminology

In this guide:

  1. Cloudflare Worker means the Cloudflare serverless request runtime deployed with Wrangler.
  2. AWS Lambda means the AWS serverless request runtime.
  3. Serverless runtime is the broader category that includes both of the above.
  4. ZinTrust worker does not mean a Cloudflare Worker or Lambda function. It means a background job worker from the ZinTrust workers system.

Automated Workflows

The easiest way to set up cloud deployment is using the ZinTrust CLI (installed via @zintrust/core) to generate GitHub Actions workflows.

bash
# Generate a workflow for AWS Lambda
zin add workflow --platform lambda

# Generate a workflow for Cloudflare Workers
zin add workflow --platform cloudflare

# Generate workflows for all supported platforms
zin add workflow --platform all

This will create a .github/workflows/deploy-cloud.yml file tailored to your chosen platform.

Cloudflare Workers

ZinTrust can be deployed to the Cloudflare Worker runtime using the wrangler CLI.

bash
npm run deploy

By default, this deploy targets the production Wrangler environment. To deploy to a different environment:

bash
WRANGLER_ENV=development npm run deploy

Ensure you have configured your wrangler.toml with the necessary KV namespaces for secrets management.

AWS Lambda

Deploy ZinTrust as a serverless request handler on AWS Lambda using the LambdaAdapter.

typescript
import { LambdaAdapter } from '@zintrust/core';
import { app } from './app';

export const handler = LambdaAdapter.create(app);

Vercel / Netlify

For frontend-heavy applications or documentation sites, ZinTrust integrates perfectly with Vercel and Netlify.

DigitalOcean / Linode / AWS EC2

For traditional VPS deployments, follow the standard Deployment Guide using PM2 and Nginx.

Secrets Management

ZinTrust's SecretsManager provides a unified interface for retrieving secrets from various cloud providers:

  • Cloudflare KV
  • AWS Secrets Manager
  • Environment Variables (Fallback)

Released under the MIT License.