Fact-checked by Grok 2 weeks ago

Serverless Framework

The Serverless Framework is an open-source command-line interface (CLI) tool designed to simplify the building, deployment, and management of serverless applications on cloud platforms, primarily using managed services like AWS Lambda, API Gateway, and DynamoDB, while supporting multiple programming languages including Node.js, Python, Java, Go, and others. It allows developers to define infrastructure and code in a declarative YAML configuration file, enabling auto-scaling, pay-per-use pricing, and minimal operational overhead without managing servers. The framework originated in late 2014, shortly after the launch of AWS Lambda, as an early solution to streamline serverless deployments, and was formally developed into a project by Serverless Inc. in 2015 under founder Austen Collins. Headquartered in San Anselmo, California, Serverless Inc. has evolved the tool from purely open-source roots (under the MIT license) to include SaaS components and a paid licensing model for organizations with over $2 million in annual revenue starting with version 4, which became generally available in June 2024 and introduced enhancements like native TypeScript support, custom domain management, and integration with emerging frameworks such as the AWS AI Stack. Key components of the Serverless Framework include its core CLI for local development and deployment, an optional web-based Dashboard for monitoring and collaboration, and an extensible plugin ecosystem exceeding 1,000 contributions for tasks like custom resource provisioning and CI/CD integration. While AWS remains the primary supported provider through native integration with AWS CloudFormation and SAM, the framework increasingly accommodates other clouds like Google Cloud Run and Azure Functions, promoting portability across serverless environments. Its lifecycle management covers the full application stack, from event-driven architectures to offline simulation, reducing the complexity of provisioning resources like functions, APIs, and databases. Widely adopted by enterprises, the Serverless Framework powers serverless initiatives at organizations including The New York Times, Nike, Electronic Arts, and Nordstrom, facilitating scalable microservices for personalization, e-commerce, and real-time data processing. As of 2025, it remains a cornerstone for serverless development, with ongoing updates—including releases up to version 4.23.0 in August 2025—emphasizing innovation in areas like containerization and AI-driven workflows, while maintaining backward compatibility to support legacy deployments.

History

Founding and Early Development

The Serverless Framework was founded by Austen Collins in 2014 as an open-source project, shortly after the launch of at AWS re:Invent that year. Collins, an early enthusiast of Lambda's event-driven, auto-scaling compute model, began developing the as a personal side project to address the challenges of building and deploying full applications on the nascent serverless platform. At the time, lacked mature tooling for orchestration, leading developers to manually configure services like API Gateway and DynamoDB, which complicated even simple deployments. Initially named (standing for JavaScript AWS Services), the project focused on simplifying deployments for applications on , enabling developers to define functions, events, and resources in a single configuration file rather than scripting infrastructure piecemeal. This approach aimed to abstract away the operational overhead of , allowing teams to prioritize over tasks. By mid-2015, JAWS integrated support for API Gateway, which had entered general availability in July, marking a key milestone in enabling RESTful APIs without traditional servers. The GitHub repository for JAWS launched in 2015, quickly gaining community interest through developer forums and early adopters experimenting with serverless prototypes. As adoption grew, the project was recognized as the first dedicated framework for constructing complete applications on AWS Lambda, filling a critical gap in the ecosystem where only basic function deployment tools existed. In late 2015, due to trademark conflicts with an existing screen reader software, Collins rebranded it to the Serverless Framework to more accurately encompass the emerging serverless computing paradigm, a term popularized by AWS executives. This transition solidified its identity and set the stage for broader contributions leading to its first stable release.

Major Releases and Evolution

The Serverless Framework reached its first stable release, version 1.0, on October 12, 2016, marking the exit from beta after five months of public testing and establishing it as a production-ready tool for deploying serverless applications primarily on AWS Lambda using CloudFormation. This milestone coincided with the announcement of a $3 million seed funding round led by Trinity Ventures, which supported further development and team expansion. Support for multiple cloud providers began emerging shortly after the v1 release, with initial integrations for Google Cloud Functions added in version 1.14 in May 2017, followed by Azure Functions support in version 1.8 in February 2017, enabling deployments across AWS, Google Cloud, and Azure and reducing vendor lock-in for developers. Subsequent updates in 2020, often referred to as the v2 era, included deprecations for outdated Node.js versions to enhance security and performance, alongside refinements to HTTP API and Lambda integrations that built on the multi-provider foundation. Version 3, released on January 27, 2022, introduced significant enhancements to the plugin architecture, ensuring for existing plugins while categorizing them for easier upgrades, and a redesigned (CLI) that reduced package size by 40% for faster performance and more actionable output, including improved error handling and verbose logging options suitable for environments. The framework's v4 release in May 2024 emphasized adoption, incorporating features such as mandatory authentication via the Serverless or license keys for secure deployments, integration with modern pipelines through AWS SSM Store for key management, and enhanced compatibility with tools like for infrastructure workflows. These changes aligned with a shift to a open-source model, where the core CLI remains for organizations under $2 million in annual revenue, but tiers introduce paid credits starting at $49 per month for larger entities, covering advanced , unlimited instances, and priority support. Serverless Inc., the company behind the framework, launched its SaaS Dashboard in 2019 as a complementary tool for monitoring deployments, managing secrets, and providing across providers, with ongoing partnerships including AWS Marketplace listings to facilitate enterprise procurement. As of 2025, the open-source repository continues active maintenance on , with regular updates to v4 addressing patches, plugin integrations like uv for dependencies, and support for newer AWS SDK versions, while v3 received only critical fixes until early 2025, after which it is no longer maintained. This evolution reflects a maturation from a purely community-driven to a commercially sustainable ecosystem balancing open-source accessibility with enterprise-grade capabilities.

Overview

Definition and Purpose

The Serverless Framework is an open-source command-line interface (CLI) tool and framework for defining, deploying, and managing serverless applications on cloud platforms. It employs YAML configuration files, known as serverless.yml, to declaratively specify both application code and the required infrastructure resources, such as functions and event triggers. This approach enables developers to build auto-scaling applications using managed services like AWS Lambda, Google Cloud Functions, and Azure Functions, without directly managing underlying servers. The primary purpose of the Serverless Framework is to abstract the complexities of cloud infrastructure provisioning and orchestration, allowing developers to focus on business logic and code rather than operational details. It automates the handling of resources including serverless functions, APIs, databases, and storage, streamlining the process of creating event-driven, scalable architectures across multiple providers. By providing a unified interface for these tasks, it empowers developers to innovate faster while minimizing infrastructure management efforts. Key benefits of the Serverless Framework include significantly reduced operational overhead through automated deployments and , pay-per-use that eliminates idle resource costs, faster time-to-market with simplified integration, and portability that supports seamless migration or multi-cloud strategies without . These advantages make it particularly valuable for building low-maintenance applications that dynamically based on demand. In distinction from broader concepts, which refer to the execution model where cloud providers manage environments, the Serverless Framework functions specifically as a deployment and management framework, handling and orchestration but not serving as the execution itself.

Core Components

The Serverless Framework revolves around the serverless.yml file, a YAML-based that serves as the central declaration for defining services, functions, events, and associated infrastructure resources. This file enables developers to specify deployment details in a human-readable , abstracting away much of the involved in provisioning resources. By encapsulating all necessary configurations in one place, serverless.yml facilitates consistent and repeatable deployments across environments, supporting the framework's goal of simplifying serverless application development. At the heart of any Serverless Framework project is the service concept, which represents a logical grouping of one or more functions along with their required infrastructure, such as databases or API gateways. A service is defined by its name in the serverless.yml file and acts as a deployable unit, often corresponding to a specific application module or workflow, allowing for organized management of related components. Services support versioning through the frameworkVersion attribute, adhering to semantic versioning principles to ensure compatibility during updates, and they can be deployed to different stages (e.g., development or production) for isolated testing and rollout. This structure promotes scalability by enabling independent evolution of services within larger applications. Individual functions form the executable core of a service, consisting of discrete code snippets designed to handle specific tasks in response to triggers. Each function is configured in the serverless.yml under the functions section, specifying a handler—the entry point in the code (e.g., a JavaScript module export)—and a runtime environment, such as Node.js or Python, which can be inherited from the provider or overridden per function. Functions are event-driven, meaning they execute only when invoked by defined triggers like HTTP requests or message queues, optimizing resource usage in serverless architectures. This modular approach allows developers to build fine-grained, scalable applications where each function operates independently. The provider block in serverless.yml delineates the target cloud platform and associated credentials, ensuring that deployments align with the chosen infrastructure. For instance, when targeting AWS, it includes attributes like the region, stage, runtime defaults, and IAM roles, which the framework uses to generate underlying resources such as CloudFormation templates. This configuration centralizes platform-specific settings, allowing seamless integration with services like AWS Lambda while abstracting credential management through environment variables or profiles. By specifying the provider early, the framework can validate and tailor the deployment process accordingly. Plugins enhance the framework's extensibility by serving as modular JavaScript modules that hook into the core lifecycle, enabling custom behaviors without altering the base code. Installed per service via npm and declared in the plugins array of serverless.yml, they execute in a defined order to modify stages like packaging or deployment. This system supports a rich ecosystem of community-contributed extensions for tasks such as optimization or integration with third-party tools, making the framework adaptable to diverse workflows. During deployment, plugins integrate with the service's components to extend functionality as needed.

Architecture

Configuration Model

The Serverless Framework employs a declarative YAML configuration file named serverless.yml to define services, infrastructure, and deployment parameters in a structured manner. This file serves as the central artifact for specifying the application's architecture, enabling users to model serverless resources without directly managing underlying cloud provider APIs. The configuration is parsed by the Framework's CLI to generate deployment artifacts, such as AWS CloudFormation templates, ensuring consistency across environments. The top-level structure of serverless.yml includes several key sections. The service section declares the name of the service, which prefixes resources and organizes deployments (e.g., service: myService). The provider section configures cloud-specific settings, such as the provider name (name: aws), deployment stage (stage: dev), region (region: us-east-1), and AWS profile (profile: default). Within provider, environment variables are defined under the environment key as a map of key-value pairs (e.g., environment: APP_VAR: "value"), which are injected into Lambda function executions at runtime. IAM role specifications occur in the same block via the iam subsection, where users can reference an existing role ARN (role: arn:aws:iam::123456789012:role/my-role) or define custom permissions using role.statements as an array of policy statements (e.g., allowing S3 access). The functions section outlines individual Lambda functions, each with a name, handler path (e.g., handler: handler.hello), runtime, and memory/timeout settings. The resources section embeds templates in format for custom infrastructure, such as defining a DynamoDB table with properties like TableName and AttributeDefinitions. Finally, the custom section allows for plugin extensions and stage-specific parameters (e.g., custom: myCustomVar: ${env:MY_VAR}). Event sources, or triggers, are configured within the events array under each function in the functions section, mapping external stimuli to Lambda invocations. For HTTP APIs, the httpApi or legacy http event specifies methods and paths (e.g., events: - httpApi: method: get path: /users/{id}), integrating with AWS API Gateway. S3 events trigger on bucket activities like object creation (events: - s3: bucket: my-bucket event: s3:ObjectCreated:*), while scheduled tasks use the schedule event with rate expressions (e.g., rate: rate(5 minutes)) or cron syntax (e.g., enabled: true cron: 0 12 * * ? *). These configurations abstract provider-specific details, allowing the Framework to generate the necessary permissions and integrations automatically. To define custom infrastructure beyond standard resources, the resources section utilizes syntax embedded directly in , enabling declarations like additional S3 buckets or VPC configurations. For instance, a simple S3 bucket might be specified as:
yaml
resources:
  Resources:
    MyBucket:
      Type: AWS::S3::Bucket
      Properties:
        BucketName: my-unique-bucket-name
This approach merges user-defined templates with those auto-generated by the Framework, providing flexibility for complex setups while maintaining idempotent deployments. Configuration integrity is enforced through built-in validation using the AJV JSON-schema validator, which checks serverless.yml against predefined schemas during CLI operations like serverless deploy. The configValidationMode option controls behavior: error halts execution on failures, warn logs issues but proceeds (default), and off disables checks. This integration detects syntax errors, missing required fields, and schema violations early, reducing deployment risks; for CloudFormation-specific linting in the resources section, users can leverage external tools like cfn-lint in pipelines, though it is not natively embedded. Best practices include using variable resolution (e.g., ${env:VAR}) for secrets, organizing large files with includes, and testing configurations in isolated stages to ensure portability across environments.

Deployment Workflow

The deployment workflow in the Serverless Framework revolves around its (CLI), which orchestrates the building, packaging, and deployment of serverless applications to cloud providers like AWS. The process begins with packaging the application artifacts, followed by deployment using infrastructure-as-code templates, and supports cleanup and operations for . This leverages the framework's , such as serverless.yml, to define resources declaratively, ensuring reproducible deployments across environments. Packaging prepares the application for deployment by bundling code, resolving dependencies, and generating necessary artifacts without immediately pushing to the cloud. The sls package command zips the service code into deployment-ready artifacts, stored by default in a .serverless directory, while automatically excluding development dependencies based on the runtime (e.g., Node.js dev packages) to optimize bundle size. Users can customize inclusion/exclusion patterns via the configuration (e.g., excluding node_modules subdirectories except specific ones) and specify custom output paths with --package my-artifacts for integration into pipelines. For AWS, this step also prepares CloudFormation templates by resolving parameters and ensuring AWS credentials are available for accessing S3 deployment buckets and SSM Parameter Store, making artifacts ready for upload. Full deployment is executed via the sls deploy command, which invokes CloudFormation to provision or update the entire , including functions, Gateway resources, and other dependencies defined in the . This command first runs if needed, uploads zipped to an S3 , and applies the generated CloudFormation template atomically—meaning the update either succeeds fully or rolls back to the previous stable state if errors occur, preventing partial deployments. For faster iterations, sls deploy [function](/page/Function) --[function](/page/Function) myFunction updates only a specific by overwriting its S3 zip without a full update. To manage multiple environments, the --[stage](/page/The_Stage) flag isolates resources (e.g., sls deploy --[stage](/page/The_Stage) dev for development or --[stage](/page/The_Stage) prod for production), creating separate CloudFormation stacks and S3 buckets per to avoid interference. Cleanup is handled by the sls remove command, which deletes the deployed service and associated resources from the provider, including the CloudFormation stack and S3 artifacts, based on the current configuration and stage. For reversibility, the sls rollback command reverts to a previous deployment version listed via sls deploy list, restoring function code and stack state from S3-stored snapshots; this integrates with CloudFormation's native rollback on failure for emergency recovery. Advanced atomicity can be enhanced with provider-specific features, such as AWS CodeDeploy for canary or blue/green deployments, where aliases and deployment groups manage traffic shifts and automatic rollbacks on errors. The integrates seamlessly with pipelines for , allowing tools like Actions or Jenkins to packaging and deployment steps via CLI commands in scripts. For instance, a Actions can run sls package followed by sls deploy --stage staging on pull requests, promoting to on merges, while Jenkins pipelines can incorporate these for build verification and environment-specific deployments. This setup ensures consistent, version-controlled releases without manual intervention.

Features

Plugins and Extensibility

The Serverless Framework's plugin system enables extensibility by allowing developers to integrate custom JavaScript code that hooks into predefined lifecycle events, such as before:deploy for pre-deployment validations or after:package for post-packaging optimizations. These events correspond to stages in core commands like deploy or package, enabling plugins to inject logic without altering the framework's core behavior. Plugins are structured as classes extending the base Serverless class, receiving the service configuration and options in their constructor for seamless interaction with the framework's internal state. In Serverless Framework v4 (generally available since 2024), plugins have been integrated more deeply into for improved reliability, with for the over 1,000 community-maintained plugins, including new resolvers like Git integration for better extensibility. plugins, maintained by the Serverless , provide utilities for needs; for instance, serverless-offline simulates and Gateway environments locally to facilitate testing without cloud deployments. While v4 introduces native bundling with esbuild for and functions, plugins like serverless-webpack remain available for custom bundling configurations when opting out of the default build process. These plugins are installed per service via and registered in the serverless.yml file under the plugins array, ensuring they load after core plugins in the specified order. Creating custom plugins involves implementing a JavaScript class that registers commands and hooks using the framework's API. Developers define commands by specifying lifecycle events in an object, such as { 'before:deploy:initialize': this.beforeDeployInitialize }, where methods like beforeDeployInitialize execute custom logic, accessing the serverless instance for configuration manipulation or logging. Plugins can also extend CLI commands, for example by adding serverless my-command, and support local development by loading from relative paths like ./custom-plugin. Distribution typically occurs via npm, with the plugin package including a serverless.yml example for users. The Serverless Framework maintains a community-driven registry featuring over 1,000 plugins as of 2025, covering diverse tasks including code optimization through tools like serverless-bundle and security enhancements via plugins such as serverless-iam-roles-per-function that enforce least-privilege access controls. Plugins are discovered through the official marketplace at serverless.com/plugins or GitHub repositories, with installation simplified by the CLI command serverless plugin install -n <plugin-name>. Best practices for plugin development emphasize versioning compatibility by listing the Serverless Framework in the peerDependencies section of package.json, ensuring the plugin activates only with supported framework versions and preventing runtime errors during upgrades. Developers should prioritize build-time plugins by setting a high priority value in the plugin's commands to execute early in the lifecycle, and test across framework versions using tools like serverless invoke local to maintain backward compatibility. Additionally, plugins should document custom configurations in the custom section of serverless.yml and avoid global installations to isolate service-specific extensions.

Lifecycle Management

The Serverless Framework provides built-in command-line tools to manage the lifecycle of serverless applications from deployment through ongoing operations, developers to , , troubleshoot, and maintain resources efficiently without relying on external plugins for core functionality. These tools integrate directly with cloud provider services, such as AWS CloudWatch for logs and metrics, to oversight and iterative improvements. In v4, the revamped Dev Mode enhances local development by proxying live AWS Lambda events to local code via the CLI, providing instant feedback, logs, and accurate testing without full deployments, streamlining the development lifecycle. Monitoring centers on the sls logs command, which tails function logs from the provider's logging service, such as AWS CloudWatch Logs, allowing developers to view recent invocations, errors, and execution details in real time. For example, running serverless logs -f myFunction streams logs for a specific function, facilitating quick identification of runtime issues. Additionally, metrics like invocation counts, durations, and error rates are accessible via the provider's console, such as the AWS CloudWatch dashboard, providing aggregated performance data without additional configuration. Updating deployments supports incremental changes through targeted commands, minimizing and . The sls deploy --function option deploys only the specified and its dependencies, efficient updates to components rather than the entire . For instance, serverless deploy function -f myFunction updates and for that alone, which is particularly useful in large services to reduce deployment times and costs. This builds on the initial deployment workflow by allowing iterative refinements post-launch. Troubleshooting is aided by commands that inspect deployed resources and configurations. The sls info command outputs a summary of service resources, including ARNs, endpoints, and regions, helping verify deployment status and dependencies. Similarly, sls print generates and displays the CloudFormation template used for deployment, enabling review of the infrastructure as code for debugging misconfigurations. These tools provide a snapshot of the application's state, essential for diagnosing issues like permission errors or resource mismatches. For enhanced , the integrates with tracing services to capture performance data across function invocations. AWS can be enabled via the serverless.yml under the provider , such as tracing: [lambda](/page/Lambda): true and apiGateway: true, which automatically instruments functions and API Gateway for distributed tracing, revealing latency bottlenecks and error paths. This core allows of request flows in the AWS console without . Integrations with third-party tools like extend this by collecting traces and metrics for unified dashboards, though setup follows provider-specific guidelines. Versioning ensures safe rollbacks and testing by automatically publishing a new immutable version of each function on every deployment, configurable via versionFunctions: true in the provider settings. This creates a history of changes, with the latest version aliased to $LATEST for production use, helping manage costs by avoiding overwrites of working code. However, old versions are not automatically pruned to prevent accidental deletions of potentially useful snapshots; developers must implement periodic cleanup using external tools to control storage expenses, as AWS charges for unpublished versions.

Supported Platforms

Cloud Providers

The Serverless Framework provides primary and robust support for Amazon Web Services (AWS), enabling seamless deployment of serverless applications using AWS Lambda as the core compute service. It integrates fully with AWS services such as Lambda for function execution, API Gateway for HTTP endpoints and event routing, and DynamoDB for NoSQL database operations, all orchestrated through AWS CloudFormation for infrastructure as code provisioning. The framework translates the serverless.yml configuration file into CloudFormation templates, automatically creating or updating stacks, uploading function artifacts to S3 buckets, and managing resources like IAM roles and security groups, which simplifies scaling and reduces operational overhead. Setup involves configuring the AWS provider in serverless.yml with details like region and stage, followed by running serverless deploy to handle the full workflow, though considerations include ensuring sufficient IAM permissions for SSM and S3 access to avoid deployment failures. Support for Google Cloud Functions was available through the serverless-google-cloudfunctions plugin, allowing configuration of event triggers such as HTTP requests or Pub/Sub messaging for reactive applications. This integration focused on deploying functions to Google Cloud's serverless compute platform but had limitations, including experimental status for advanced features and incompatibility with Cloud Functions v2, restricting it to basic deployments without full parity to native Google tools. Unique considerations included Docker-based builds for consistent environments and manual handling of dependencies not natively supported by Google Cloud. The framework also supported Functions via the serverless-azure-functions plugin, facilitating deployments to consumption-based plans that automatically scale with and integrating with for blobs, queues, and tables as event sources. The of the plugin extended to hosting, , and runtimes, broader beyond Windows-centric defaults. setup steps required an subscription and service principal for , with considerations around group to manage costs and avoid cross-tenant conflicts in multi-tenant environments. For other platforms, basic function deployment was possible using provider-specific plugins, such as serverless-openwhisk for Apache OpenWhisk, which handled action creation and sequence chaining on open-source serverless runtimes, and serverless-aliyun-function-compute for Alibaba Cloud's Function Compute, supporting event-driven triggers like OSS object changes. These integrations were more limited, often requiring custom configuration for authentication and lacking the depth of AWS features, with unique considerations like API key management for OpenWhisk namespaces and region-specific endpoints for Alibaba Cloud to ensure compliance with data sovereignty rules. Note that support for non-AWS providers, including Google Cloud, Azure, OpenWhisk, and Alibaba Cloud, has been deprecated in Serverless Framework v4, with v3 no longer maintained as of early 2025 (no security updates or fixes). Community plugins may still function but are not officially compatible with v4 and some, like the Google Cloud plugin, are seeking maintainers; future multi-cloud capabilities are planned, including through the Serverless Container Framework. Credential management across providers emphasizes secure, multi-cloud authentication, typically handled via environment variables (e.g., AWS_ACCESS_KEY_ID for AWS) or named profiles in configuration files like ~/.aws/credentials to switch between accounts without hardcoding secrets. For AWS, additional options include AWS SSO for temporary credentials and IAM roles for EC2-based deployments, while plugins for other providers like Azure used service principals and Google Cloud relied on service account keys, all resolvable dynamically in serverless.yml to support stage-specific or multi-account workflows. The Serverless Dashboard further centralizes this by storing provider credentials (for AWS, Azure, and GCP) at organization, service, or instance levels, using short-lived IAM roles to minimize exposure during deployments.

Programming Languages

The Serverless Framework supports multiple programming languages for authoring serverless functions, leveraging the runtimes available from cloud providers like AWS Lambda, Google Cloud Functions, and Azure Functions. For the primary AWS provider, these include Node.js (default), Python, Java, Ruby, and .NET (using C#). Languages like Go and Rust can be used via custom runtimes. Handler configurations are defined in the serverless.yml file under each function's properties, using a language-appropriate syntax such as handler: index.handler for Node.js or Python, where the first part specifies the entry file and the second the exported function. This setup allows the framework to invoke the correct code entry point during deployment and execution, regardless of the underlying provider. Runtime configurations are specified in serverless.yml at the provider level or per function, including the runtime version (e.g., nodejs20.x or java17) and support for custom layers to bundle dependencies like libraries or binaries. Layers ensure runtime compatibility and reduce deployment package sizes by separating shared code from function artifacts. Language-specific optimizations address deployment challenges. For and , the plugin provides bundling, tree-shaking, and minification to optimize bundle sizes and mitigate starts. Java integrations often involve for dependency resolution and JAR creation, with the handling the upload of built artifacts to the target runtime. To mitigate starts, which are more pronounced in languages like Java and Python to initialization times, the supports provider-agnostic configurations such as provisioned concurrency. This is set in serverless.yml via provisionedConcurrency: 5 (or similar values), pre-warming instances to ensure low-latency responses for latency-sensitive applications. As of 2025, Rust support is available via custom plugins that compile to the provider's custom runtime environment for performance-critical workloads.

Usage

Basic Implementation

The Serverless Framework requires Node.js version 18.20.3 or later as a prerequisite for installation and runtime execution. Additionally, for deployments to AWS, configure valid credentials (e.g., via AWS CLI, environment variables, AWS SSO, or Serverless Dashboard), with an IAM user or role having permissions for Lambda, API Gateway, and related services. To install the Serverless Framework globally, execute the command npm install -g serverless using , the . Verify the installation by running serverless in the terminal, which should display the CLI and available commands. As of 4.x, the supports updates, but pinning a specific in the is recommended for . After installation, run serverless login to authenticate with the Serverless Dashboard using , , or credentials. Creating a new project begins with running serverless and following the interactive prompts to select a template such as AWS Node.js Starter, which generates a boilerplate structure including a serverless.yml configuration file and a handler.js file for the function logic. This produces a directory named after the service (e.g., my-service). The generated serverless.yml includes basic provider settings, such as the AWS region and runtime. A HTTP endpoint is defined by editing the serverless.yml file to specify a function triggered by AWS API Gateway. For example, under the functions , configure a hello function with an HTTP :
yaml
service: my-service

provider:
  name: aws
  [runtime](/page/Runtime): nodejs18.x

functions:
  hello:
    handler: handler.hello
    events:
      - http:
          [path](/page/Path): hello
          [method](/page/Method): get
The corresponding handler in handler.js processes the and returns a JSON response:
javascript
module.exports.hello = async ([event](/page/Event)) => {
  return {
    statusCode: [200](/page/200),
    [body](/page/Body): JSON.stringify(
      {
        [message](/page/Message): 'Go Serverless v1.0! Your [function](/page/Function) executed successfully!',
      },
      [null](/page/Null),
      2
    ),
  };
};
This setup routes GET requests to /hello via API Gateway to the . For local testing without deployment, install the serverless-offline by running [npm](/page/npm) install --save-dev serverless-offline and add it to the plugins array in serverless.yml. Execute serverless offline to start a local emulation server, which simulates API Gateway and execution on :3000, allowing requests to the for . The first deployment is initiated from the project directory with serverless deploy, which packages the code, uploads it to AWS, provisions resources like the Lambda function and API Gateway, and outputs the endpoint URL. Verification can be performed by sending a curl request to the provided URL (e.g., curl https://<api-id>.execute-api.<region>.amazonaws.com/dev/hello) or checking the AWS Management Console for the function logs and API invocations.

Advanced Patterns

In advanced applications, the Serverless Framework facilitates microservices architectures by allowing developers to define multiple independent services, each with its own serverless.yml configuration file, enabling modular deployment and scaling. For instance, an e-commerce backend might consist of separate services for user management, order processing, and inventory, sharing resources such as DynamoDB tables for data persistence across functions. This setup uses IAM roles tailored to each function—via plugins like serverless-iam-roles-per-function—to grant precise permissions, such as read/write access to specific DynamoDB tables, minimizing security risks while optimizing resource utilization. Shared resources are referenced using CloudFormation exports or ARNs, ensuring seamless integration without duplicating infrastructure; for example, a users service exports its DynamoDB table ARN for import into the orders service. Best practices include packaging functions individually with package: individually: true to exclude unnecessary dependencies, keeping deployment artifacts under AWS Lambda's 250 MB unzipped limit, and using stage-specific variables for environment isolation. Event-driven pipelines are configured in the Serverless Framework by attaching SQS or Kinesis triggers to Lambda functions, enabling asynchronous data workflows for tasks like order processing or log aggregation. For SQS-based pipelines, the sqs event in serverless.yml references an existing queue ARN, with options for batchSize (up to 10,000 for standard queues) and maximumBatchingWindow (up to 300 seconds) to control invocation frequency and reduce API calls. Filter patterns, such as filterPatterns: [{a: [1, 2]}], allow selective message processing based on attributes, optimizing throughput for high-volume streams. Kinesis integrations use the stream event with type: kinesis, specifying startingPosition (e.g., LATEST) and batchSize (default 100), supporting enhanced fan-out consumers for low-latency data processing in real-time analytics pipelines. These configurations enable scalable workflows, like queuing user events in SQS for batch fulfillment or streaming sensor data via Kinesis for immediate transformation, with plugins like serverless-step-functions for orchestrating multi-step processes. For real-time applications, the Serverless Framework integrates APIs through API Gateway using the websocket event, supporting bi-directional communication for features like chat or live notifications. routes such as $connect, $disconnect, and $default are defined per , with routes (e.g., route: sendMessage) handling specific client interactions; connection management involves storing connectionId in DynamoDB during $connect and using the AWS SDK's ApiGatewayManagementApi to post messages to active . Authorizers can be applied to the $connect route for , ensuring secure sessions, while routeResponseSelectionExpression: $default enables flexible responses. An example configuration might route incoming messages to a handler that queries a shared DynamoDB table for user state, broadcasting updates to connected clients, which is ideal for collaborative tools. Logging is enabled via provider: { logs: { websocket: true } } for monitoring connection lifecycle events. Hybrid cloud setups leverage the Serverless Framework's multi-provider support—switching between AWS, , or Cloud via the provider block in serverless.yml—combined with custom plugins for failover across environments. For intra-provider redundancy, the serverless-multi-region-plugin deploys functions to multiple regions (e.g., us-east-1 and us-west-2), configuring Route 53 for healthcheck-based failover and Front for global distribution, ensuring sub-second routing switches during outages. Multi-cloud hybrid deployments require custom plugins to abstract provider differences, such as syncing DynamoDB with Cosmos DB via event bridges, or using CI/CD pipelines to deploy identical codebases across providers for workload distribution. Failover logic can be implemented by monitoring metrics with Watch or and triggering redeployments, though data replication across providers incurs transfer costs and latency; this pattern suits mission-critical apps needing vendor lock-in avoidance. Optimization techniques in the Serverless Framework include function splitting to isolate cold-start prone code, custom domain configurations for improved performance, and cost management strategies to minimize invocation expenses. Function splitting involves defining granular Lambda functions per endpoint or task—e.g., separating authentication from business logic—to reduce deployment sizes and enable independent scaling, using events to route via API Gateway. Custom domains are set up natively in v4 with customDomain: { domainName: api.example.com }, automating ACM certificate issuance and Route 53 records for lower latency than default endpoints. For cost control, power tuning via plugins like serverless-power-tuning tests memory allocations (e.g., 128-3008 MB) to find the optimal balance of execution time and price, while provisioned concurrency reduces cold starts for predictable workloads; additionally, monitoring with serverless-observability identifies underutilized functions for consolidation. These approaches can cut costs by up to 50% in variable-traffic scenarios by aligning resources to usage patterns.

Community and Ecosystem

Open-Source Contributions

The Serverless Framework's development is hosted on GitHub at the official repository, which has garnered over 45,000 stars and contributions from thousands of developers as of 2025, reflecting its widespread adoption in the serverless community. This open-source project encourages participation through a structured workflow that emphasizes collaboration and quality assurance. Contributions typically begin with forking the repository, creating a feature branch for changes, and submitting a pull request (PR) after opening an issue to discuss the proposed solution. The project adheres to a code of conduct promoting respectful interactions, with issue triage handled by maintainers using labels such as "help wanted" or "good first issue" to guide newcomers. Key areas for contributions include bug fixes to core functionality, development of new provider adapters for additional cloud platforms, and enhancements to documentation for better user accessibility. Community involvement extends beyond code through events like hackathons organized by groups such as Serverless Guru, dedicated forums for discussions, and Slack channels for real-time collaboration. The framework maintains a release cadence of bi-monthly minor updates, adhering to semantic versioning to ensure stability and backward compatibility for users. This process allows the plugin ecosystem to evolve alongside core improvements, enabling seamless integrations.

Commercial Extensions

Serverless Inc. offers a range of commercial extensions to the open-source Serverless Framework, designed to enhance scalability, security, and operational efficiency for enterprise users. These paid offerings build upon the core CLI by providing managed services and advanced features that address the needs of larger organizations, such as improved visibility and compliance support. The Serverless Dashboard, a SaaS platform launched in 2018, serves as the primary commercial hub for visual management of serverless applications. It provides a unified view of all deployed services across an organization, enabling centralized configuration of stage-specific settings like secrets, cloud provider accounts, and variables. Key features include real-time monitoring, alerting on performance issues, and deployment tracking, which facilitate troubleshooting and optimization without manual intervention. For team collaboration, the Dashboard supports role-restricted access to resources, allowing secure sharing of outputs and integration with GitHub for streamlined workflows. Advanced analytics, such as trace exploration and metrics ingestion, offer insights into application behavior, with one credit covering up to 50,000 traces or 4 million metrics. The enterprise tier targets organizations with annual revenue exceeding $2 million, requiring a paid license for Serverless Framework CLI version 4 and access to premium Dashboard capabilities. This tier includes dedicated support with an average response time of three hours, along with features for enhanced governance, such as restricted team permissions that function similarly to role-based access control (RBAC). While audit logs are integrated into the monitoring suite for tracking deployments and events, the platform is currently in the process of obtaining SOC 2 compliance certification to meet enterprise security standards. Pro services extend this with optimized deployment tools and compliance assistance, ensuring seamless integration with regulated environments. These extensions were enabled by strategic , including a $3 million seed round in 2016 led by Trinity Ventures, which supported initial , and a $10 million Series A in 2018 from , facilitating the pivot toward enterprise-focused products like the . The growth trajectory culminated in reported annual revenue of $1.5 million by 2024, underscoring the adoption of these offerings. Importantly, integration with the open-source version remains seamless, allowing users to upgrade to commercial features without modifying existing codebases or configurations.

References

  1. [1]
    Serverless Framework Documentation
    The Serverless Framework consists of a Command Line Interface and an optional Dashboard, and helps you deploy code and infrastructure together on Amazon Web ...NextSetup · Concepts · Deploy · Serverless.yml Reference
  2. [2]
    The new Serverless Platform Beta: everything teams need to ...
    Jul 30, 2018 · In 2015, we created a project called the Serverless Framework. Our mission was to make serverless development easy. By leveraging new cloud ...
  3. [3]
    Serverless Framework V4 Generally Available
    Jun 13, 2024 · Serverless Framework V.4 is now generally available. With Serverless Framework V.4, we've significantly accelerated innovation while avoiding breaking changes.
  4. [4]
    Serverless Framework - GitHub
    The Serverless Framework is a command-line tool with approachable YAML syntax to deploy both your code and cloud infrastructure needed to make tons of ...Serverless Examples · Serverless · Releases 456 · Plugins
  5. [5]
    Upgrading to Serverless Framework V4
    This guide covers upgrading to Serverless Framework version 4 from version 3 or earlier, and includes info on breaking changes, key license and pricing updates.Overview · Breaking Changes · Additional Notes
  6. [6]
    Episode #66: The Story of the Serverless Framework with Austen ...
    Sep 14, 2020 · An enthusiastic AWS Lambda user from day one, Austen founded the Serverless Framework (formerly JAWS), an open source project and module ...
  7. [7]
    Releasing Serverless Framework V.1 & Fundraising
    Oct 12, 2016 · Today, we're excited to announce that we're bringing Serverless Framework V.1 out of beta. We're also announcing we've closed a seed round of ...
  8. [8]
    Serverless raises $3M to help developers go serverless | TechCrunch
    Oct 12, 2016 · The company today announced that its framework is now out of beta and that it has raised a $3 million seed round led by Trinity Ventures.Missing: Inc | Show results with:Inc
  9. [9]
    Serverless v1.14 - Deploy to Google Cloud Functions & rollback ...
    May 24, 2017 · Adding the google integration strengthens the multi-provider support of the framework and gives you a 4th provider to choose from when building ...Highlights Of 1.14. 0 · Rollback Function Support · More Api Gateway Integration...Missing: date | Show results with:date
  10. [10]
    Serverless Framework V2
    Sep 21, 2020 · We recently released our first (minimal) set of breaking changes in the Serverless Framework, in over 4 years, prompted by deprecating support for old Node.js ...Deprecating Support For Node... · Run The Locally Installed... · Aws Http Api, Lambda...Missing: multi- | Show results with:multi-
  11. [11]
    Serverless Framework V3 Is Live!
    Jan 27, 2022 · We are excited to announce the release of Serverless Framework v3. This new major version brings a cleaner and redesigned CLI experience as well as a brand new ...
  12. [12]
    A New Model - Serverless Framework V4
    Oct 26, 2023 · The forthcoming release of Serverless Framework V.4 will introduce a new pricing model for Organizations generating more than $2M in Annual ...Proposed Pricing Structure · Introducing Serverless... · Extension Revenue Sharing
  13. [13]
    Serverless Framework Dashboard - Setup & Overview
    The Serverless Framework Dashboard is a SaaS solution that augments the CLI to manage deployments, secrets, and observability across AWS accounts.Missing: acquisition partnerships
  14. [14]
    Releases · serverless/serverless - GitHub
    Aug 27, 2025 · Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda ...
  15. [15]
    Serverless Framework Pricing 2025 | Pay-As-You-Go & Reserved ...
    Serverless Framework pricing starts at $0 for companies under $2M revenue. Enterprise plans from $4/credit. Compare pay-as-you-go vs reserved credits.
  16. [16]
    Serverless Framework Concepts
    The Serverless Framework helps you develop and deploy AWS Lambda functions, along with the AWS infrastructure resources they require.Events · Resources · Services<|separator|>
  17. [17]
    AWS Lambda Guide - Serverless.yml Reference
    Serverless Framework Dashboard features for that Service, such as tracking deployments, sharing outputs and secrets, and enabling metrics, traces, and logs.
  18. [18]
    Serverless Framework Services
    A service is configured via a serverless.yml file where you define your functions, the events that trigger them, and the AWS resources to deploy.
  19. [19]
    AWS Lambda Functions - Serverless Framework
    Every AWS Lambda function needs permission to interact with other AWS infrastructure resources within your account. These permissions are set via an AWS IAM ...Configuration · Lambda Function URLs · Referencing container image... · Tags<|control11|><|separator|>
  20. [20]
    Plugins - Serverless Framework
    Installing plugins. Plugins are installed per service. They are not applied globally. To install a plugin, run the following command in a service directory:.
  21. [21]
    IAM Permissions For Functions - Serverless Framework
    Serverless empowers you to define custom roles and apply them to your functions on a provider or individual function basis. To do this, you must declare a role ...Iam Permissions For... · Per-Function Iam Roles · Custom Iam Roles
  22. [22]
    Service Configuration Validation - Serverless Framework
    Learn how to validate your service configuration in the Serverless Framework using AJV. Understand the error handling modes and how to address configuration ...Missing: linting | Show results with:linting
  23. [23]
    Deploying to AWS - Serverless Framework
    The Serverless Framework was designed to provision your AWS Lambda Functions, Events and infrastructure Resources safely and quickly.
  24. [24]
    Packaging - Serverless Framework
    How the Serverless Framework packages your AWS Lambda functions and other available options.
  25. [25]
    Serverless Framework Commands - AWS Lambda - Package
    The sls package command packages your entire infrastructure into the .serverless directory by default and make it ready for deployment.
  26. [26]
    Serverless Framework Commands - AWS Lambda - Deploy
    The sls deploy command deploys your entire service via CloudFormation. Run this command when you have made infrastructure changes.
  27. [27]
    Serverless Framework Commands - AWS Lambda - Remove
    The sls remove command will remove the deployed service, defined in your current working directory, from the provider.
  28. [28]
    Serverless Rollback CLI Command
    At first you want to run serverless deploy list to show your existing deployments. This will provide you with a list of the deployments stored in your S3 bucket ...Missing: atomic | Show results with:atomic
  29. [29]
    How to manage canary deployments on Lambda via the Serverless ...
    Apr 18, 2018 · To do this, we'd need to create some AWS resources. We'd need to first create a CodeDeploy application, a DeploymentGroup and an Alias for each ...
  30. [30]
    Guide: CI/CD - Serverless Framework
    Unlike traditional CI/CD services, Serverless CI/CD is optimized for serverless architectures and requires little configuration.Four-Step Development... · Implementing The Recommended... · DeployingMissing: security | Show results with:security
  31. [31]
    How Shamrock transacts billions of dollars with Serverless ...
    Feb 26, 2019 · They run their CI with Jenkins (with plans to move over to GitHub actions soon), and ship everything as manually-managed blue/green deployments ...
  32. [32]
    Creating plugins - Serverless Framework
    Creating custom plugins · Hook into lifecycle events to add new logic · Define new CLI commands · Define new variable sources · Extend the serverless.yml syntax ...Prioritizing Build Plugins · Distributing a plugin via NPM · Lifecycle events
  33. [33]
    Plugins - Serverless Framework
    The Serverless Framework features over 1000 community-authored plugins, including Offline, Custom Domains, AWS Lambda Warmer, Static Sites On S3, ...Serverless Offline · Serverless Plugin Typescript · Serverless Python RequirementsMissing: linting | Show results with:linting
  34. [34]
    Custom commands - Plugins - Serverless Framework
    Serverless Framework plugins can define custom CLI commands. These commands can then be called by users, for example: serverless my-command.
  35. [35]
    Serverless - AWS Lambda - CLI Reference
    **Summary of Lifecycle Management Commands (Serverless Framework AWS CLI Reference)**
  36. [36]
  37. [37]
  38. [38]
  39. [39]
  40. [40]
  41. [41]
    Plugins Serverless Google Cloudfunctions
    This plugin enables support for Google Cloud Functions within the Serverless Framework. Documentation is available, and you can use Docker for easier ...
  42. [42]
    Google Cloud function v2 - Serverless Framework
    Sep 19, 2024 · See “Deprecation Of Non-AWS Providers” @ Upgrading to v4 - Serverless Framework - Upgrading to v4. ( version 3 is out of support in 2 months ).
  43. [43]
    Azure Functions Serverless Plugin
    This plugin enables Azure Functions support within the Serverless Framework. Build Status Code Coverage npm version Quickstart Pre-requisites An Azure account.Create a new Azure Function... · Creating or removing Azure... · Logging Verbosity
  44. [44]
    Serverless Azure Functions V2 - Linux, Python & .NET Core Support
    Jun 3, 2020 · Introducing the v2 release of the Serverless Azure Functions plugin, which includes support for Linux, Python & .NET Core Function Apps.
  45. [45]
    Serverless Apache OpenWhisk Plugin
    This plugin enables support for the Apache OpenWhisk platform within the Serverless Framework. Getting Started Register account with Apache OpenWhisk.Create Service From Template · Deploy Service · Test Service · Codable Support
  46. [46]
    Aliyun Function Compute Serverless Plugin
    Aliyun Function Compute Serverless Plugin. This plugin enables Aliyun Function Compute support within the Serverless Framework.Example · Workflow
  47. [47]
    AWS Credentials - Serverless Framework
    This guide is for the Amazon Web Services (AWS) provider, so we'll step through the process of setting up a connection to AWS for the Serverless Framework.Aws Credentials · Using Resolvers To Specify... · Production ConfigurationMissing: tracing | Show results with:tracing
  48. [48]
    Dashboard Providers - Serverless Framework
    Providers enable you to securely manage the accounts to the cloud service providers like Azure, AWS, and GCP in the Serverless Framework Dashboard.Missing: partnerships SaaS
  49. [49]
    Lambda runtimes - AWS Documentation
    Each major programming language release has a separate runtime, with a unique runtime identifier, such as nodejs22.x or python3.13 . To configure a function to ...Building with Node.js · Runtime version updates · OS-only runtimes
  50. [50]
  51. [51]
    Serverless Webpack - Serverless Framework: Plugins
    This plugin is for you if you want to use the latest Javascript version with Babel ; use custom resource loaders , optimize your packaged functions individually ...
  52. [52]
    Configuring provisioned concurrency for a function - AWS Lambda
    Choose Configuration and then choose Concurrency. Under Provisioned concurrency configurations, choose Add configuration. Choose the qualifier type, and ...
  53. [53]
    Plugins Serverless Rust
    This plugin assumes you are building Rustlang lambdas targeting the AWS Lambda "provided" runtime. The AWS Lambda Rust Runtime makes this easy.
  54. [54]
    Setting Up Serverless Framework With AWS
    Here's how to install the Serverless Framework, set up a project and deploy it to Amazon Web Services on serverless infrastructure like AWS Lambda, AWS ...Create A Service · Creating An App · Developing
  55. [55]
  56. [56]
    Deploy a scalable API and Backend with Serverless, Express, and ...
    May 29, 2019 · Learn how to structure a microservice application in multiple serverless.yml files for infinite scalability.Missing: architecture | Show results with:architecture
  57. [57]
    AWS Lambda Events - SQS Queues - Serverless Framework
    Serverless triggers Lambda on SQS messages, using existing queues. You can set batch size, filter patterns, and maximum concurrency. Serverless-Lift can deploy ...Missing: driven | Show results with:driven
  58. [58]
    AWS Lambda Events - Kinesis & DynamoDB Streams
    Lambda functions are triggered by DynamoDB table modifications or new Kinesis stream records. Serverless connects existing streams to functions, not creating ...Missing: driven | Show results with:driven
  59. [59]
    Serverless Step Functions - Serverless Framework: Plugins
    You can configure CloudWatch Events to send notification to a number of targets. Currently this plugin supports sns , sqs , kinesis , firehose , lambda and ...Missing: pipelines | Show results with:pipelines
  60. [60]
    AWS Lambda Events - Websocket - Serverless Framework
    The Serverless Framework makes it possible to setup an API Gateway powered Websocket backend with the help of the websocket event.Example serverless.yaml · Using Authorizers · Send a message to a ws-client
  61. [61]
    Using API Gateway WebSockets with the Serverless Framework
    Dec 21, 2018 · We built a plugin to let you use API Gateway WebSockets with the Serverless Framework, even in advance of CloudFormation support!
  62. [62]
    The State of Serverless Multi-cloud
    Nov 6, 2017 · Self-Hosting AI Agents on AWS with Serverless Container Framework v2 · Serverless Team. Jun 5, 2025. Introducing the Serverless MCP · Serverless ...
  63. [63]
    Serverless Multi Region Plugin
    Set up Route 53 for failover based routing with failover between regions based on the healthcheck created; Set up CloudFormation in front of Route 53 failover ...
  64. [64]
    Custom Domains - Serverless Framework
    The Serverless Framework v4 provides built-in support for configuring custom domains for your APIs. This feature automatically handles SSL certificate creation, ...
  65. [65]
    AWS Lambda Power Tuning with AWS Step Functions
    Jun 29, 2017 · The current optimization strategy is based on cost alone. The state machine will return the power configuration which provides the cheapest per- ...
  66. [66]
    How to contribute to Serverless open source projects
    Mar 19, 2018 · Our Serverless Framework GitHub repo contains a contributor's guide where we lay out the basics, and we have a similar contributor's guide for ...
  67. [67]
    serverless/CONTRIBUTING.md at main · serverless/serverless
    Insufficient relevant content. The provided text is a partial GitHub page snippet with navigation, feedback, and footer information, but it does not contain the full CONTRIBUTING.md file or details about the contribution process, code of conduct, issue triage, key areas, or community collaboration tools as requested.
  68. [68]
    Serverless Forums - Serverless Framework
    The forum discusses serverless architectures, Serverless Framework, AWS Lambda, Azure Functions, Google CloudFunctions, and more.Missing: slack hackathons
  69. [69]
    https://join.slack.com/t/serverless-contrib/shared...
    No information is available for this page. · Learn whyMissing: forums hackathons
  70. [70]
    Serverless Guru Spring Hackathon Winners & Project Showcase
    Jun 5, 2025 · The fruits of labor from the Spring Hackathon are ready to be picked! Join the judges and the top 3 prize winners as they breakdown their ...Missing: community slack forums
  71. [71]
    Extend the Serverless Framework with these community driven plugins
    Serverless Plugins allow users to extend or overwrite the framework's core functionality. Many of these plugins are contributed by our amazing community ...
  72. [72]
    Dashboard - Serverless Framework
    The Serverless dashboard provides a unified view of applications, monitoring, and deployments, with a single view of all services and team collaboration.Missing: acquisition SaaS
  73. [73]
    Serverless, Inc. lands $10M Series A to build ... - TechCrunch
    Jul 30, 2018 · They have now raised a total of $13 million, according to the company. The company also announced the release of the Serverless Platform, which ...
  74. [74]
    How Serverless hit $1.5M revenue with a 22 person team in 2024.
    Serverless CEO Austen Collins shares how Serverless grew to $1.5M over the past 10 years. Serverless has raised $10M. See more Serverless data here.