The Serverless Framework is a powerful command-line interface (CLI) tool designed for deploying serverless applications, primarily leveraging AWS services like Lambda, API Gateway, and DynamoDB. It enables developers to define both their application code and the necessary cloud infrastructure using declarative YAML configurations. Currently in its v4 series (e.g., v4.34.0 as of the latest release info), it undergoes active development with frequent minor and patch releases. The framework supports multiple programming runtimes including Node.js, Python, Go, and Java. Key differentiators include its extensive extensibility via a plugin ecosystem, the recent integration of popular community plugins (e.g., AppSync, Prune) into its core, and built-in support for advanced features like Durable Functions and S3 Filesystem mounts for Lambda. It aims to optimize for cost-effectiveness, auto-scaling, and reduced maintenance by abstracting complex cloud provisioning, facilitating the entire application lifecycle from development to deployment.
npm install serverlessVerified import paths — ran on the pinned version, not inferred.
This quickstart defines a basic AWS Lambda function with an API Gateway endpoint using `serverless.yml`. It shows a minimal configuration for a Node.js function, demonstrates environment variable usage, and includes typical CLI commands for deployment and local development.
Review the official Serverless Framework v4 migration guide. Remove previously external plugins that are now built-in (e.g., `serverless-appsync-plugin`, `serverless-prune-plugin`). Update your `serverless.yml` to use the new native configurations.
Upgrade your Node.js environment to version 18.17.0 or newer. Use a tool like `nvm` to manage multiple Node.js versions if needed (`nvm install 18 && nvm use 18`).
Always use the latest stable version of the Serverless Framework. Regularly update your `serverless` package to benefit from the latest security patches and dependency hardening efforts (`npm update serverless`).
Refer to the Serverless Framework v4 documentation for the new native custom domain configuration. Remove any legacy custom domain plugins from your `plugins` array and update your domain settings.
Install the Serverless Framework globally: `npm install -g serverless`. Ensure your npm global bin directory is in your system's PATH. You may need to restart your terminal after installation.
Upgrade Serverless Framework to a version where this fix is applied (e.g., `v4.31.3` or later). `npm install -g serverless@latest`.
Verify your AWS access key ID, secret access key, session token, and region configuration. Use `aws configure` or `sls config credentials --provider aws --key xxx --secret yyy` to update them. For SSO, ensure your session is active. Check IAM policies for required permissions (e.g., Lambda, S3, CloudFormation actions).
Correct the `handler` path and function name in `serverless.yml`. For example, `handler: my-file.myFunction` if `myFunction` is exported from `my-file.js` in your service root.
No dependency data recorded yet.