{"id":13456326,"url":"https://github.com/juanjoDiaz/serverless-plugin-warmup","last_synced_at":"2025-03-24T09:32:04.746Z","repository":{"id":39757326,"uuid":"85220744","full_name":"juanjoDiaz/serverless-plugin-warmup","owner":"juanjoDiaz","description":"Keep your lambdas warm during winter. ♨","archived":false,"fork":false,"pushed_at":"2024-10-02T19:07:54.000Z","size":1189,"stargazers_count":1108,"open_issues_count":11,"forks_count":114,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-10-15T15:20:50.348Z","etag":null,"topics":["aws","aws-lambda","lambda","serverless","serverless-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juanjoDiaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-16T16:56:24.000Z","updated_at":"2024-10-15T06:13:30.000Z","dependencies_parsed_at":"2023-10-13T09:08:55.664Z","dependency_job_id":"18e65162-78d4-4c4b-9776-1616d056efac","html_url":"https://github.com/juanjoDiaz/serverless-plugin-warmup","commit_stats":{"total_commits":377,"total_committers":45,"mean_commits":8.377777777777778,"dds":0.5013262599469497,"last_synced_commit":"2fd6e60e0587857c0b891f7ee6850b7dd9e36b15"},"previous_names":["fidellimited/serverless-plugin-warmup"],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanjoDiaz%2Fserverless-plugin-warmup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanjoDiaz%2Fserverless-plugin-warmup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanjoDiaz%2Fserverless-plugin-warmup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanjoDiaz%2Fserverless-plugin-warmup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juanjoDiaz","download_url":"https://codeload.github.com/juanjoDiaz/serverless-plugin-warmup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221956266,"owners_count":16907479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","lambda","serverless","serverless-plugin"],"created_at":"2024-07-31T08:01:19.914Z","updated_at":"2024-10-28T23:32:04.959Z","avatar_url":"https://github.com/juanjoDiaz.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Serverless WarmUp Plugin ♨\n[![Serverless][serverless-badge]](serverless-badge-url)\n[![npm version][npm-version-badge]][npm-version-badge-url]\n[![npm monthly downloads][npm-downloads-badge]][npm-version-badge-url]\n[![Node.js CI](https://github.com/juanjoDiaz/serverless-plugin-warmup/actions/workflows/on-push.yaml/badge.svg)](https://github.com/juanjoDiaz/serverless-plugin-warmup/actions/workflows/on-push.yaml)\n[![Coverage Status][coveralls-badge]][coveralls-badge-url]\n[![license](https://img.shields.io/npm/l/serverless-plugin-warmup.svg)](https://raw.githubusercontent.com/juanjoDiaz/serverless-plugin-warmup/main/LICENSE)\n\nKeep your lambdas warm during winter.\n\n**Requirements:**\n* Node *v18.x* or higher\n* Serverless *v3.8* or higher\n* AWS provider\n\n## How it works\n\nWarmUp solves *cold starts* by creating a scheduled lambda (the warmer) that invokes all the selected service's lambdas in a configured time interval (default: 5 minutes) and forcing your containers to stay warm.\n\n## Installation\n\nInstall via npm in the root of your Serverless service:\n\n```sh\nnpm install --save-dev serverless-plugin-warmup\n```\n\nAdd the plugin to the `plugins` array in your Serverless `serverless.yaml`:\n\n```yaml\nplugins:\n  - serverless-plugin-warmup\n```\n\n## Configuration\n\nThe warmup plugin supports creating one or more warmer functions. Warmers must be defined under `custom.warmup` in the `serverless.yaml` file before they can be used in the functions' configs:\n\n```yaml\ncustom:\n  warmup:\n    officeHoursWarmer:\n      enabled: true\n      events:\n        - schedule: cron(0/5 8-17 ? * MON-FRI *)\n      concurrency: 10\n      verbose: true\n      logRetentionInDays: 14\n    outOfOfficeHoursWarmer:\n      enabled: true\n      events:\n        - schedule: cron(0/5 0-7 ? * MON-FRI *)\n        - schedule: cron(0/5 18-23 ? * MON-FRI *)\n        - schedule: cron(0/5 * ? * SAT-SUN *)\n      concurrency: 1\n      verbose: false\n    testWarmer:\n      enabled: false\n```\n\nThe options are the same for all the warmers:\n\n* **folderName** Folder to temporarily store the generated code (defaults to `.warmup`)\n* **cleanFolder** Whether to automatically delete the generated code folder. You might want to keep it if you are doing some custom packaging (defaults to `true`)\n* **name** Name of the generated warmer lambda (defaults to `${service}-${stage}-warmup-plugin-${warmerName}`)\n* **roleName** Name to be applied to the default warmer lambda role. Ignored if a the role setting is used (defaults to `${service.service}-${stage}-${region}-${warmerName.toLowerCase()}-role`)\n* **role** Role to apply to the warmer lambda (defaults to a custom role with minimal [permissions](#permissions))\n* **tags** Tag to apply to the generated warmer lambda (defaults to the serverless default tags)\n* **vpc** The VPC and subnets in which to deploy. Can be any [Serverless VPC configuration](https://serverless.com/framework/docs/providers/aws/guide/functions#vpc-configuration) or be set to `false` in order to deploy the warmup function outside of a VPC (defaults to the vpc in the provider)\n* **memorySize** The memory to be assigned to the warmer lambda (defaults to `128`)\n* **events** The event that triggers the warmer lambda. Can be any [Serverless event](https://serverless.com/framework/docs/providers/aws/events/) (defaults to `- schedule: rate(5 minutes)`)\n* **architecture**  The [instruction set to use for the lambda](https://www.serverless.com/framework/docs/providers/aws/guide/functions#instruction-set-architecture) (defaults to `x86_64`)\n* **package** The package configuration. Can be any [Serverless package configuration](https://serverless.com/framework/docs/providers/aws/guide/packaging#package-configuration) (defaults to `{ individually: true, patterns: ['!**', '.warmup/${warmerName}/**'] }`)\n* **timeout** How many seconds until the warmer lambda times out. (defaults to `10`)\n* **environment** Can be used to set environment variables in the warmer lambda. You can also unset variables configured at the provider by setting them to undefined. However, you should almost never have to change the default. (defaults to unset all package level environment variables. )\n* **tracing** Specify whether to enable/disable tracing at the function level. When tracing is enabled, warmer functions will use NPM to install the X-Ray client and use it to trace requests (It takes any of the values supported by serverless as `boolean`, `Active`or `PassThrough` and defaults to the provider-level setting)\n* **verbose** If set to false, it disables the console.logs placed on this warmer lambda (defaults to `true`)\n* **logRetentionInDays** Set the retention time in days for the log group associated to this warmer lamba. Can be any of the values specified in the [AWS documentation](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutRetentionPolicy.html#API_PutRetentionPolicy_RequestSyntax).\n* **prewarm** If set to true, it warms up your lambdas right after deploying (defaults to `false`)\n\nThere are also some options which can be set under `custom.warmup.\u003cyourWarmer\u003e` to be applied to all your lambdas or under `yourLambda.warmup.\u003cyourWarmer\u003e` to  overridde the global configuration for that particular lambda. Keep in mind that in order to configure a warmer at the function level, it needed to be previously configured at the `custom` section or the pluging will error.\n\n* **enabled** Whether your lambda should be warmed up or not. Can be a boolean, a stage for which the lambda will be warmed up or a list of stages for which your lambda will be warmed up (defaults to `false`)\n* **alias** Alias qualifier to use when invoking the functions. Necessary, for example, when this plugin is combined with the [serverless-plugin-canary-deployments](https://github.com/davidgf/serverless-plugin-canary-deployments) serverless canary plugin (warmup should always be declared after).\n* **clientContext** Custom data to send as client context to the data. It should be an object where all the values are strings. (defaults to the payload. Set it to `false` to avoid sending any client context custom data)\n* **payload** The payload to send to your lambda. This helps your lambda identify when the call comes from this plugin (defaults to `{ \"source\": \"serverless-plugin-warmup\" }`)\n* **payloadRaw** Whether to leave the payload as-is. If false, the payload will be stringified into JSON. (defaults to `false`)\n* **concurrency** The number of times that each of your lambda functions will be called in parallel. This can be used in a best-effort attempt to force AWS to spin up more parallel containers for your lambda. (defaults to `1`)\n\n```yaml\ncustom:\n  warmup:\n    default:\n      enabled: true # Whether to warm up functions by default or not\n      folderName: '.warmup' # Name of the folder created for the generated warmup \n      cleanFolder: false\n      memorySize: 256\n      name: warmer-default\n      roleName: my-custom-role\n      role: WarmupRole\n      tags:\n        Project: foo\n        Owner: bar \n      vpc: false\n      events:\n        - schedule: 'cron(0/5 8-17 ? * MON-FRI *)' # Run WarmUp every 5 minutes Mon-Fri between 8:00am and 5:55pm (UTC)\n      package:\n        individually: true\n        patterns:\n          - '!../**'\n          - '!../../**'\n          - ./**\n      timeout: 20\n      tracing: true\n      verbose: false # Disable the logs\n      logRetentionInDays: 14\n      prewarm: true # Run WarmUp immediately after a deploymentlambda\n      clientContext:\n        source: my-custom-source\n        other: '20'\n      payload: \n        source: my-custom-source\n        other: 20\n      payloadRaw: true # Won't JSON.stringify() the payload, may be necessary for Go/AppSync deployments\n      concurrency: 5 # Warm up 5 concurrent instances\n    \nfunctions:\n  myColdfunction:\n    handler: 'myColdfunction.handler'\n    events:\n      - http:\n          path: my-cold-function\n          method: post\n    warmup:\n      default:\n        enabled: false\n\n  myLowConcurrencyFunction:\n    handler: 'myLowConcurrencyFunction.handler'\n    events:\n      - http:\n          path: my-low-concurrency-function\n          method: post\n    warmup:\n      default:\n        clientContext:\n          source: different-source-only-for-this-lambda\n        payload:\n          source: different-source-only-for-this-lambda\n        concurrency: 1\n   \n  myProductionOnlyFunction:\n    handler: 'myProductionOnlyFunction.handler'\n    events:\n      - http:\n          path: my-production-only-function\n          method: post\n    warmup:\n      default:\n        enabled: prod\n      \n   myDevAndStagingOnlyFunction:\n    handler: 'myDevAndStagingOnlyFunction.handler'\n    events:\n      - http:\n          path: my-dev-and-staging-only-function\n          method: post\n    warmup:\n      default:\n        enabled:\n          - dev\n          - staging\n```\n\n### Runtime Configuration\n\nConcurrency can be modified post-deployment at runtime by setting the warmer lambda environment variables.  \nTwo configuration options exist:\n* Globally set the concurrency for all lambdas on the stack (overriding the deployment-time configuration):  \n  Set the environment variable `WARMUP_CONCURRENCY`\n* Individually set the concurrency per lambda  \n  Set the environment variable `WARMUP_CONCURRENCY_YOUR_FUNCTION_NAME`. Must be all uppercase and hyphens (-) must be replaced with underscores (_). If present for one of your lambdas, it overrides the global concurrency setting.\n\n### Networking\n\nThe WarmUp function use normal calls to the AWS SDK in order to keep your lambdas warm.\nIf you set up at the provider level or the warmer confir level that the wamer function should be deployed into into a VPC subnet you need to keep in mind a couple of things:\n\n* If the subnet is public, access to the AWS API should be allowed by [Internet Gateway](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html).\n* If the subnet is private, a [Network Address Translation (NAT) gateway](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html) is needed so the warmers can connect to the AWS API.\n* In either case, the security group and the network ACLs need to allow access from the warmer to the AWS API.\n\nSince the AWS SDK doesn't provide any timeout by default, this plugin uses a default connection timeout of 1 second. This is to avoid the issue of a lambda constantly timing out and consuming all its allowed duration simply because it can't connect to the AWS API.\n\n### Permissions\n\nWarmUp requires permission to be able to `invoke` your lambdas.\n\nIf no role is provided at the `custom.warmup` level, each warmer function gets a default role with minimal permissions allowing the warmer function to:\n* Create its log stream and write logs to it\n* Invoke the functions that it should warm (and only those)\n* Create and attach elastic network interfaces (ENIs) which is necessary if deploying to a VPC\n\nThe default role for each warmer looks like:\n\n```yaml\nresources:\n  Resources:\n    WarmupRole:\n      Type: AWS::IAM::Role\n      Properties:\n        RoleName: WarmupRole\n        AssumeRolePolicyDocument:\n          Version: '2012-10-17'\n          Statement:\n            - Effect: Allow\n              Principal:\n                Service:\n                  - lambda.amazonaws.com\n              Action: sts:AssumeRole\n        Policies:\n          - PolicyName: WarmUpLambdaPolicy\n            PolicyDocument:\n              Version: '2012-10-17'\n              Statement:\n               # Warmer lambda to send logs to CloudWatch\n                - Effect: Allow\n                  Action:\n                    - logs:CreateLogGroup\n                    - logs:CreateLogStream\n                  Resource: \n                    - !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/${warmer.name}:*\n                - Effect: Allow\n                  Action:\n                    - logs:PutLogEvents\n                  Resource: \n                    - !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/${warmer.name}:*:*\n                # Warmer lambda to invoke the functions to be warmed\n                - Effect: 'Allow'\n                  Action:\n                    - lambda:InvokeFunction\n                  Resource:\n                    - !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:${fn1.name}\n                    - !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:${fn2.name}\n                    # and one more row for each function that must be warmed up by the warmer\n                # Warmer lambda to manage ENIS (only needed if deploying to VPC, https://docs.aws.amazon.com/lambda/latest/dg/vpc.html)\n                - Effect: Allow\n                  Action:\n                    - ec2:CreateNetworkInterface\n                    - ec2:DescribeNetworkInterfaces\n                    - ec2:DetachNetworkInterface\n                    - ec2:DeleteNetworkInterface\n                  Resource: \"*\"\n```\n\nThe permissions can also be added to all lambdas using setting the role to `IamRoleLambdaExecution` and setting the permissions in `iamRoleStatements` under `provider` (see https://serverless.com/framework/docs/providers/aws/guide/functions/#permissions):\n\n```yaml\nprovider:\n  name: aws\n  runtime: nodejs20.x\n  iamRoleStatements:\n    - Effect: 'Allow'\n      Action:\n        - 'lambda:InvokeFunction'\n      Resource:\n      - !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${self:service}-${opt:stage, self:provider.stage}-*\ncustom:\n  warmup:\n    default:\n      enabled: true\n      role: IamRoleLambdaExecution\n      architecture: 'arm64'\n```\n\nIf setting `prewarm` to `true`, the deployment user used by the AWS CLI and the Serverless framework also needs permissions to invoke the warmer.\n\n## On the function side\n\nWhen invoked by WarmUp, your lambdas will have the event source `serverless-plugin-warmup` (unless otherwise specified using the `payload` option):\n\n```json\n{\n  \"Event\": {\n    \"source\": \"serverless-plugin-warmup\"\n  }\n}\n```\n\nTo minimize cost and avoid running your lambda unnecessarily, you should add an early return call before your lambda logic when that payload is received.\n\n### Javascript\n\nUsing the Promise style:\n\n```js\nmodule.exports.lambdaToWarm = async function(event, context) {\n  /** Immediate response for WarmUp plugin */\n  if (event.source === 'serverless-plugin-warmup') {\n    console.log('WarmUp - Lambda is warm!');\n    return 'Lambda is warm!';\n  }\n\n  // ... function logic\n}\n```\n\nUsing the Callback style:\n\n```js\nmodule.exports.lambdaToWarm = function(event, context, callback) {\n  /** Immediate response for WarmUp plugin */\n  if (event.source === 'serverless-plugin-warmup') {\n    console.log('WarmUp - Lambda is warm!')\n    return callback(null, 'Lambda is warm!')\n  }\n\n  // ... function logic\n}\n```\n\nUsing the context. This could be useful if you are handling the raw input and output streams.\n\n```js\nmodule.exports.lambdaToWarm = async function(event, context) {\n  /** Immediate response for WarmUp plugin */\n  if (context.custom.source === 'serverless-plugin-warmup') {\n    console.log('WarmUp - Lambda is warm!');\n    return 'Lambda is warm!';\n  }\n\n  // ... function logic\n}\n```\n\nIf you're using the `concurrency` option you might want to add a slight delay before returning on warmup calls to ensure that your function doesn't return before all concurrent requests have been started:\n\n```js\nmodule.exports.lambdaToWarm = async (event, context) =\u003e {\n  if (event.source === 'serverless-plugin-warmup') {\n    console.log('WarmUp - Lambda is warm!');\n    /** Slightly delayed (25ms) response \n    \tto ensure concurrent invocation */\n    await new Promise(r =\u003e setTimeout(r, 25));\n    return 'Lambda is warm!';\n  }\n\n  // ... add lambda logic after\n}\n```\n\n### Python\n\nYou can handle it in your function:\n\n```python\ndef lambda_handler(event, context):\n    # early return call when the function is called by warmup plugin\n    if event.get(\"source\") == \"serverless-plugin-warmup\":\n        print(\"WarmUp - Lambda is warm!\")\n        return {}\n\n    # ... function logic\n```\n\nOr you could use a decorator to avoid the redundant logic in all your functions:\n\n```python\ndef skip_execution_if.warmup_call(func):\n    def warmup_wrapper(event, context):\n      if event.get(\"source\") == \"serverless-plugin-warmup\":\n        print(\"WarmUp - Lambda is warm!\")\n        return {}\n\n      return func(event, context)\n\n    return warmup_wrapper\n\n# ...\n\n@skip_execution_if.warmup_call\ndef lambda_handler(event, context):\n    # ... function logic\n```\n\n### Java\n\nYou can handle it in your function:\n\n```java\npublic ApiGatewayResponse handleRequest(Map\u003cString, Object\u003e input, Context context) {\n  if (\"serverless-plugin-warmup\".equals(input.get(\"source\"))) {\n    System.out.println(\"WarmUp - Lambda is warm!\");\n    return ApiGatewayResponse.builder()\n        .setStatusCode(200)\n        .build();\n  }\n  \n  // ... function logic\n}\n```\n\n### Ruby\n\nYou can handle it in your function:\n\n```ruby\ndef handle_request(app:, event:, context:, config: {})\n  if event['source'] == 'serverless-plugin-warmup'\n    puts 'WarmUp - Lambda is warm!'\n    return {} \n  end\n\n  # ... function logic\nend\n```\n\n## Lifecycle hooks\n\nWarmUp plugin uses 3 lifecycles hooks:\n\n* `warmup:addWarmers:addWarmers`: This is where the warmers are added to the service. It runs `after:package:initialize`.\n* `warmup:cleanupTempDir:cleanup`: This is where the warmers' temp folders are removed. It runs `after:package:createDeploymentArtifacts`.\n* `warmup:prewarm:start`: This is where the warmers are invoked. It runs `after:deploy:deploy` or when running the command `serverless warmup prewarm`.\n* `warmup:prewarm:end`: This is after the warmers are invoked. \n\n## Usage\n\n### Packaging\n\nWarmUp supports\n\n```sh\nserverless package\n```\n\nBy default, each warmer function is packaged individually and it uses a folder named `.warmup/\u003cfunction_name\u003e` to serve as temporary folder during the packaging process. This folder is deleted at the end of the packaging process unless the `cleanFolder` option is set to `false`.\n\nIf you are doing your own [package artifact](https://serverless.com/framework/docs/providers/aws/guide/packaging#artifact) you can set the `cleanFolder` option to `false` and include the `.warmup` folder in your custom artifact.\n\n### Deployment\n\nWarmUp adds package the warmers and add them to your services automatically when you run\n\n```sh\nserverless deploy\n```\n\nAfter the deployment, any warmer with `prewarm: true` is automatically invoked to warm up your functions without delay.\n\n\n## Prewarming\n\nApart from prewarming automatically after each deployment. You can invokes a warmer after a sucessful deployment to warm up functions using:\n\n```sh\nserverless warmup prewarm -warmers \u003cwarmer_name\u003e\n```\n\nThe `warmers` flag takes a comma-separated list of warmer names. If it's nor provided, all warmers with `prewarm` set to `true` are invoked.\n\n## Migrations\n\n### v5.X to v6.X\n\n#### Removed include/exclude in favour of patterns\n\nFrom Serverless 2.32.0 the `patterns` option is the recommended approach to include/exclude files from packaging. In version 3.X, the `include` and `exclude` are removed.\n\nThis plugin applies the same philosophy.\n\nWhat used to be:\n```yaml\ncustom:\n  warmup:\n    default:\n      enabled: 'prod'\n      package:\n        individually: true\n        exclude: '../**',\n        include: 'myFolder'\n```\n\nis the same as\n```yaml\ncustom:\n  warmup:\n    default:\n      enabled: 'prod'\n      package:\n        individually: true\n        patterns:\n          - '!../**',\n          - 'myFolder'\n```\n\n### v4.X to v5.X\n\n#### Support multiple warmer\n\nPrevious versions of the plugin only support a single warmer which limited use cases like having different concurrentcies in different time periods. From v5, multiple warmers are supported. The `warmup` field in the `custom` section or the function section, takes an object where each key represent the name of the warmer and the value the configuration which is exactly as it used to be except for the changes listed below.\n\n```yaml\ncustom:\n  warmup:\n    enabled: true\n    events:\n      - schedule: rate(5 minutes)\n```\n\nhave to be named, for example, to `default`:\n\n```yaml\ncustom:\n  warmup:\n    default:\n      enabled: true\n      events:\n        - schedule: rate(5 minutes)\n```\n\n#### Change the default temporary folder to `.warmup`\n\nPrevious versions of the plugin named the temporary folder to create the warmer handler `_warmup`. It has been renamed to `.warmup` to better align with the serverless framework and other plugins' behaviours.\n\nRemembe to add `.warmup` to your git ignore.\n\n#### Default to Unqualified alias\n\nPrevious versions of the plugin used the `$LATEST` alias as default alias to warm up if no alias was provided. From v5, the unqualified alias is the default. You can still use the `$LATEST` alias by setting it using the `alias` option.\n\n```yaml\ncustom:\n  warmup:\n    default:\n      alias: $LATEST\n```\n\n#### Automatically exclude package level includes\n\nPrevious versions of the plugin exclude everything in the service folder and include the `.warmup` folder. This caused that any files that you include to the service level were also included in the plugin specially if you include ancestor folders (like `../**`)\nFrom v5, all service level include are automatically excluded from the plugin. You still override this behaviour using the `package` option.\n\n#### Removed shorthand\n\nPrevious versions of the plugin supported replacing the configuration by a boolean, a string representing a stage or an array of strings representing a list of stages. From v5, this is not supported anymore. The `enabled` option is equivalent.\n\n```yaml\ncustom:\n  warmup: 'prod'\n```\n\nis the same as\n```yaml\ncustom:\n  warmup:\n    default: # Name of the warmer, see above\n      enabled: 'prod'\n```\n\n#### Removed legacy options\n\nThe following legacy options have been completely removed:\n\n* **default** Has been renamed to `enabled`\n* **schedule** `schedule: rate(5 minutes)` is equivalent to `events: - schedule: rate(5 minutes)`.\n* **source** Has been renamed to `payload`\n* **sourceRaw** Has been renamed to `payloadRaw`\n\n#### Automatically creates a role for the lambda\n\nIf no role is provided in the `custom.warmup` config, a default role with minimal permissions is created for each warmer. See \"Permissions\" section\n\n#### Support Tracing\n\nIf tracing is enabled at the provider level or at the warmer config level, the X-Ray client is automatically installed and X-Ray tracing is enabled.\n\n#### Add a 1 second connect timeout to the AWS SDK\n\nSee the \"Networking\" section for more details.\n\n## Cost\n\nYou can check the Lambda [pricing](https://aws.amazon.com/lambda/pricing/) and CloudWatch [pricing](https://aws.amazon.com/cloudwatch/pricing/) or can use the [AWS Lambda Pricing Calculator](https://s3.amazonaws.com/lambda-tools/pricing-calculator.html) to estimate the monthly cost\n\n#### Example\n\nIf you have a single warmer and want to warm 10 functions, each with `memorySize = 1024` and `duration = 10`, using the default settings ($0.0000166667 for every GB-second) and ignoring the free tier:\n\n* WarmUp: runs 8640 times per month = $0.0\n* 10 warm lambdas: each invoked 8640 times per month = $0.3\n* Total = $0.3\n\nCloudWatch costs are not consdiered in this example.\n\n## Contribute\n\nHelp us making this plugin better and future-proof.\n\n* Clone the code\n* Install the dependencies with `npm install`\n* Create a feature branch `git checkout -b new_feature`\n* Add your code and add tests if you implement a new feature\n* Validate your changes `npm run lint` and `npm test` (or `npm run test-with-coverage`)\n\n## License\n\nThis software is released under the MIT license. See [the license file](LICENSE) for more details.\n\n[serverless-badge]: http://public.serverless.com/badges/v3.svg\n[serverless-badge-url]: http://www.serverless.com\n[npm-version-badge]: https://badge.fury.io/js/serverless-plugin-warmup.svg\n[npm-version-badge-url]: https://www.npmjs.com/package/serverless-plugin-warmup\n[npm-downloads-badge]: https://img.shields.io/npm/dm/serverless-plugin-warmup.svg\n[coveralls-badge]: https://coveralls.io/repos/juanjoDiaz/serverless-plugin-warmup/badge.svg?branch=main\n[coveralls-badge-url]: https://coveralls.io/r/juanjoDiaz/serverless-plugin-warmup?branch=main\n\n## Acknowledgements\n\nThanks to [Fidel](https://github.com/fidelLimited) who initially developed this plugin.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FjuanjoDiaz%2Fserverless-plugin-warmup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FjuanjoDiaz%2Fserverless-plugin-warmup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FjuanjoDiaz%2Fserverless-plugin-warmup/lists"}