All posts
AWS Amplify

Amplify Gen 2 Is CDK Underneath: How to Extend It, and When to Graduate to Plain CDK

By

October 25, 2026

5 min read

Amplify Gen 2 compiles TypeScript resource definitions into AWS CDK, so anything it does not model can be added as CDK in the same backend, and it can deploy from your own CI with ampx pipeline-deploy. When that is enough, and the signs a team should move the backend to a plain CDK app.

AWS Amplify
Amplify Gen 2
AWS CDK
Infrastructure as Code

Extending Gen 2

  • Add any AWS resource with CDK in backend.ts: queues, REST APIs, functions in other runtimes, Step Functions workflows.

  • Modify the resources Amplify generates (Cognito, AppSync, S3) through their underlying CDK constructs.

  • Deploy from your own pipeline with npx ampx pipeline-deploy instead of Amplify's build service.

  • Share secrets and environment variables per branch, or across all branches.

Want a second opinion on this for your system?

Book a free 30-minute call. You'll leave knowing what we'd do first and roughly what it costs, whether or not you hire us.

When to graduate

Signal

Why it matters

Most of backend.ts is custom CDK

Amplify's abstractions now cover a small part of what you deploy

Several teams and services share infrastructure

One Amplify backend per app does not fit a multi-service platform

Networking: VPCs, private databases, cross-account access

These are CDK territory, and easier to reason about in one CDK app

Non-TypeScript services or containers

Gen 2 is designed around TypeScript functions

Data patterns Gen 2 does not support, such as many-to-many

You will model around them in AppSync or move away from it

How to graduate without a rewrite

  1. Keep the Amplify client libraries and UI components; they work against existing Cognito, AppSync and S3 resources through configuration.

  2. Move new resources into a CDK app first, leaving the Amplify-managed ones in place.

  3. Import or recreate the Amplify-managed resources in CDK when convenient, starting with the least stateful, and keep user pools and tables in place rather than recreating them.

hoolco Monthly Review

Once a month: what changed in tech that month and what it means for you, from cloud and AI to security and the tools you build with. Every item links to its source. No sales pitch, unsubscribe in one click.

As of October 25, 2026. Provided as is, for general information, and accurate to the best of our knowledge on the date shown. Not legal, compliance, tax, financial or other professional advice. Prices, limits and vendor services change; check current vendor documentation before relying on anything here. Terms of use.