@venturekit/core API
Configuration Types
Section titled “Configuration Types”| Type | Description |
|---|---|
BaseConfig | Project identity — name, displayName, region |
EnvConfigInput | User-provided environment config (partial, with optional preset) — sizing sections plus per-intent *Override[] arrays |
EnvConfig | Fully resolved environment config (all fields required) |
ResolvedConfig | Fully 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' |
PresetConfig | The full resolved shape a preset expands to (returned by getPreset()) |
DataSafety | 'relaxed' | 'standard' | 'strict' |
IdentityEnvConfig / IdentityEnvConfigInput | Cognito User Pool tier for the stage — featurePlan |
CognitoFeaturePlan | 'lite' | 'essentials' | 'plus' |
Sub-Configuration Types
Section titled “Sub-Configuration Types”| Type | Description |
|---|---|
LambdaEnvConfig / LambdaEnvConfigInput | Lambda memory, timeout, VPC, logging, tracing, IAM (LambdaIamConfig, IamPolicyStatement, LambdaArchitecture, LambdaRuntime) |
ApiEnvConfig / ApiEnvConfigInput | API Gateway throttling, CORS, custom domain |
VpcEnvConfig / VpcEnvConfigInput | VPC AZs, NAT gateways (NatType), subnets (SubnetConfig), security group rules (SecurityGroupRule) |
ObservabilityEnvConfig / ObservabilityEnvConfigInput | Alarms (AlarmConfig), tracing (TracingConfig), metrics (MetricsConfig), log groups (LogGroupConfig) |
WebSocketEnvConfig / WebSocketEnvConfigInput | WebSocket enable, idle timeout, throttling |
CorsConfig | CORS origins, methods, headers, credentials |
CustomDomainConfig | Custom domain name and certificate ARN |
Infrastructure Intent Types
Section titled “Infrastructure Intent Types”| Type | Description |
|---|---|
VentureIntent | Top-level intent — databases, storage, auth, queues, caches, schedules, functions, monitoring, secrets, envVars, domains, notify, events, billing |
DatabaseIntent | Database — id, type, size, name, HA, backups, encryption |
StorageIntent | Storage — id, purpose, CDN, versioning, CORS |
AuthIntent | OwnedAuthIntent | ExternalAuthIntent — see below |
OwnedAuthIntent | A pool this venture creates — signInWith, allowSignUp, mfa, passwordStrength, clients, tokenValidity, customAttributes, tenancy, federated, customSender |
ExternalAuthIntent | A pool another venture owns — external: { project, intent? } |
QueueIntent | Queue — id, type (standard/FIFO), DLQ, retention, visibility timeout |
CacheIntent | Cache — id, type (redis/memcached), size, clustered |
ScheduleIntent | Schedule — id, { rate } / { cron }, enabled, memorySize, timeout |
FunctionIntent | Standalone Lambda under src/functions/ — id, memorySize, timeout |
EventsIntent / EventSubscriptionIntent | EventBridge bus (owned or external) + rules routing to a queue or function |
DomainIntent | Custom domain — domain, target, dns, hostedZoneId, certificateArn, basePath |
NotifyIntent / NotifyChannel | Transactional messaging — channels, SES identity, outbox, dispatcher, WhatsApp |
BillingIntent | Payment provider ('zazu') whose credential secret is provisioned as a placeholder |
MonitoringIntent / AlarmIntent | CloudWatch dashboard, alarms, notification topic |
SecretsIntent / EnvVarIntent | Secrets Manager / SSM secrets and Lambda environment variables |
*Override (DatabaseOverride, AuthOverride, NotifyOverride, …) | Per-env override shapes — id plus any subset of the intent’s fields |
IntentOutputs | Outputs from provisioned resources — databases, storage, auth, queues, caches, functions, monitoring, secrets, eventBuses, notify, billing |
ResourceSize | 'small' | 'medium' | 'large' | 'xlarge' |
Functions
Section titled “Functions”resolveConfig(base, env, envInput)
Section titled “resolveConfig(base, env, envInput)”Merges base + environment config into a fully resolved ResolvedConfig.
function resolveConfig( base: BaseConfig, env: Environment, envInput: EnvConfigInput): ResolvedConfigresolveEnvConfig(env, envInput)
Section titled “resolveEnvConfig(env, envInput)”Resolves just the environment config, applying preset defaults and overrides.
function resolveEnvConfig(env: Environment, envInput: EnvConfigInput): EnvConfiggetPreset(name)
Section titled “getPreset(name)”Returns the full PresetConfig for a named preset.
function getPreset(name: Preset): PresetConfigvalidateBaseConfig(config)
Section titled “validateBaseConfig(config)”Validates a BaseConfig and returns a ValidationResult.
function validateBaseConfig(config: BaseConfig): ValidationResultvalidateEnvConfigInput(env, config)
Section titled “validateEnvConfigInput(env, config)”Validates an EnvConfigInput and returns a ValidationResult.
function validateEnvConfigInput(env: Environment, config: EnvConfigInput): ValidationResultassertValid(result)
Section titled “assertValid(result)”Throws a ValidationError if the result is invalid.
function assertValid(result: ValidationResult): voidresolveAuthCustomAttributes(intent)
Section titled “resolveAuthCustomAttributes(intent)”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[]isExternalAuthIntent(intent)
Section titled “isExternalAuthIntent(intent)”Type guard narrowing an AuthIntent to ExternalAuthIntent (an entry with external: { project, intent? }).
function isExternalAuthIntent(intent: AuthIntent): intent is ExternalAuthIntentConstants
Section titled “Constants”| Constant | Description |
|---|---|
PRESET_FREE | Free-tier preset configuration |
PRESET_NANO | Nano preset configuration |
PRESET_MICRO | Micro preset configuration |
PRESET_MEDIUM | Medium preset configuration |
PRESET_LARGE | Large preset configuration |
DEFAULT_DATA_SAFETY | Default data safety per environment |
DATA_SAFETY_CONFIG | Data safety configuration mapping |
Classes
Section titled “Classes”ValidationError
Section titled “ValidationError”Error class thrown by assertValid() when validation fails.
class ValidationError { constructor(field: string, message: string, value?: unknown) field: string message: string value?: unknown}