Skip to content

@venturekit/infra API

Creates a VentureKit application. This is the main entry point used in vk.config.ts.

function defineVenture(definition: VentureDefinition): {
_routesDir: string
_functionsDir: string
_queuesDir: string
_cronsDir: string
_resolveInfrastructure: (stage: string) => VentureIntent | undefined
_definition: VentureDefinition
app(input: { stage: string }): VentureAppConfig
}

Returns a metadata object that CLI tools read:

  • _routesDir — used by vk dev to discover routes and by vk deploy to configure API Gateway
  • _functionsDir / _queuesDir / _cronsDir — directories for standalone functions, queue consumers, and cron handlers
  • _resolveInfrastructure(stage) — merges shared definitions with per-env overrides by id, returns the resolved VentureIntent
  • _definition — the full definition for config resolution
  • app() — returns project name and region for the given stage

getResolvedConfig(base, security, envInput)

Section titled “getResolvedConfig(base, security, envInput)”

Returns the fully resolved ResolvedConfig for the current environment (determined by VENTURE_STAGE).

function getResolvedConfig(
base: BaseConfig,
security: SecurityConfig,
envInput: EnvConfigInput
): ResolvedConfig
interface VentureDefinition {
base: BaseConfig
security: SecurityConfig
envs: {
dev?: EnvConfigInput
stage?: EnvConfigInput
prod?: EnvConfigInput
}
routesDir?: string // default: 'src/routes'
functionsDir?: string // default: 'src/functions'
queuesDir?: string // default: 'src/queues'
cronsDir?: string // default: 'src/crons'
// Shared infrastructure definitions (matched by id with per-env overrides)
databases?: DatabaseIntent[]
storage?: StorageIntent[]
auth?: AuthIntent[]
queues?: QueueIntent[]
caches?: CacheIntent[]
schedules?: ScheduleIntent[]
functions?: FunctionIntent[]
monitoring?: MonitoringIntent[]
secrets?: SecretsIntent[]
envVars?: EnvVarIntent[]
domains?: DomainIntent[]
}
interface VentureAppConfig {
name: string
home: 'aws'
providers: { aws: { region: string } }
}