Encore, AWS SAM, SST, AWS CDK, Terraform and OpenTofu ranked for teams reconsidering serverless.yml after the V.4 license change

The best Serverless Framework alternative depends on how much of the stack you want to move: Encore if you want APIs, Pub/Sub, cron jobs and databases defined in application code and deployed as containers in your own AWS or GCP account, and AWS SAM if you want the closest drop-in for serverless.yml on Lambda. SST, AWS CDK, Terraform and OpenTofu cover the other cases below.
The Serverless Framework made Lambda approachable by turning a short serverless.yml into a CloudFormation stack, and many teams still have dozens of services built on it. Two things changed: V.4 is proprietary and the CLI requires a login or license key, and apps that grew around it hit Lambda limits that YAML cannot fix.
Reasons teams look for Serverless Framework alternatives:
resources section.Encore combines the application code and the infrastructure that serverless.yml describes separately, so the endpoints, topics, cron jobs and databases are declared in application code where they are used. encore run starts the services, databases and Pub/Sub locally, a deploy provisions them in your own AWS or GCP account, and cron jobs are managed by the Encore platform in deployed cloud environments.

A common Serverless Framework service is an HTTP function that drops a message on SNS, with a second function subscribed through an SQS queue. In Encore the publishing side is an API endpoint and a Pub/Sub topic in one service:
import { api } from "encore.dev/api";
import { Topic } from "encore.dev/pubsub";
export interface InvoicePaid {
invoiceId: string;
customerId: string;
}
// SNS/SQS on AWS, Pub/Sub on GCP, a local broker under encore run.
export const invoicePaid = new Topic<InvoicePaid>("invoice-paid", {
deliveryGuarantee: "at-least-once",
});
export const paid = api(
{ expose: true, method: "POST", path: "/billing/invoices/:invoiceId/paid" },
async (req: InvoicePaid): Promise<{ queued: boolean }> => {
await invoicePaid.publish(req);
return { queued: true };
},
);
The consumer is a subscription in a separate service, where concurrency and retries are set in code instead of in the event source mapping and the queue's redrive policy:
import { Subscription } from "encore.dev/pubsub";
import { invoicePaid } from "../billing/billing";
// A separate service that deploys and scales on its own. Retries back off,
// and messages that keep failing land in a dead-letter queue.
const _ = new Subscription(invoicePaid, "send-receipt", {
handler: async ({ invoiceId, customerId }) => {
// Keyed on invoiceId so a redelivery does not send a second receipt.
console.log("sending receipt", invoiceId, "to", customerId);
},
maxConcurrency: 20,
retryPolicy: { minBackoff: "1s", maxBackoff: "1m", maxRetries: 10 },
});
Under encore run, a request to POST /billing/invoices/inv_2/paid is expected to return {"queued":true} and the subscriber in the other service is expected to log the receipt, so the whole flow can be tested on your machine rather than against a deployed stage. Scheduled functions become cron jobs that call an endpoint on a schedule, and they run in the cloud environments rather than locally, where you call the endpoint by hand. The topic and its consumer are ordinary code, and an AI coding agent can add a new event and its handler in one change and run both locally.
Encore does not deploy Lambda functions, so it is a different runtime model rather than a new syntax for the same stack, and moving a service means porting the handlers to Encore endpoints and subscriptions. Teams usually start with one new service and leave existing Serverless Framework stacks running in the same account, and the migration guide for infrastructure-as-code users covers that path.
Run in your terminal to get started locally.
AWS SAM is AWS's open-source framework for serverless apps, a CloudFormation transform where a template.yaml describes functions, APIs and event sources in a format close to serverless.yml.
Transform: AWS::Serverless-2016-10-31
Resources:
SendReceipt:
Type: AWS::Serverless::Function
Properties:
CodeUri: .
Runtime: nodejs24.x
Handler: receipt.handler
Events:
InvoicePaid:
Type: SQS
Properties:
Queue: !GetAtt InvoiceQueue.Arn
InvoiceQueue:
Type: AWS::SQS::Queue
sam local invoke and sam local start-api run functions in local containers.sam deploy --guided walks through the first deploy and saves the settings.SAM keeps the Lambda-first model and the CloudFormation deploys, so it solves the license question rather than the architecture one. Local runs cover the function code, while queues, databases and other resources are either mocked or reached in a deployed stack.
SST defines resources in sst.config.ts through components for functions, APIs, queues, buckets, Postgres and frontend sites. From v3 it deploys through Pulumi with Terraform providers instead of CloudFormation.
sst dev deploys a stub function and proxies invocations to your machine, so code changes reload without a deploy.SST is a common move for TypeScript teams on the Serverless Framework, but the infrastructure is still described separately from the application code, and the queues and databases used during sst dev are real resources in your account. The SST alternatives guide covers it in more depth.
AWS CDK defines AWS resources as constructs in TypeScript, Python, Java, C# or Go and synthesizes them to CloudFormation, so a Serverless Framework stack can be rewritten as constructs for its functions, queues and API Gateway.
cdk diff shows the changes before a deploy.CDK removes the license question and the plugin layer, but you take on writing and reviewing every resource, including IAM, and there is no local runtime for the stack. The AWS CDK alternatives and AWS CDK vs Terraform guides compare it further.
Terraform manages Lambda functions alongside the rest of a company's infrastructure in HCL, and community modules such as terraform-aws-modules/lambda/aws handle packaging the code and creating the function, role and log group.
terraform plan shows changes before they are applied.Terraform is a good fit when the platform team already runs it, but it was not built for application code, so packaging, versioning and local testing of functions are handled outside it, and Terraform has been under the Business Source License since 2023. The Terraform alternatives guide covers the options.
OpenTofu is the open-source fork of Terraform maintained under the Linux Foundation, and it works with the same HCL, providers and Lambda modules.
OpenTofu answers the license concern on the Terraform side the way SAM does on the Serverless side, while the workflow stays the same, so Lambda packaging and local testing still sit outside the tool.
Verdict. Encore ranks first for teams moving past Lambda-only services, since the infrastructure comes from the same code as the endpoints and runs locally, and AWS SAM ranks second as the smallest step from serverless.yml. SST, AWS CDK, Terraform and OpenTofu follow for teams that want to keep describing infrastructure separately from the application.
The license change only affects V.4 and later, so there is time to move service by service, starting with the ones that have outgrown Lambda's limits. The quickstart walks through a first Encore service.
Encore if you want APIs, Pub/Sub and databases defined in application code, running locally and provisioned in your own AWS or GCP account as containers rather than Lambda functions. Cron jobs are declared in the same code and are managed by the Encore platform in deployed cloud environments. AWS SAM is the closest drop-in for serverless.yml, SST suits TypeScript teams that want live Lambda development, AWS CDK gives full control in code, and Terraform or OpenTofu fit teams that already manage the rest of their infrastructure with HCL.
Serverless Framework V.4 is proprietary, and the CLI requires a login or license key. V.3 stays open source but is no longer maintained as of December 31, 2024.
The Serverless Framework describes functions and events in serverless.yml and deploys them through CloudFormation. SST defines resources in sst.config.ts with TypeScript components built on Pulumi and Terraform providers, and sst dev proxies Lambda invocations to your machine so code changes reload without a deploy.
AWS SAM is AWS's own open-source framework, a CloudFormation extension with a free CLI that can run functions locally in containers with sam local. The Serverless Framework has a larger plugin ecosystem and its own Dev Mode, but V.4 is proprietary and the CLI requires a login or license key. Teams that only target AWS Lambda often find SAM the most direct replacement.
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.