Skip to content

@venturekit/core API

TypeDescription
BaseConfigProject identity — name, displayName, region
EnvConfigInputUser-provided environment config (partial, with optional preset) — sizing sections plus per-intent *Override[] arrays
EnvConfigFully resolved environment config (all fields required)
ResolvedConfigFully merged config — base + env with auto-generated tags
Environment'dev' | 'stage' | 'prod' or any custom stage name ('preview', 'qa', …)
Preset'free' | 'nano' | 'micro' | 'medium' | 'large'
PresetConfigThe full resolved shape a preset expands to (returned by getPreset())
DataSafety'relaxed' | 'standard' | 'strict'
IdentityEnvConfig / IdentityEnvConfigInputCognito User Pool tier for the stage — featurePlan
CognitoFeaturePlan'lite' | 'essentials' | 'plus'
TypeDescription
LambdaEnvConfig / LambdaEnvConfigInputLambda memory, timeout, VPC, logging, tracing, IAM (LambdaIamConfig, IamPolicyStatement, LambdaArchitecture, LambdaRuntime)
ApiEnvConfig / ApiEnvConfigInputAPI Gateway throttling, CORS, custom domain
VpcEnvConfig / VpcEnvConfigInputVPC AZs, NAT gateways (NatType), subnets (SubnetConfig), security group rules (SecurityGroupRule)
ObservabilityEnvConfig / ObservabilityEnvConfigInputAlarms (AlarmConfig), tracing (TracingConfig), metrics (MetricsConfig), log groups (LogGroupConfig)
WebSocketEnvConfig / WebSocketEnvConfigInputWebSocket enable, idle timeout, throttling
CorsConfigCORS origins, methods, headers, credentials
CustomDomainConfigCustom domain name and certificate ARN
TypeDescription
VentureIntentTop-level intent — databases, storage, auth, queues, caches, schedules, functions, monitoring, secrets, envVars, domains, notify, events, billing
DatabaseIntentDatabase — id, type, size, name, HA, backups, encryption
StorageIntentStorage — id, purpose, CDN, versioning, CORS
AuthIntentOwnedAuthIntent | ExternalAuthIntent — see below
OwnedAuthIntentA pool this venture creates — signInWith, allowSignUp, mfa, passwordStrength, clients, tokenValidity, customAttributes, tenancy, federated, customSender
ExternalAuthIntentA pool another venture owns — external: { project, intent? }
QueueIntentQueue — id, type (standard/FIFO), DLQ, retention, visibility timeout
CacheIntentCache — id, type (redis/memcached), size, clustered
ScheduleIntentSchedule — id, { rate } / { cron }, enabled, memorySize, timeout
FunctionIntentStandalone Lambda under src/functions/ — id, memorySize, timeout
EventsIntent / EventSubscriptionIntentEventBridge bus (owned or external) + rules routing to a queue or function
DomainIntentCustom domain — domain, target, dns, hostedZoneId, certificateArn, basePath
NotifyIntent / NotifyChannelTransactional messaging — channels, SES identity, outbox, dispatcher, WhatsApp
BillingIntentPayment provider ('zazu') whose credential secret is provisioned as a placeholder
MonitoringIntent / AlarmIntentCloudWatch dashboard, alarms, notification topic
SecretsIntent / EnvVarIntentSecrets Manager / SSM secrets and Lambda environment variables
*Override (DatabaseOverride, AuthOverride, NotifyOverride, …)Per-env override shapes — id plus any subset of the intent’s fields
IntentOutputsOutputs from provisioned resources — databases, storage, auth, queues, caches, functions, monitoring, secrets, eventBuses, notify, billing
ResourceSize'small' | 'medium' | 'large' | 'xlarge'

Merges base + environment config into a fully resolved ResolvedConfig.

function resolveConfig(
base: BaseConfig,
env: Environment,
envInput: EnvConfigInput
): ResolvedConfig

Resolves just the environment config, applying preset defaults and overrides.

function resolveEnvConfig(env: Environment, envInput: EnvConfigInput): EnvConfig

Returns the full PresetConfig for a named preset.

function getPreset(name: Preset): PresetConfig

Validates a BaseConfig and returns a ValidationResult.

function validateBaseConfig(config: BaseConfig): ValidationResult

Validates an EnvConfigInput and returns a ValidationResult.

function validateEnvConfigInput(env: Environment, config: EnvConfigInput): ValidationResult

Throws a ValidationError if the result is invalid.

function assertValid(result: ValidationResult): void

Returns the full list of Cognito custom attributes an OwnedAuthIntent needs: the user-declared customAttributes plus the feature-implied ones — role (unless tenancy is set), tenantId + tenantRoles when tenancy: true, and federated_provider + <provider>Sub per entry in federated — deduplicated. defineVenture() applies it for you; call it directly when you build pool schemas outside the CDK stacks (e.g. local cognito-local provisioning).

function resolveAuthCustomAttributes(intent: OwnedAuthIntent): string[]

Type guard narrowing an AuthIntent to ExternalAuthIntent (an entry with external: { project, intent? }).

function isExternalAuthIntent(intent: AuthIntent): intent is ExternalAuthIntent
ConstantDescription
PRESET_FREEFree-tier preset configuration
PRESET_NANONano preset configuration
PRESET_MICROMicro preset configuration
PRESET_MEDIUMMedium preset configuration
PRESET_LARGELarge preset configuration
DEFAULT_DATA_SAFETYDefault data safety per environment
DATA_SAFETY_CONFIGData safety configuration mapping

Error class thrown by assertValid() when validation fails.

class ValidationError {
constructor(field: string, message: string, value?: unknown)
field: string
message: string
value?: unknown
}