Skip to main content

Custom Preset

The Custom Preset creates a full-featured microservice with all available AWS resources, perfect for complex applications.

Generated Resources

  • Lambda Functions - API and worker handlers
  • API Gateway - REST API endpoints
  • DynamoDB Table - Data persistence
  • SNS/SQS - Messaging services
  • S3 Bucket - File storage

Use Cases

Perfect for:

  • Complex business applications
  • Full-stack microservices
  • Services requiring multiple AWS resources
  • Custom architectural patterns

Architecture

A flexible template that lets you compose multiple resource bundles into a single service. Start minimal and add only what you need.

Generated resources

  • Lambda functions for API/worker roles (if selected)
  • API Gateway (optional) for REST endpoints
  • DynamoDB table(s) (optional)
  • SNS topics and SQS queues (optional)
  • S3 bucket(s) (optional)
  • IAM roles/policies and event source mappings as required

Usage

Generate a custom preset and choose components interactively or via flags:

nx g @mhshahzad/nx-cdk-deploy:preset --name=platform --preset=custom

Then deploy to an environment:

nx deploy platform --configuration=dev

Configuration

  • Toggle resources on/off (API, workers, DynamoDB, SNS/SQS, S3)
  • Set names, capacity, retention, and other params per environment
  • Define environment variables for handlers and APIs

Configure per environment via project config and .env.* files:

Extend with resource bundles

Add or evolve capabilities over time:

Patterns and tips

  • Start with the minimum set of resources, add bundles as needs grow
  • Prefer idempotent handlers and explicit DLQs
  • Use deterministic naming that includes the environment (e.g., platform-prod-data)
  • Tag all resources for cost, team, and environment