@flightdev/adapter-aws
v0.0.7
Published
AWS adapter for Flight Framework - deploy to Lambda, Amplify, or API Gateway
Downloads
28
Maintainers
Readme
@flightdev/adapter-aws
AWS Lambda deployment adapter for Flight Framework. Deploy to Lambda with API Gateway or Lambda URLs.
Table of Contents
Installation
npm install @flightdev/adapter-awsQuick Start
// flight.config.ts
import { defineConfig } from '@flightdev/core';
import aws from '@flightdev/adapter-aws';
export default defineConfig({
adapter: aws(),
});Configuration
aws({
// Lambda runtime
runtime: 'nodejs20.x',
// Memory allocation (MB)
memory: 512,
// Timeout (seconds)
timeout: 30,
// Architecture
architecture: 'arm64', // or 'x86_64'
// Region
region: 'us-east-1',
// Use Lambda URLs (simpler, no API Gateway)
lambdaUrl: true,
// Streaming responses
streaming: true,
});Deployment Options
Lambda Function URLs
Simplest option, no API Gateway needed:
aws({
lambdaUrl: true,
});API Gateway HTTP API
For custom domains and API features:
aws({
apiGateway: 'http', // HTTP API (v2)
});API Gateway REST API
Full control with request/response transformations:
aws({
apiGateway: 'rest', // REST API (v1)
});Build Output
.aws/
├── lambda/
│ ├── index.mjs # Lambda handler
│ └── chunks/ # Code-split chunks
├── static/ # S3 static assets
└── template.yaml # SAM template (optional)Deployment
AWS SAM
# Install SAM CLI
brew install aws-sam-cli
# Build
npm run build
# Deploy
sam deploy --guidedSST (Recommended)
// sst.config.ts
export default {
config() {
return { name: 'my-flight-app', region: 'us-east-1' };
},
stacks(app) {
app.stack(({ stack }) => {
const site = new SsrSite(stack, 'Site', {
path: '.',
});
stack.addOutputs({ URL: site.url });
});
},
};Terraform
resource "aws_lambda_function" "app" {
filename = ".aws/lambda.zip"
function_name = "my-flight-app"
role = aws_iam_role.lambda.arn
handler = "index.handler"
runtime = "nodejs20.x"
memory_size = 512
timeout = 30
}License
MIT
