
Backend toolkit for composing self-contained backend capabilities that bundle app code, local dev environment, and cloud infrastructure; run locally without a cloud account and deploy unchanged.
AWS CDK Blocks is a backend toolkit for building full-stack applications on AWS. Each Block is a self-contained backend capability that bundles your application code, a local development setup, and the infrastructure to run it. Pick the Blocks you need and compose them; AWS CDK Blocks generates the AWS infrastructure (CDK constructs) for them. Your entire application runs locally without an AWS account — when you're ready, deploy the same code to AWS without changing it.
For an overview, see the AWS CDK Blocks Developer Guide. For the Block catalog and APIs at this revision, see the Blocks README.
Requires Node.js 22 or later and npm 10 or later.
npm create @aws-cdk-blocks/blocks-app@latest my-app
cd my-app
npm install
npm run devnpm run dev starts a local development server at http://localhost:3000 with every Block running a local implementation. Define your backend in cdk-blocks/index.ts and your frontend in src/; types flow end to end with no code generation step.
npm run docs lists Building Blocks, npm run docs KVStore opens a block’s guide, and npm run help lists tasks.--template <name>. npx @aws-cdk-blocks/create-blocks-app --help lists the templates and describes each.auth template was formerly named auth-cognito; the old name still works..) to add a cdk-blocks/ backend to it. The CLI auto-detects an AWS Amplify Gen 2 project and integrates with it.For a full walkthrough, see Getting started with AWS CDK Blocks.
AWS CDK Blocks uses Node.js conditional exports to load different code for each context:
The same new KVStore(scope, 'todos') line becomes a local store in development, an Amazon DynamoDB table at deploy time, and SDK calls in production.
Each Block is published as an npm package, and the umbrella package aws-cdk-blocks re-exports every Block plus the core runtime.
| Category | Blocks |
|---|---|
| Data & storage |
KVStore, Database, FileBucket
|
| Authentication |
Auth (email + password, social, OIDC and SAML in one block) |
| Compute & background |
Compute, AsyncJob, CronJob
|
| AI |
Agent, KnowledgeBase
|
| Communication |
Realtime, EmailClient
|
| Configuration |
AppSetting, Secret
|
| Observability |
Logger, Metrics, Tracer, Dashboard
|
| Hosting | Hosting |
Clients are typed from your backend: web frameworks (Next.js, Nuxt, Astro, React, Vue, Svelte, Angular), native mobile (Swift, Kotlin, Dart/Flutter), and desktop applications.
Native clients are build-time code generators that produce type-safe client code from a Blocks spec (blocks.spec.json), paired with a runtime library that calls your backend over JSON-RPC:
cdk-blocks/
├── packages/ # Blocks, the core runtime, and the create-blocks-app CLI (published to npm)
├── native/ # Native client SDKs (Kotlin, Swift, Dart)
├── test-apps/ # Example applications and end-to-end tests
├── test-infra/ # Persistent CI infrastructure (test VPCs, GitHub OIDC roles)
├── tasks/ # Agent benchmark tasks
├── docs/ # Contributor guides, design documents, and decisions
└── scripts/ # Repository tooling and automation
Requires Node.js 22 or later and npm 10 or later.
npm install
npm run build
npm testSee CONTRIBUTING.md for how to report issues and send pull requests. Coding agents start with AGENTS.md.
Apache-2.0
AWS CDK Blocks is a backend toolkit for building full-stack applications on AWS. Each Block is a self-contained backend capability that bundles your application code, a local development setup, and the infrastructure to run it. Pick the Blocks you need and compose them; AWS CDK Blocks generates the AWS infrastructure (CDK constructs) for them. Your entire application runs locally without an AWS account — when you're ready, deploy the same code to AWS without changing it.
For an overview, see the AWS CDK Blocks Developer Guide. For the Block catalog and APIs at this revision, see the Blocks README.
Requires Node.js 22 or later and npm 10 or later.
npm create @aws-cdk-blocks/blocks-app@latest my-app
cd my-app
npm install
npm run devnpm run dev starts a local development server at http://localhost:3000 with every Block running a local implementation. Define your backend in cdk-blocks/index.ts and your frontend in src/; types flow end to end with no code generation step.
npm run docs lists Building Blocks, npm run docs KVStore opens a block’s guide, and npm run help lists tasks.--template <name>. npx @aws-cdk-blocks/create-blocks-app --help lists the templates and describes each.auth template was formerly named auth-cognito; the old name still works..) to add a cdk-blocks/ backend to it. The CLI auto-detects an AWS Amplify Gen 2 project and integrates with it.For a full walkthrough, see Getting started with AWS CDK Blocks.
AWS CDK Blocks uses Node.js conditional exports to load different code for each context:
The same new KVStore(scope, 'todos') line becomes a local store in development, an Amazon DynamoDB table at deploy time, and SDK calls in production.
Each Block is published as an npm package, and the umbrella package aws-cdk-blocks re-exports every Block plus the core runtime.
| Category | Blocks |
|---|---|
| Data & storage |
KVStore, Database, FileBucket
|
| Authentication |
Auth (email + password, social, OIDC and SAML in one block) |
| Compute & background |
Compute, AsyncJob, CronJob
|
| AI |
Agent, KnowledgeBase
|
| Communication |
Realtime, EmailClient
|
| Configuration |
AppSetting, Secret
|
| Observability |
Logger, Metrics, Tracer, Dashboard
|
| Hosting | Hosting |
Clients are typed from your backend: web frameworks (Next.js, Nuxt, Astro, React, Vue, Svelte, Angular), native mobile (Swift, Kotlin, Dart/Flutter), and desktop applications.
Native clients are build-time code generators that produce type-safe client code from a Blocks spec (blocks.spec.json), paired with a runtime library that calls your backend over JSON-RPC:
cdk-blocks/
├── packages/ # Blocks, the core runtime, and the create-blocks-app CLI (published to npm)
├── native/ # Native client SDKs (Kotlin, Swift, Dart)
├── test-apps/ # Example applications and end-to-end tests
├── test-infra/ # Persistent CI infrastructure (test VPCs, GitHub OIDC roles)
├── tasks/ # Agent benchmark tasks
├── docs/ # Contributor guides, design documents, and decisions
└── scripts/ # Repository tooling and automation
Requires Node.js 22 or later and npm 10 or later.
npm install
npm run build
npm testSee CONTRIBUTING.md for how to report issues and send pull requests. Coding agents start with AGENTS.md.
Apache-2.0