Options for teams reconsidering serverless.yml after the V.4 license change, from AWS SAM and SST to defining the infrastructure in application code.
The Serverless Framework made AWS Lambda approachable by turning a short serverless.yml into a CloudFormation stack with functions, API Gateway routes and event sources. For years it was the default way to ship Lambda, and many teams still have dozens of services built on it.
Two things have changed since then. Serverless Framework V.4 requires a paid subscription for organizations over $2M in revenue, and apps that grew around it hit Lambda limits that a YAML file cannot fix, from 15-minute timeouts to connection limits on Postgres.
Reasons teams look for Serverless Framework alternatives:
serverless.yml deployed to a stage, region and account, so many services across many stages add up, and V.3 is no longer maintained as of December 31, 2024.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 TypeScript or Go where they are used. encore run starts them locally with your services, and a deploy provisions them in your own AWS or GCP account.

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 returns {"queued":true} and the subscriber in the other service logs the receipt, so the whole flow is 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. Since the topic and its consumer are ordinary code, 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. Since 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.
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, cron jobs and databases defined in application code, running locally and provisioned in your own AWS or GCP account as containers rather than Lambda functions. 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 free for individuals and organizations under $2M in annual revenue. Organizations that earned over $2M in their last fiscal year need a paid subscription, priced in credits per Service Instance, meaning one serverless.yml deployed to one stage, region and AWS account for more than 10 days in a month. 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 requires a login or license key and a subscription for larger organizations. Teams that only target AWS Lambda often find SAM the most direct replacement.
Declare a Topic with new Topic from encore.dev/pubsub, publish to it from an api endpoint, and handle messages in a Subscription with maxConcurrency and a retryPolicy. encore run runs the topic and subscriber locally, and a deploy to AWS provisions SNS and SQS with a dead-letter queue in your account.
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.