Skip to content

Infrastructure Intents Example

Demonstrates the full range of infrastructure intents in VentureKit.

Source: examples/infrastructure-intents/

  • Databases — PostgreSQL/MySQL with HA, backups, encryption
  • Storage — buckets for uploads, assets, backups with CDN
  • Auth — Cognito user pools with MFA and password policies
  • Queues — standard and FIFO queues with dead-letter queues
  • Caches — Redis/Memcached with clustering
  • Schedules — rate-based and cron-based scheduled tasks
  • Intent outputs — accessing provisioned resources in handlers
  • Multi-environment — dev (nano/relaxed) vs prod (medium/strict)
infrastructure: {
databases: [
{ id: 'main-db', type: 'postgres', size: 'small', name: 'app_main', highAvailability: true, backups: true },
],
storage: [
{ id: 'user-uploads', purpose: 'uploads', versioned: true },
{ id: 'public-assets', purpose: 'assets', cdn: true, corsOrigins: ['*'] },
],
auth: [
{ id: 'user-pool', signInWith: ['email'], allowSignUp: true, mfa: 'optional' },
],
queues: [
{ id: 'email-queue', type: 'standard', deadLetterQueue: true, retentionDays: 7 },
],
caches: [
{ id: 'session-cache', type: 'redis', size: 'small' },
],
schedules: [
{ id: 'cleanup-job', handler: 'src/jobs/cleanup.handler', schedule: { rate: '1 hour' } },
{ id: 'daily-report', handler: 'src/jobs/report.handler', schedule: { cron: '0 8 * * ? *' } },
],
}
const outputs = ctx.intentOutputs as IntentOutputs;
outputs.databases['main-db'].endpoint
outputs.storage['user-uploads'].bucketName
outputs.storage['public-assets'].cdnUrl
outputs.queues['email-queue'].queueUrl
outputs.caches['session-cache'].endpoint
outputs.auth['user-pool'].userPoolId
Terminal window
cd examples/infrastructure-intents
npm install
vk dev