mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
3.1 KiB
3.1 KiB
jaws.json
The jaws.json file contains configuration details for the included code and authorship details for easy publishing. This is similar to package.json but for jaws-modules. jaws.json files exist at a few different levels in a JAWS proejct:
- Project: lives at the root of your project. Defines things like stages.
lambdasdirectory:jaws.jsonexists for every lambda function. It defines things like memory size and api gateway endpoint configuration.
Common jaws.json attributes
The following attributes should exist in either a project or lambda jaws.json
- name: project/module or lambda action name
- version: project/module or lambda Semantic Versioning number.
- location: project/module or lambda scm url (if exists)
- author:
John Serverless <john@gmail.com> http://www.john.com - description: project/module or lambda desc.
Project level
See project jaws.json example here
project.stages: map of all your stages, and regions those stages are inproject.envVarBucket: name and region your s3 bucket that holds env var files
Lambda level
See lambda jaws.json example here
Lambda attributes
Note: All of the attrs below assume the lambda attribute key prefix.
Handler,MemorySize,Runtime,Timeout: can all be found in the aws docsenvVars: An array of environment variable names this project/module or lambda requiresdeploy: if true, this app will be deployed the next time thejaws deploy --tagsis run. Seedeploycommand docs for more info.package: How the code is packaged up into a zip fileoptimize: How code is optimized for node runtimes, to improve lambda cold start timebuilder: only"browserify"orfalsesupported now. Iffalsewill just zip up entirebackdirminify: js minify or notignore: array of node modules to ignore. See ignoringexclude: array of node modules to exclude. These modules will be loaded externally (from within zip or inside lambda). Noteaws-sdkfor node can not be browserified. See ignoringincludePaths: Paths rel to back (dirs or files) to be included in zip. Paths included after optimization step.
excludePatterns: Array of regular expressions rel to back. Removed before optimization step. If not optimizing, everything in back dir will be included in zip. Use this to exclude stuff you don't want in your zip. Strings will be passed tonew RegExp()
For optimize example for the most popular node modules see browserify tests
For non optimize example see non optimized tests
API Gateway (endpoint) attributes:
AUSTEN TODO...