@venturekit/infra
Installation
Section titled “Installation”npm install @venturekit/infra@devWhat It Provides
Section titled “What It Provides”defineVenture()
Section titled “defineVenture()”The main entry point for all VentureKit applications:
import { defineVenture } from '@venturekit/infra';
export default defineVenture({ base, security, envs: { dev, prod }, routesDir: 'src/routes', infrastructure: { /* optional intents */ },});This function:
- Validates all configuration
- Discovers file-based routes from
routesDir - Translates infrastructure intents to AWS resources
- Creates Lambda functions, API Gateway, VPC, and WebSocket API
- Injects intent outputs into Lambda environment variables
getResolvedConfig()
Section titled “getResolvedConfig()”Access the resolved configuration for the current environment:
import { getResolvedConfig } from '@venturekit/infra';
const config = getResolvedConfig(base, security, envInput);File-Based Route Discovery
Section titled “File-Based Route Discovery”Routes are automatically discovered from the file system:
src/routes/health/get.ts → GET /healthsrc/routes/tasks/post.ts → POST /taskssrc/routes/tasks/[id]/get.ts → GET /tasks/{id}Infrastructure Translation
Section titled “Infrastructure Translation”Intents are translated to provider-specific resources:
| Intent | AWS Resource |
|---|---|
databases | Amazon RDS |
storage | Amazon S3 + CloudFront |
auth | Amazon Cognito |
queues | Amazon SQS |
caches | Amazon ElastiCache |
schedules | Amazon EventBridge |
Dependencies
Section titled “Dependencies”@venturekit/core— requiredaws-cdk-lib(^2.170.0) — AWS CDKconstructs(^10.4.0) — CDK constructs library
Related
Section titled “Related”- Architecture — how packages fit together
- Configuration — layered config system
- File-Based Routing — route conventions
- Infrastructure Intents — declaring resources
- Deployment — deploying to AWS
- API Reference — full type documentation