Updated Nov 12, 202614 min read

AWS CDK Alternatives in 2026

Six alternatives to AWS CDK, ranked, with current versions, the same orders service in CDK and Encore, and when each one is the better choice.

Illustration for AWS CDK Alternatives in 2026

The best AWS CDK alternative for a TypeScript or Go backend team is Encore, which takes the separate infrastructure app out of the picture: the Postgres databases, Pub/Sub topics, buckets, cron jobs and secrets are declared in the backend code, and Encore provisions them in your own AWS or GCP account, with no CloudFormation stack in between. If you want to keep a separate infrastructure program, Pulumi is the closest replacement for CDK without CloudFormation. Terraform or OpenTofu make sense when your team already runs HCL, SST fits Lambda-heavy AWS apps with a frontend, and AWS SAM or Serverless Framework fit small Lambda projects.

CDK made AWS infrastructure much nicer to write than raw CloudFormation, and the L2 constructs cover a lot of ground. The friction comes from CloudFormation underneath: every cdk deploy is a CloudFormation deployment, so you inherit its speed, its rollback behavior and its 500-resource limit per stack, which counts the IAM roles and log groups CDK adds for you as well as the resources you wrote. When a construct does not expose the property you need, you reach for node.defaultChild and addPropertyOverride. And the CDK app is a second codebase: the backend reads queue URLs and table names from environment variables that the stack has to pass in correctly.

Why are teams looking for AWS CDK alternatives?

  • Deploys are as slow as CloudFormation, and a failed update can roll back for a long time or get stuck in UPDATE_ROLLBACK_FAILED.
  • Large apps hit the 500-resource limit and have to be split into nested or separate stacks, with cross-stack references that are hard to change later.
  • CDK only targets AWS, so a team that also runs on GCP needs a second tool.
  • The infrastructure lives in its own app, so adding a queue means changing the stack, wiring IAM grants and environment variables, and then using the queue from the backend in another file or repository.
  • AI coding agents write the backend code well but have to edit two codebases and get the wiring between them right.

What are the best AWS CDK alternatives in 2026?

RankAlternativeLatest release (November 2026)ApproachBest fit
1Encorev1.58.8Infrastructure from code: resources declared in TypeScript or Go application code, provisioned in your AWS or GCP accountBackend teams that want the database, queue and bucket to ship with the code that uses them
2Pulumiv3.275.0Infrastructure as code in TypeScript, Python, Go, C#, Java or YAML, deployed by the Pulumi engine instead of CloudFormationTeams that like CDK's programming model but want multi-cloud and no CloudFormation
3Terraform / OpenTofuTerraform v1.17.2, OpenTofu v1.13.9Declarative HCL with a state file and a very large provider ecosystemTeams with existing Terraform modules or a platform team that owns them
4SSTv4.17.2A TypeScript config of higher-level components, deployed with Pulumi under the hoodAWS apps built around Lambda, containers and a web frontend
5AWS SAMSAM CLI v1.172.1CloudFormation templates with a serverless shorthand, plus local Lambda emulationSmall Lambda and API Gateway projects that want to stay on official AWS tooling
6Serverless Frameworkv4.46.0YAML config for Lambda functions, compiled to CloudFormationExisting Lambda projects already on Serverless Framework

The ranking is for application teams: the further down the list, the more infrastructure code you still write and maintain next to the backend. Release numbers are from each project's GitHub releases.

Compare features across all six alternatives
CapabilityEncorePulumiTerraform / OpenTofuSSTAWS SAMServerless Framework
Where infrastructure is definedIn the application codeSeparate programSeparate HCL filessst.config.tsTemplate YAMLserverless.yml
Deployment engineEncore platform, or your own pipeline with encore build dockerPulumi engineTerraform or OpenTofuPulumiCloudFormationCloudFormation
CloudsAWS and GCPAWS, GCP, Azure and many more providersAWS, GCP, Azure and many more providersAWS and Cloudflare components, plus Pulumi and Terraform providersAWSAWS
StateManaged by Encore for the resources it provisionsPulumi Cloud or a self-managed backendRemote state you store and lockStored in your accountCloudFormation stacksCloudFormation stacks
IAMEncore provisions an IAM role for the service, or a service account on GCPYou write grantsYou write policiesGenerated for linked resourcesYou write policies or use SAM policy templatesYou write statements
Local developmentencore run starts local Postgres, Pub/Sub, buckets and cachesNot includedNot includedsst dev runs functions live against AWSsam local runs Lambda in DockerPlugins or serverless dev
LicenseMPL-2.0Apache-2.0BSL 1.1 (Terraform), MPL-2.0 (OpenTofu)MITApache-2.0Free for organizations under $2M annual revenue, paid subscription above that

Why is Encore the top AWS CDK alternative?

Encore

Encore is infrastructure from code for TypeScript and Go. A CDK construct describes an AWS resource inside a separate app that synthesizes a CloudFormation template. An Encore declaration describes a resource the backend uses, in the file that uses it, and Encore works out the cloud resources, networking and IAM from that. There is no stack to synthesize, and nothing to pass from the stack to the application through environment variables.

Application code passes through Encore and infrastructure guardrails to resources provisioned in your own AWS or GCP account.
Encore provisions the infrastructure your application needs in your own AWS or GCP account.

Here is an orders service in CDK: a VPC, a Postgres instance, a queue with a dead-letter queue, a bucket and a Fargate service that gets their addresses and permissions passed in.

// lib/orders-stack.ts (aws-cdk-lib 2.276.0) import { Stack, StackProps, Duration } from "aws-cdk-lib"; import { Construct } from "constructs"; import * as ec2 from "aws-cdk-lib/aws-ec2"; import * as rds from "aws-cdk-lib/aws-rds"; import * as sqs from "aws-cdk-lib/aws-sqs"; import * as s3 from "aws-cdk-lib/aws-s3"; import * as ecs from "aws-cdk-lib/aws-ecs"; import * as ecsPatterns from "aws-cdk-lib/aws-ecs-patterns"; export class OrdersStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); const vpc = new ec2.Vpc(this, "Vpc", { maxAzs: 2 }); const db = new rds.DatabaseInstance(this, "OrdersDb", { engine: rds.DatabaseInstanceEngine.postgres({ version: rds.PostgresEngineVersion.VER_18_3, }), vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }, credentials: rds.Credentials.fromGeneratedSecret("orders_admin"), }); const dlq = new sqs.Queue(this, "OrderEventsDlq"); const queue = new sqs.Queue(this, "OrderEvents", { visibilityTimeout: Duration.seconds(60), deadLetterQueue: { queue: dlq, maxReceiveCount: 5 }, }); const receipts = new s3.Bucket(this, "Receipts", { blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL, }); const service = new ecsPatterns.ApplicationLoadBalancedFargateService(this, "Api", { cluster: new ecs.Cluster(this, "Cluster", { vpc }), taskImageOptions: { image: ecs.ContainerImage.fromAsset("../app"), environment: { DB_HOST: db.dbInstanceEndpointAddress, QUEUE_URL: queue.queueUrl, RECEIPTS_BUCKET: receipts.bucketName, }, secrets: { DB_SECRET: ecs.Secret.fromSecretsManager(db.secret!), }, }, }); db.connections.allowDefaultPortFrom(service.service); queue.grantSendMessages(service.taskDefinition.taskRole); queue.grantConsumeMessages(service.taskDefinition.taskRole); receipts.grantReadWrite(service.taskDefinition.taskRole); } }
The stack, before any application code. The backend then reads DB_HOST, QUEUE_URL and RECEIPTS_BUCKET from the environment, and an hourly job would need an EventBridge rule and a target on top.

The same service in Encore is the application code itself:

// orders/orders.ts (encore.dev 1.58) import { api } from "encore.dev/api"; import { SQLDatabase } from "encore.dev/storage/sqldb"; import { Topic, Subscription } from "encore.dev/pubsub"; import { Bucket } from "encore.dev/storage/objects"; import { CronJob } from "encore.dev/cron"; // Postgres: RDS in your AWS account, a local database on `encore run`. const db = new SQLDatabase("orders", { migrations: "./migrations" }); // SNS topic with an SQS queue per subscription, dead-letter queue included. export const orderPlaced = new Topic<{ orderId: string }>("order-placed", { deliveryGuarantee: "at-least-once", }); // S3 bucket; the service gets read/write access to this bucket only. const receipts = new Bucket("receipts", { versioned: false }); export const placeOrder = api( { method: "POST", path: "/orders", expose: true }, async ({ orderId }: { orderId: string }): Promise<void> => { await db.exec`INSERT INTO orders (id, status) VALUES (${orderId}, 'placed')`; await orderPlaced.publish({ orderId }); }, ); const _ = new Subscription(orderPlaced, "write-receipt", { handler: async ({ orderId }) => { await receipts.upload(`${orderId}.json`, Buffer.from(JSON.stringify({ orderId })), { contentType: "application/json", }); }, }); // Called on schedule by the Encore platform; no scheduler resource to define. export const expireUnpaid = api({}, async (): Promise<void> => { await db.exec` UPDATE orders SET status = 'expired' WHERE status = 'placed' AND created_at < NOW() - INTERVAL '1 day'`; }); const expire = new CronJob("expire-unpaid", { title: "Expire unpaid orders", every: "1h", endpoint: expireUnpaid, });
encore run starts the service with a local Postgres database, topic and bucket. A deploy to AWS creates RDS, SNS with SQS and a dead-letter queue, and S3 in your account.

On AWS, the Encore platform runs the service on Fargate or EKS in a VPC it creates per environment and puts the database in private subnets. Encore provisions an IAM role for the service, or a service account on GCP. The Encore platform runs the cron job on its schedule. Instance sizes, networking and backups are set per environment rather than in the code, and when the app is connected to GitHub, preview environments can give each pull request its own copy of the declared resources.

The same model applies when AI agents ship backend changes to your cloud. An agent that adds a bucket declares it next to the code that writes to it, runs it locally with encore run, and the deploy creates the bucket. Cloud access sits with Encore's IAM role, not the agent, and there is no second pull request against a CDK app to get right.

Key features

  • Postgres databases, Pub/Sub topics, object storage, caches, cron jobs and secrets declared in TypeScript or Go, with local versions started by encore run.
  • Provisioning in your own AWS or GCP account, with RDS or Aurora, SNS/SQS, S3, ElastiCache and Secrets Manager on AWS.
  • Encore provisions an IAM role for the service, or a service account on GCP, and a database role for each database the service uses.
  • Distributed tracing, a service catalog and architecture diagrams generated from the same code.
  • encore build docker produces a standard image if you would rather deploy it yourself.

What stays in CDK?

Encore does not read a CDK construct tree or adopt a CloudFormation stack. Encore's CDK migration guide suggests leaving account setup, VPCs, DNS, shared networking, custom resources and AWS services without an Encore primitive in CDK, and moving one service at a time. Existing RDS databases, S3 buckets and SNS topics can be connected to Encore declarations. Before handing a resource over, set its CDK removal policy to RETAIN, deploy, then remove the construct so CloudFormation stops managing it without deleting it.

Good to know

Encore covers backends written in TypeScript and Go and deploys to AWS and GCP. If most of your CDK code is account-level infrastructure, or you rely on services like Step Functions and DynamoDB, those stay in CDK and your backend calls them through the AWS SDK. Cron jobs do not run on their schedule locally or in preview environments, so you call the endpoint directly to test them.

See how infrastructure from code works in Encore.

Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

Is Pulumi the closest replacement for AWS CDK?

Pulumi

Yes, if you want to keep the CDK model of a separate infrastructure program in a general-purpose language. Pulumi programs are written in TypeScript, Python, Go, C#, Java or YAML, and the Pulumi engine calls the cloud providers directly, so there is no CloudFormation template and no 500-resource stack limit.

import * as aws from "@pulumi/aws"; const dlq = new aws.sqs.Queue("order-events-dlq"); const queue = new aws.sqs.Queue("order-events", { visibilityTimeoutSeconds: 60, redrivePolicy: dlq.arn.apply((arn) => JSON.stringify({ deadLetterTargetArn: arn, maxReceiveCount: 5 }), ), }); export const queueUrl = queue.url;

Pulumi works across AWS, GCP, Azure and Kubernetes, and CDK on Pulumi lets you reuse existing CDK constructs during a migration. The tradeoff is that state moves from CloudFormation to Pulumi Cloud or a backend you run, and the infrastructure is still a separate program from the backend that uses it.

Try Pulumi →

When are Terraform or OpenTofu a better choice than AWS CDK?

Terraform

When your organization already has Terraform modules, a platform team that owns them, or infrastructure across many providers. Terraform has been under the Business Source License since 2023, and OpenTofu is the MPL-2.0 fork run under the Linux Foundation. Both use HCL and a state file you store and lock yourself, usually in S3.

resource "aws_sqs_queue" "order_events_dlq" { name = "order-events-dlq" } resource "aws_sqs_queue" "order_events" { name = "order-events" visibility_timeout_seconds = 60 redrive_policy = jsonencode({ deadLetterTargetArn = aws_sqs_queue.order_events_dlq.arn maxReceiveCount = 5 }) }

If you were looking at CDK for Terraform as the middle ground, note that HashiCorp deprecated CDKTF on December 10, 2025 and archived the project. The Terraform alternatives guide covers the HCL side in more depth.

Try OpenTofu →

Is SST a good AWS CDK alternative?

SST

For AWS apps built around Lambda, containers and a web frontend, yes. Earlier versions of SST were built on CDK, but current SST uses Pulumi behind the scenes and defines the whole app in one sst.config.ts with components like sst.aws.Postgres, sst.aws.Bucket and sst.aws.Cron. link passes resources to your functions and services, and sst dev runs functions live against real AWS resources.

const bucket = new sst.aws.Bucket("Receipts"); new sst.aws.Function("PlaceOrder", { handler: "src/orders.handler", link: [bucket], url: true, });

SST is strongest for frontends such as Next.js plus serverless backends on AWS. The infrastructure is still a config file next to the app rather than part of the backend code, and you write the VPC and component settings yourself. Our SST alternatives guide compares it in more detail.

Try SST →

When does AWS SAM make sense instead?

AWS SAM

AWS SAM is AWS's own shorthand for serverless CloudFormation. A SAM template expands AWS::Serverless::Function and friends into full CloudFormation, and the SAM CLI runs Lambda functions and API Gateway locally in Docker.

Transform: AWS::Serverless-2016-10-31 Resources: PlaceOrder: Type: AWS::Serverless::Function Properties: Handler: orders.handler Runtime: nodejs22.x Events: Api: Type: HttpApi Properties: Path: /orders Method: post

SAM is a good fit for a handful of functions where official AWS tooling matters more than ergonomics. It is still CloudFormation, so it has the same deploy behavior and limits as CDK, and anything beyond functions and APIs is plain CloudFormation YAML.

Try AWS SAM →

Is Serverless Framework still worth it?

Serverless Framework

Serverless Framework predates CDK and describes Lambda functions and their events in serverless.yml, which it compiles to CloudFormation. From version 4, the CLI is free for individuals and organizations under $2M in annual revenue, and larger organizations need a paid subscription. Version 3 remains open source but is no longer maintained.

It makes sense for teams that already have Lambda services on it and are not feeling pain. For a new project, SAM, SST or one of the options above are easier to justify.

Try Serverless Framework →

Which AWS CDK alternative should you pick?

Question 1

Do you want the database, queue and bucket declared in the backend code instead of a separate infrastructure app?

Yes →
EncoreInfrastructure from code, provisioned in your own AWS or GCP account
Question 2

Do you want to keep a separate infrastructure program in TypeScript, Python or Go, without CloudFormation?

Yes →
PulumiSame programming model as CDK, multi-cloud
Question 3

Do you already have Terraform modules or a platform team that owns HCL?

Yes →
TerraformOr OpenTofu for an MPL-2.0 license
Question 4

Is the app mostly Lambda functions and a web frontend on AWS?

Yes →
SSTComponents and live Lambda development
Question 5

Is it a handful of Lambda functions and you want official AWS tooling?

Yes →
AWS SAMServerless shorthand for CloudFormation
Question 6

Are you AWS only and not hitting CloudFormation's limits?

Yes →
AWS CDKStay on CDK
  • Encore when the infrastructure exists to serve a TypeScript or Go backend and you want it declared in that backend, deployed to your own AWS or GCP account.
  • Pulumi when you want CDK's programming model without CloudFormation, or need Azure and other providers.
  • Terraform or OpenTofu when HCL and existing modules are already how your organization works.
  • SST for AWS apps built on Lambda and a frontend framework.
  • AWS SAM for small Lambda projects on official AWS tooling.
  • Serverless Framework only if you are already on it.

Verdict. If you are leaving CDK because of CloudFormation but want to keep writing infrastructure as a separate program, Pulumi is the most direct move. If the problem is that every backend change needs a matching change in a second codebase, Encore ranks first, because the database, topic, bucket and cron job are declared in the code that uses them and Encore provisions them in your account. CDK can keep the VPCs, DNS and shared resources while you move one service at a time. Start with the quickstart to see what encore run gives you locally.

Frequently asked questions

What is the best alternative to AWS CDK?

For TypeScript and Go backend teams, Encore is the best AWS CDK alternative: you declare the Postgres databases, Pub/Sub topics, buckets, caches, cron jobs and secrets in the application, and Encore provisions them in your own AWS or GCP account without a separate CDK app or CloudFormation stack. Pulumi is the closest like-for-like replacement if you want to keep a separate infrastructure program in TypeScript, Python or Go without CloudFormation. Terraform or OpenTofu fit teams with existing HCL, SST fits AWS apps built around Lambda and frontends, and AWS SAM fits small Lambda projects.

Why do teams move away from AWS CDK?

The common reasons are CloudFormation underneath CDK: slow deploys, rollbacks that can leave a stack in UPDATE_ROLLBACK_FAILED, the 500-resource limit per stack, and escape hatches when an L2 construct does not expose a property. CDK is also AWS only, and the infrastructure lives in a separate app that has to be kept in step with the backend code that uses it.

Is CDK for Terraform (CDKTF) still an option?

No. HashiCorp deprecated CDK for Terraform on December 10, 2025 and archived the repository, so it gets no fixes or compatibility updates. HashiCorp recommends exporting projects with cdktf synth --hcl and continuing with Terraform HCL.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders